SurfaceFactoryMeshAdapter Class Referenceabstract

Abstract interface adapting SurfaceFactory to a connected mesh representation. More...

`#include <surfaceFactoryMeshAdapter.h>`

Inheritance diagram for SurfaceFactoryMeshAdapter:

## Public Types

typedef int | Index
| Integer type representing a mesh index. More...
typedef std::intptr_t | FVarID
| Type used to identify and specify face-varying primvars. More...

## Protected Member Functions

Methods to query simple face properties
Methods to return simple properties associated with a face.
virtual bool | isFaceHole (Index faceIndex) const =0
| Returns if a face is a hole. More...
virtual int | getFaceSize (Index faceIndex) const =0
| Returns the size of a face (number of vertices) More...
Methods to gather indices for the face's vertices
These methods gather indices associated with the vertices of a face, e.g. the indices of the vertices themselves, or the indices of face-varying values associated with the vertices. These are used to quickly deal with linear limit surfaces without any inspection of the neighboring topology.
virtual int | getFaceVertexIndices (Index faceIndex, Index vertexIndices[]) const =0
| Gather the indices of the face's vertices. More...
virtual int | getFaceFVarValueIndices (Index faceIndex, FVarID fvarID, Index fvarValueIndices[]) const =0
| Gather the face-varying indices of the face's vertices. More...
Methods to identify the neighborhood of a face-vertex

These methods identify the topology and associated indices for the complete set of incident faces surrounding a corner (or face-vertex) of a face.

Methods here use "FaceVertex" in the name to emphasize that they require information for a particular corner vertex of the face.

The topology around the face-vertex is described by populating a given instance of a simple VertexDescriptor class – which fully describes the face-vertex, it incident faces and any sharpness assigned at or around the face-vertex. (See the comments with the VertexDescriptor definition for more details.)

Additional methods are then required to identify indices for the incident faces around a face-vertex. One method gathers the indices for control vertices of the mesh assigned to the incident faces (their VertexIndices), while the other gathers indices for a particular set of face-varying values assigned to them (their FVarValueIndices).

Both methods expect the incident faces to be ordered consistent with the specification in VertexDescriptor, and all indices for all incident faces are required.

The order of indices assigned to each face for these methods must also be specified relative to the face-vertex, rather than the way the face is defined. For example, if a quad Q is defined by the four vertices {A, B, C, D}, when gathering the indices for Q as part of face-vertex C, the indices should be specified starting with C, i.e. as {C, D, A, B}. Ordering indices this way makes it much easier for the factory to identify when face-varying topology differs from the vertex topology, and both the face-varying and vertex indices are ordered this way for consistency.

virtual int | populateFaceVertexDescriptor (Index faceIndex, int faceVertex, VertexDescriptor *vertexDescriptor) const =0
| Describe the topology of incident faces around a face-vertex. More...
virtual int | getFaceVertexIncidentFaceVertexIndices (Index faceIndex, int faceVertex, Index vertexIndices[]) const =0
| Gather vertex indices of incident faces around a face-vertex. More...
virtual int | getFaceVertexIncidentFaceFVarValueIndices (Index faceIndex, int faceVertex, FVarID fvarID, Index fvarValueIndices[]) const =0
| Gather face-varying indices of incident faces around a face-vertex. More...
Optional methods for purely regular topology

Optional methods for advanced use to accelerate the case of purely regular topology around a face.

For cases when a mesh can quickly determine if the neighborhood around a faces is purely regular, these methods can be used to quickly identify the control point indices for the corresponding regular patch defining its limit surface. In doing so, the more tedious topological assembly requiring information about each face-vertex can be avoided.

The indices returned must be ordered according to the regular patch type corresponding to the subdivision scheme of the mesh. Boundary vertices are allowed and indicated by an Index of -1.

The face-varying version will only be invoked if the vertex version is purely regular, in which case, the face-varying topology is expected to be similar.

Note that these methods allow the caller (the SurfaceFactory) to pass nullptr (0) for the index arrays – in which case only the return value should be provided.

virtual bool | getFaceNeighborhoodVertexIndicesIfRegular (Index faceIndex, Index vertexIndices[]) const
virtual bool | getFaceNeighborhoodFVarValueIndicesIfRegular (Index faceIndex, FVarID fvarID, Index fvarValueIndices[]) const

## Detailed Description

Abstract interface adapting SurfaceFactory to a connected mesh representation.

Definition at line 65 of file surfaceFactoryMeshAdapter.h.

## Member Typedef Documentation

## FVarID

typedef std::intptr_t FVarID

Type used to identify and specify face-varying primvars.

A face-varying ID is used to specify face-varying primvars for evaluation so that they can be identified by the subclass for the mesh. It can be assigned as either a positive integer ID or pointer, with the subclass determining its interpretation.

Often only one face-varying primvar is of interest, so a default can be assigned to the factory to avoid repeated specification.

Definition at line 80 of file surfaceFactoryMeshAdapter.h.

## Index

typedef int Index

Integer type representing a mesh index.

Definition at line 68 of file surfaceFactoryMeshAdapter.h.

## Member Function Documentation

## getFaceFVarValueIndices()

virtual int getFaceFVarValueIndices | ( | Index | faceIndex,
|  | FVarID | fvarID,
|  | Index | fvarValueIndices[]
| ) |  | const

protected pure virtual

Gather the face-varying indices of the face's vertices.

## getFaceNeighborhoodFVarValueIndicesIfRegular()

bool getFaceNeighborhoodFVarValueIndicesIfRegular | ( | Index | faceIndex,
|  | FVarID | fvarID,
|  | Index | fvarValueIndices[]
| ) |  | const

inline protected virtual

Definition at line 224 of file surfaceFactoryMeshAdapter.h.

## getFaceNeighborhoodVertexIndicesIfRegular()

bool getFaceNeighborhoodVertexIndicesIfRegular | ( | Index | faceIndex,
|  | Index | vertexIndices[]
| ) |  | const

inline protected virtual

Definition at line 218 of file surfaceFactoryMeshAdapter.h.

## getFaceSize()

virtual int getFaceSize | ( | Index | faceIndex | ) | const

protected pure virtual

Returns the size of a face (number of vertices)

## getFaceVertexIncidentFaceFVarValueIndices()

virtual int getFaceVertexIncidentFaceFVarValueIndices | ( | Index | faceIndex,
|  | int | faceVertex,
|  | FVarID | fvarID,
|  | Index | fvarValueIndices[]
| ) |  | const

protected pure virtual

Gather face-varying indices of incident faces around a face-vertex.

## getFaceVertexIncidentFaceVertexIndices()

virtual int getFaceVertexIncidentFaceVertexIndices | ( | Index | faceIndex,
|  | int | faceVertex,
|  | Index | vertexIndices[]
| ) |  | const

protected pure virtual

Gather vertex indices of incident faces around a face-vertex.

## getFaceVertexIndices()

virtual int getFaceVertexIndices | ( | Index | faceIndex,
|  | Index | vertexIndices[]
| ) |  | const

protected pure virtual

Gather the indices of the face's vertices.

## isFaceHole()

virtual bool isFaceHole | ( | Index | faceIndex | ) | const

protected pure virtual

Returns if a face is a hole.

## populateFaceVertexDescriptor()

virtual int populateFaceVertexDescriptor | ( | Index | faceIndex,
|  | int | faceVertex,
|  | VertexDescriptor * | vertexDescriptor
| ) |  | const

protected pure virtual

Describe the topology of incident faces around a face-vertex.

The documentation for this class was generated from the following file:

- opensubdiv/bfr/surfaceFactoryMeshAdapter.h