OpenSubdiv
Loading...
Searching...
No Matches
Scheme< SCHEME_TYPE > Class Template Reference

Scheme is a class template which provides all implementation for the subdivision schemes supported by OpenSubdiv through specializations of the methods of each. An instance of Scheme<SCHEME_TYPE> includes a set of Options that will dictate the variable aspects of its behavior.
More...

#include <scheme.h>

Classes

class  LocalMask
 

Public Member Functions

 Scheme ()
 
 Scheme (Options const &options)
 
Options GetOptions () const
 
void SetOptions (const Options &newOptions)
 
template<typename FACE , typename MASK >
void ComputeFaceVertexMask (FACE const &faceNeighborhood, MASK &faceVertexMask) const
 Face-vertex masks - trivial for all current schemes.
 
template<typename EDGE , typename MASK >
void ComputeEdgeVertexMask (EDGE const &edgeNeighborhood, MASK &edgeVertexMask, Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule childRule=Crease::RULE_UNKNOWN) const
 Edge-vertex masks If known, the Rule for the edge and/or the derived vertex can be specified to accelerate the computation (though the Rule for the parent is trivially determined). In particular, knowing the child rule can avoid the need to subdivide the sharpness of the edge to see if it is a transitional crease that warrants fractional blending.
 
template<typename VERTEX , typename MASK >
void ComputeVertexVertexMask (VERTEX const &vertexNeighborhood, MASK &vertexVertexMask, Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule childRule=Crease::RULE_UNKNOWN) const
 Vertex-vertex masks If known, a single Rule or pair of Rules can be specified (indicating a crease transition) to accelerate the computation. Either no Rules, the first, or both should be specified. Specification of only the first Rule implies it to be true for both (wish the compiler would allow such default value specification), i.e. no transition. The case of knowing the parent Rule but deferring determination of the child Rule to this method is not supported.
 
template<typename VERTEX , typename MASK >
void ComputeVertexLimitMask (VERTEX const &vertexNeighborhood, MASK &positionMask, Crease::Rule vertexRule) const
 Limit masks for vertices – position and tangents These presume that a vertex is suitably isolated for its limit to be well-defined and, unlike the refinement masks, the subdivision Rule for the vertex (presumably at its last level of refinement) is required rather than being optional. In the presence of semi-sharp creasing that has not decayed to zero, the limit is neither sharp nor smooth – in such cases the Rule specified by the caller determines the result.
 
template<typename VERTEX , typename MASK >
void ComputeVertexLimitMask (VERTEX const &vertexNeighborhood, MASK &positionMask, MASK &tangent1Mask, MASK &tangent2Mask, Crease::Rule vertexRule) const
 
Split GetTopologicalSplitType ()
 
int GetRegularFaceSize ()
 
int GetRegularVertexValence ()
 
int GetLocalNeighborhoodSize ()
 
void ComputeEdgeVertexMask (EDGE const &edge, MASK &mask, Crease::Rule, Crease::Rule) const
 
void ComputeVertexVertexMask (VERTEX const &vertex, MASK &mask, Crease::Rule, Crease::Rule) const
 
Split GetTopologicalSplitType ()
 
int GetRegularFaceSize ()
 
int GetRegularVertexValence ()
 
int GetLocalNeighborhoodSize ()
 
Split GetTopologicalSplitType ()
 
int GetRegularFaceSize ()
 
int GetRegularVertexValence ()
 
int GetLocalNeighborhoodSize ()
 

Static Public Member Functions

static Split GetTopologicalSplitType ()
 
static int GetRegularFaceSize ()
 
static int GetRegularVertexValence ()
 
static int GetLocalNeighborhoodSize ()
 

Protected Member Functions

template<typename EDGE , typename MASK >
void assignCreaseMaskForEdge (EDGE const &edge, MASK &mask) const
 
template<typename EDGE , typename MASK >
void assignSmoothMaskForEdge (EDGE const &edge, MASK &mask) const
 
template<typename VERTEX , typename MASK >
void assignCornerMaskForVertex (VERTEX const &edge, MASK &mask) const
 
template<typename VERTEX , typename MASK >
void assignCreaseMaskForVertex (VERTEX const &edge, MASK &mask, int const creaseEnds[2]) const
 
template<typename VERTEX , typename MASK >
void assignSmoothMaskForVertex (VERTEX const &edge, MASK &mask) const
 
template<typename VERTEX , typename MASK >
void assignCornerLimitMask (VERTEX const &vertex, MASK &pos) const
 
template<typename VERTEX , typename MASK >
void assignCreaseLimitMask (VERTEX const &vertex, MASK &pos, int const creaseEnds[2]) const
 
template<typename VERTEX , typename MASK >
void assignSmoothLimitMask (VERTEX const &vertex, MASK &pos) const
 
template<typename VERTEX , typename MASK >
void assignCornerLimitTangentMasks (VERTEX const &vertex, MASK &tan1, MASK &tan2) const
 
template<typename VERTEX , typename MASK >
void assignCreaseLimitTangentMasks (VERTEX const &vertex, MASK &tan1, MASK &tan2, int const creaseEnds[2]) const
 
template<typename VERTEX , typename MASK >
void assignSmoothLimitTangentMasks (VERTEX const &vertex, MASK &tan1, MASK &tan2) const
 
void assignCornerLimitMask (VERTEX const &, MASK &posMask) const
 
void assignCreaseLimitMask (VERTEX const &vertex, MASK &posMask, int const[2]) const
 
void assignSmoothLimitMask (VERTEX const &vertex, MASK &posMask) const
 
void assignCornerLimitTangentMasks (VERTEX const &, MASK &tan1Mask, MASK &tan2Mask) const
 
void assignCreaseLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask, int const[2]) const
 
void assignSmoothLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask) const
 
void assignSmoothMaskForEdge (EDGE const &edge, MASK &mask) const
 
void assignCreaseMaskForVertex (VERTEX const &vertex, MASK &mask, int const creaseEnds[2]) const
 
void assignSmoothMaskForVertex (VERTEX const &vertex, MASK &mask) const
 
void assignCornerLimitMask (VERTEX const &, MASK &posMask) const
 
void assignCreaseLimitMask (VERTEX const &vertex, MASK &posMask, int const creaseEnds[2]) const
 
void assignSmoothLimitMask (VERTEX const &vertex, MASK &posMask) const
 
void assignCornerLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask) const
 
void assignCreaseLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask, int const creaseEnds[2]) const
 
void assignSmoothLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask) const
 
void assignCreaseMaskForEdge (EDGE const &, MASK &mask) const
 
void assignSmoothMaskForEdge (EDGE const &edge, MASK &mask) const
 
void assignCornerMaskForVertex (VERTEX const &, MASK &mask) const
 
void assignCreaseMaskForVertex (VERTEX const &vertex, MASK &mask, int const creaseEnds[2]) const
 
void assignSmoothMaskForVertex (VERTEX const &vertex, MASK &mask) const
 
void assignCornerLimitMask (VERTEX const &, MASK &posMask) const
 
void assignCreaseLimitMask (VERTEX const &vertex, MASK &posMask, int const creaseEnds[2]) const
 
void assignSmoothLimitMask (VERTEX const &vertex, MASK &posMask) const
 
void assignCornerLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask) const
 
void assignCreaseLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask, int const creaseEnds[2]) const
 
void assignSmoothLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask) const
 

Detailed Description

template<SchemeType SCHEME_TYPE>
class OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Scheme< SCHEME_TYPE >

Scheme is a class template which provides all implementation for the subdivision schemes supported by OpenSubdiv through specializations of the methods of each. An instance of Scheme<SCHEME_TYPE> includes a set of Options that will dictate the variable aspects of its behavior.

The primary purpose of Scheme is to provide the mask weights for vertices generated by subdivision. Methods to determine the masks are given topological neighborhoods from which to compute the appropriate weights for neighboring components. While these neighborhoods may require sharpness values for creasing, the computation of subdivided crease values is independent of the scheme type and is also made available through the Crease class.

Mask queries are assisted by two utility classes – a Neighborhood class defining the set of relevant data in the topological neighborhood of the vertex being subdivided, and a Mask class into which the associated mask weights will be stored. Depending on where and how these queries are used, more or less information may be available. See the details of the Neighborhood classes as appropriate initialization of them is critical. It is generally best to initialize them with what data is known and accessible for immediate and efficient retrieval, but subclasses can be created to gather it lazily if desired.

Definition at line 66 of file scheme.h.

Constructor & Destructor Documentation

◆ Scheme() [1/2]

Scheme ( )
inline

Definition at line 70 of file scheme.h.

◆ Scheme() [2/2]

Scheme ( Options const &  options)
inline

Definition at line 72 of file scheme.h.

Member Function Documentation

◆ assignCornerLimitMask() [1/4]

void assignCornerLimitMask ( VERTEX const &  ,
MASK &  posMask 
) const
inlineprotected

Definition at line 84 of file bilinearScheme.h.

◆ assignCornerLimitMask() [2/4]

void assignCornerLimitMask ( VERTEX const &  ,
MASK &  posMask 
) const
inlineprotected

Definition at line 208 of file catmarkScheme.h.

◆ assignCornerLimitMask() [3/4]

void assignCornerLimitMask ( VERTEX const &  ,
MASK &  posMask 
) const
inlineprotected

Definition at line 223 of file loopScheme.h.

◆ assignCornerLimitMask() [4/4]

void assignCornerLimitMask ( VERTEX const &  vertex,
MASK &  pos 
) const
protected

◆ assignCornerLimitTangentMasks() [1/4]

void assignCornerLimitTangentMasks ( VERTEX const &  ,
MASK &  tan1Mask,
MASK &  tan2Mask 
) const
inlineprotected

Definition at line 118 of file bilinearScheme.h.

◆ assignCornerLimitTangentMasks() [2/4]

void assignCornerLimitTangentMasks ( VERTEX const &  vertex,
MASK &  tan1,
MASK &  tan2 
) const
protected

◆ assignCornerLimitTangentMasks() [3/4]

void assignCornerLimitTangentMasks ( VERTEX const &  vertex,
MASK &  tan1Mask,
MASK &  tan2Mask 
) const
inlineprotected

Definition at line 301 of file catmarkScheme.h.

◆ assignCornerLimitTangentMasks() [4/4]

void assignCornerLimitTangentMasks ( VERTEX const &  vertex,
MASK &  tan1Mask,
MASK &  tan2Mask 
) const
inlineprotected

Definition at line 386 of file loopScheme.h.

◆ assignCornerMaskForVertex() [1/2]

void assignCornerMaskForVertex ( VERTEX const &  ,
MASK &  mask 
) const
inlineprotected

Definition at line 142 of file loopScheme.h.

◆ assignCornerMaskForVertex() [2/2]

void assignCornerMaskForVertex ( VERTEX const &  edge,
MASK &  mask 
) const
inlineprotected

Definition at line 331 of file scheme.h.

◆ assignCreaseLimitMask() [1/4]

void assignCreaseLimitMask ( VERTEX const &  vertex,
MASK &  pos,
int const  creaseEnds[2] 
) const
protected

◆ assignCreaseLimitMask() [2/4]

void assignCreaseLimitMask ( VERTEX const &  vertex,
MASK &  posMask,
int const  creaseEnds[2] 
) const
inlineprotected

Definition at line 221 of file catmarkScheme.h.

◆ assignCreaseLimitMask() [3/4]

void assignCreaseLimitMask ( VERTEX const &  vertex,
MASK &  posMask,
int const  creaseEnds[2] 
) const
inlineprotected

Definition at line 236 of file loopScheme.h.

◆ assignCreaseLimitMask() [4/4]

void assignCreaseLimitMask ( VERTEX const &  vertex,
MASK &  posMask,
int const  [2] 
) const
inlineprotected

Definition at line 97 of file bilinearScheme.h.

◆ assignCreaseLimitTangentMasks() [1/4]

void assignCreaseLimitTangentMasks ( VERTEX const &  vertex,
MASK &  tan1,
MASK &  tan2,
int const  creaseEnds[2] 
) const
protected

◆ assignCreaseLimitTangentMasks() [2/4]

void assignCreaseLimitTangentMasks ( VERTEX const &  vertex,
MASK &  tan1Mask,
MASK &  tan2Mask,
int const  creaseEnds[2] 
) const
inlineprotected

Definition at line 334 of file catmarkScheme.h.

◆ assignCreaseLimitTangentMasks() [3/4]

void assignCreaseLimitTangentMasks ( VERTEX const &  vertex,
MASK &  tan1Mask,
MASK &  tan2Mask,
int const  creaseEnds[2] 
) const
inlineprotected

Definition at line 420 of file loopScheme.h.

◆ assignCreaseLimitTangentMasks() [4/4]

void assignCreaseLimitTangentMasks ( VERTEX const &  vertex,
MASK &  tan1Mask,
MASK &  tan2Mask,
int const  [2] 
) const
inlineprotected

Definition at line 143 of file bilinearScheme.h.

◆ assignCreaseMaskForEdge() [1/2]

void assignCreaseMaskForEdge ( EDGE const &  ,
MASK &  mask 
) const
inlineprotected

Definition at line 70 of file loopScheme.h.

◆ assignCreaseMaskForEdge() [2/2]

void assignCreaseMaskForEdge ( EDGE const &  edge,
MASK &  mask 
) const
inlineprotected

Definition at line 317 of file scheme.h.

◆ assignCreaseMaskForVertex() [1/3]

void assignCreaseMaskForVertex ( VERTEX const &  edge,
MASK &  mask,
int const  creaseEnds[2] 
) const
protected

◆ assignCreaseMaskForVertex() [2/3]

void assignCreaseMaskForVertex ( VERTEX const &  vertex,
MASK &  mask,
int const  creaseEnds[2] 
) const
inlineprotected

Definition at line 148 of file catmarkScheme.h.

◆ assignCreaseMaskForVertex() [3/3]

void assignCreaseMaskForVertex ( VERTEX const &  vertex,
MASK &  mask,
int const  creaseEnds[2] 
) const
inlineprotected

Definition at line 155 of file loopScheme.h.

◆ assignSmoothLimitMask() [1/4]

void assignSmoothLimitMask ( VERTEX const &  vertex,
MASK &  pos 
) const
protected

◆ assignSmoothLimitMask() [2/4]

void assignSmoothLimitMask ( VERTEX const &  vertex,
MASK &  posMask 
) const
inlineprotected

Definition at line 106 of file bilinearScheme.h.

◆ assignSmoothLimitMask() [3/4]

void assignSmoothLimitMask ( VERTEX const &  vertex,
MASK &  posMask 
) const
inlineprotected

Definition at line 247 of file catmarkScheme.h.

◆ assignSmoothLimitMask() [4/4]

void assignSmoothLimitMask ( VERTEX const &  vertex,
MASK &  posMask 
) const
inlineprotected

Definition at line 273 of file loopScheme.h.

◆ assignSmoothLimitTangentMasks() [1/4]

void assignSmoothLimitTangentMasks ( VERTEX const &  vertex,
MASK &  tan1,
MASK &  tan2 
) const
protected

◆ assignSmoothLimitTangentMasks() [2/4]

void assignSmoothLimitTangentMasks ( VERTEX const &  vertex,
MASK &  tan1Mask,
MASK &  tan2Mask 
) const
inlineprotected

Definition at line 152 of file bilinearScheme.h.

◆ assignSmoothLimitTangentMasks() [3/4]

void assignSmoothLimitTangentMasks ( VERTEX const &  vertex,
MASK &  tan1Mask,
MASK &  tan2Mask 
) const
inlineprotected

Definition at line 453 of file catmarkScheme.h.

◆ assignSmoothLimitTangentMasks() [4/4]

void assignSmoothLimitTangentMasks ( VERTEX const &  vertex,
MASK &  tan1Mask,
MASK &  tan2Mask 
) const
inlineprotected

Definition at line 532 of file loopScheme.h.

◆ assignSmoothMaskForEdge() [1/3]

void assignSmoothMaskForEdge ( EDGE const &  edge,
MASK &  mask 
) const
inlineprotected

Definition at line 71 of file catmarkScheme.h.

◆ assignSmoothMaskForEdge() [2/3]

void assignSmoothMaskForEdge ( EDGE const &  edge,
MASK &  mask 
) const
inlineprotected

Definition at line 84 of file loopScheme.h.

◆ assignSmoothMaskForEdge() [3/3]

void assignSmoothMaskForEdge ( EDGE const &  edge,
MASK &  mask 
) const
protected

◆ assignSmoothMaskForVertex() [1/3]

void assignSmoothMaskForVertex ( VERTEX const &  edge,
MASK &  mask 
) const
protected

◆ assignSmoothMaskForVertex() [2/3]

void assignSmoothMaskForVertex ( VERTEX const &  vertex,
MASK &  mask 
) const
inlineprotected

Definition at line 173 of file catmarkScheme.h.

◆ assignSmoothMaskForVertex() [3/3]

void assignSmoothMaskForVertex ( VERTEX const &  vertex,
MASK &  mask 
) const
inlineprotected

Definition at line 180 of file loopScheme.h.

◆ ComputeEdgeVertexMask() [1/2]

void ComputeEdgeVertexMask ( EDGE const &  edge,
MASK &  mask,
Crease::Rule  ,
Crease::Rule   
) const

Definition at line 62 of file bilinearScheme.h.

◆ ComputeEdgeVertexMask() [2/2]

void ComputeEdgeVertexMask ( EDGE const &  edgeNeighborhood,
MASK &  edgeVertexMask,
Crease::Rule  parentRule = Crease::RULE_UNKNOWN,
Crease::Rule  childRule = Crease::RULE_UNKNOWN 
) const

Edge-vertex masks If known, the Rule for the edge and/or the derived vertex can be specified to accelerate the computation (though the Rule for the parent is trivially determined). In particular, knowing the child rule can avoid the need to subdivide the sharpness of the edge to see if it is a transitional crease that warrants fractional blending.

Whether to use the "Rules" in this interface is really debatable – the parent Rule is really based on the edge and its sharpness, while the child Rule is technically based on the neighborhood of the child vertex, but it can be deduced from the two child edges' sharpness. So the Crease methods used to compute these rules differ from those for the vertex-vertex mask. Perhaps a simple pair of new methods for Crease should be added specific to the edge-vertex case, i.e. one that takes a single sharpness (for the parent rule) and one that takes a pair (for the child).

Definition at line 392 of file scheme.h.

◆ ComputeFaceVertexMask()

void ComputeFaceVertexMask ( FACE const &  faceNeighborhood,
MASK &  faceVertexMask 
) const

Face-vertex masks - trivial for all current schemes.

Definition at line 348 of file scheme.h.

◆ ComputeVertexLimitMask() [1/2]

void ComputeVertexLimitMask ( VERTEX const &  vertexNeighborhood,
MASK &  positionMask,
Crease::Rule  vertexRule 
) const

Limit masks for vertices – position and tangents These presume that a vertex is suitably isolated for its limit to be well-defined and, unlike the refinement masks, the subdivision Rule for the vertex (presumably at its last level of refinement) is required rather than being optional. In the presence of semi-sharp creasing that has not decayed to zero, the limit is neither sharp nor smooth – in such cases the Rule specified by the caller determines the result.

For tangent masks, the direction of the first tangent (T1) is oriented towards the leading edge of the vertex, i.e. the first incident edge of the vertex (beginning the set of incident edges in counter-clockwise order). The second tangent (T2) lies within the tangent plane such that its normal can be computed as T1 x T2. So for a boundary vertex, T1 will point along the boundary in the direction of the leading edge while T2 points inward across the limit surface.

As for magnitude, no assumptions should be made of the magnitudes of the resulting tangent vectors. Common formulae often factor out scale factors that contribute to magnitude. While some attempt has been made to make magnitudes more consistent between regular corners, boundaries and the interior, the same has not been done at irregular vertices – at least not yet. This may be addressed in future, as having consistent magnitudes returned here can aid in the construction of patches from limit positions and tangents.

Definition at line 607 of file scheme.h.

◆ ComputeVertexLimitMask() [2/2]

void ComputeVertexLimitMask ( VERTEX const &  vertexNeighborhood,
MASK &  positionMask,
MASK &  tangent1Mask,
MASK &  tangent2Mask,
Crease::Rule  vertexRule 
) const

Definition at line 629 of file scheme.h.

◆ ComputeVertexVertexMask() [1/2]

void ComputeVertexVertexMask ( VERTEX const &  vertex,
MASK &  mask,
Crease::Rule  ,
Crease::Rule   
) const

Definition at line 71 of file bilinearScheme.h.

◆ ComputeVertexVertexMask() [2/2]

void ComputeVertexVertexMask ( VERTEX const &  vertexNeighborhood,
MASK &  vertexVertexMask,
Crease::Rule  parentRule = Crease::RULE_UNKNOWN,
Crease::Rule  childRule = Crease::RULE_UNKNOWN 
) const

Vertex-vertex masks If known, a single Rule or pair of Rules can be specified (indicating a crease transition) to accelerate the computation. Either no Rules, the first, or both should be specified. Specification of only the first Rule implies it to be true for both (wish the compiler would allow such default value specification), i.e. no transition. The case of knowing the parent Rule but deferring determination of the child Rule to this method is not supported.

Definition at line 512 of file scheme.h.

◆ GetLocalNeighborhoodSize() [1/4]

int GetLocalNeighborhoodSize ( )
inline

Definition at line 53 of file bilinearScheme.h.

◆ GetLocalNeighborhoodSize() [2/4]

int GetLocalNeighborhoodSize ( )
inline

Definition at line 56 of file catmarkScheme.h.

◆ GetLocalNeighborhoodSize() [3/4]

int GetLocalNeighborhoodSize ( )
inline

Definition at line 57 of file loopScheme.h.

◆ GetLocalNeighborhoodSize() [4/4]

static int GetLocalNeighborhoodSize ( )
static

◆ GetOptions()

Options GetOptions ( ) const
inline

Definition at line 74 of file scheme.h.

◆ GetRegularFaceSize() [1/4]

int GetRegularFaceSize ( )
inline

Definition at line 47 of file bilinearScheme.h.

◆ GetRegularFaceSize() [2/4]

int GetRegularFaceSize ( )
inline

Definition at line 50 of file catmarkScheme.h.

◆ GetRegularFaceSize() [3/4]

int GetRegularFaceSize ( )
inline

Definition at line 51 of file loopScheme.h.

◆ GetRegularFaceSize() [4/4]

static int GetRegularFaceSize ( )
static

◆ GetRegularVertexValence() [1/4]

int GetRegularVertexValence ( )
inline

Definition at line 50 of file bilinearScheme.h.

◆ GetRegularVertexValence() [2/4]

int GetRegularVertexValence ( )
inline

Definition at line 53 of file catmarkScheme.h.

◆ GetRegularVertexValence() [3/4]

int GetRegularVertexValence ( )
inline

Definition at line 54 of file loopScheme.h.

◆ GetRegularVertexValence() [4/4]

static int GetRegularVertexValence ( )
static

◆ GetTopologicalSplitType() [1/4]

Split GetTopologicalSplitType ( )
inline

Definition at line 44 of file bilinearScheme.h.

◆ GetTopologicalSplitType() [2/4]

Split GetTopologicalSplitType ( )
inline

Definition at line 47 of file catmarkScheme.h.

◆ GetTopologicalSplitType() [3/4]

Split GetTopologicalSplitType ( )
inline

Definition at line 48 of file loopScheme.h.

◆ GetTopologicalSplitType() [4/4]

static Split GetTopologicalSplitType ( )
static

◆ SetOptions()

void SetOptions ( const Options newOptions)
inline

Definition at line 75 of file scheme.h.


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