All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
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. More...
 
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. More...
 
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. More...
 
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. More...
 
template<typename VERTEX , typename MASK >
void ComputeVertexLimitMask (VERTEX const &vertexNeighborhood, MASK &positionMask, MASK &tangent1Mask, MASK &tangent2Mask, Crease::Rule vertexRule) const
 
template<>
Split GetTopologicalSplitType ()
 
template<>
int GetRegularFaceSize ()
 
template<>
int GetRegularVertexValence ()
 
template<>
int GetLocalNeighborhoodSize ()
 
template<>
void ComputeEdgeVertexMask (EDGE const &edge, MASK &mask, Crease::Rule, Crease::Rule) const
 
template<>
void ComputeVertexVertexMask (VERTEX const &vertex, MASK &mask, Crease::Rule, Crease::Rule) const
 
template<>
Split GetTopologicalSplitType ()
 
template<>
int GetRegularFaceSize ()
 
template<>
int GetRegularVertexValence ()
 
template<>
int GetLocalNeighborhoodSize ()
 
template<>
Split GetTopologicalSplitType ()
 
template<>
int GetRegularFaceSize ()
 
template<>
int GetRegularVertexValence ()
 
template<>
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
 
template<>
void assignCornerLimitMask (VERTEX const &, MASK &posMask) const
 
template<>
void assignCreaseLimitMask (VERTEX const &vertex, MASK &posMask, int const [2]) const
 
template<>
void assignSmoothLimitMask (VERTEX const &vertex, MASK &posMask) const
 
template<>
void assignCornerLimitTangentMasks (VERTEX const &, MASK &tan1Mask, MASK &tan2Mask) const
 
template<>
void assignCreaseLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask, int const [2]) const
 
template<>
void assignSmoothLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask) const
 
template<>
void assignSmoothMaskForEdge (EDGE const &edge, MASK &mask) const
 
template<>
void assignCreaseMaskForVertex (VERTEX const &vertex, MASK &mask, int const creaseEnds[2]) const
 
template<>
void assignSmoothMaskForVertex (VERTEX const &vertex, MASK &mask) const
 
template<>
void assignCornerLimitMask (VERTEX const &, MASK &posMask) const
 
template<>
void assignCreaseLimitMask (VERTEX const &vertex, MASK &posMask, int const creaseEnds[2]) const
 
template<>
void assignSmoothLimitMask (VERTEX const &vertex, MASK &posMask) const
 
template<>
void assignCornerLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask) const
 
template<>
void assignCreaseLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask, int const creaseEnds[2]) const
 
template<>
void assignSmoothLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask) const
 
template<>
void assignCreaseMaskForEdge (EDGE const &, MASK &mask) const
 
template<>
void assignSmoothMaskForEdge (EDGE const &edge, MASK &mask) const
 
template<>
void assignCornerMaskForVertex (VERTEX const &, MASK &mask) const
 
template<>
void assignCreaseMaskForVertex (VERTEX const &vertex, MASK &mask, int const creaseEnds[2]) const
 
template<>
void assignSmoothMaskForVertex (VERTEX const &vertex, MASK &mask) const
 
template<>
void assignCornerLimitMask (VERTEX const &, MASK &posMask) const
 
template<>
void assignCreaseLimitMask (VERTEX const &vertex, MASK &posMask, int const creaseEnds[2]) const
 
template<>
void assignSmoothLimitMask (VERTEX const &vertex, MASK &posMask) const
 
template<>
void assignCornerLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask) const
 
template<>
void assignCreaseLimitTangentMasks (VERTEX const &vertex, MASK &tan1Mask, MASK &tan2Mask, int const creaseEnds[2]) const
 
template<>
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 ( )
inline

Definition at line 70 of file scheme.h.

Scheme ( Options const &  options)
inline

Definition at line 72 of file scheme.h.

Member Function Documentation

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

Definition at line 84 of file bilinearScheme.h.

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

Definition at line 208 of file catmarkScheme.h.

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

Definition at line 223 of file loopScheme.h.

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

Definition at line 118 of file bilinearScheme.h.

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

Definition at line 299 of file catmarkScheme.h.

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

Definition at line 386 of file loopScheme.h.

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

Definition at line 142 of file loopScheme.h.

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

Definition at line 331 of file scheme.h.

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

Definition at line 97 of file bilinearScheme.h.

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

Definition at line 221 of file catmarkScheme.h.

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

Definition at line 236 of file loopScheme.h.

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

Definition at line 143 of file bilinearScheme.h.

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

Definition at line 332 of file catmarkScheme.h.

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

Definition at line 420 of file loopScheme.h.

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

Definition at line 70 of file loopScheme.h.

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

Definition at line 317 of file scheme.h.

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

Definition at line 148 of file catmarkScheme.h.

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

Definition at line 155 of file loopScheme.h.

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

Definition at line 106 of file bilinearScheme.h.

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

Definition at line 247 of file catmarkScheme.h.

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

Definition at line 273 of file loopScheme.h.

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

Definition at line 152 of file bilinearScheme.h.

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

Definition at line 451 of file catmarkScheme.h.

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

Definition at line 532 of file loopScheme.h.

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

Definition at line 71 of file catmarkScheme.h.

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

Definition at line 84 of file loopScheme.h.

void assignSmoothMaskForEdge ( EDGE const &  edge,
MASK &  mask 
) const
protected
void assignSmoothMaskForVertex ( VERTEX const &  vertex,
MASK &  mask 
) const
inlineprotected

Definition at line 173 of file catmarkScheme.h.

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

Definition at line 180 of file loopScheme.h.

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

Definition at line 62 of file bilinearScheme.h.

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.

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

Face-vertex masks - trivial for all current schemes.

Definition at line 348 of file scheme.h.

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.

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

Definition at line 629 of file scheme.h.

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

Definition at line 71 of file bilinearScheme.h.

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.

int GetLocalNeighborhoodSize ( )
inline

Definition at line 53 of file bilinearScheme.h.

int GetLocalNeighborhoodSize ( )
inline

Definition at line 56 of file catmarkScheme.h.

int GetLocalNeighborhoodSize ( )
inline

Definition at line 57 of file loopScheme.h.

static int GetLocalNeighborhoodSize ( )
static
Options GetOptions ( ) const
inline

Definition at line 74 of file scheme.h.

int GetRegularFaceSize ( )
inline

Definition at line 47 of file bilinearScheme.h.

int GetRegularFaceSize ( )
inline

Definition at line 50 of file catmarkScheme.h.

int GetRegularFaceSize ( )
inline

Definition at line 51 of file loopScheme.h.

static int GetRegularFaceSize ( )
static
int GetRegularVertexValence ( )
inline

Definition at line 50 of file bilinearScheme.h.

int GetRegularVertexValence ( )
inline

Definition at line 53 of file catmarkScheme.h.

int GetRegularVertexValence ( )
inline

Definition at line 54 of file loopScheme.h.

static int GetRegularVertexValence ( )
static
Split GetTopologicalSplitType ( )
inline

Definition at line 44 of file bilinearScheme.h.

Split GetTopologicalSplitType ( )
inline

Definition at line 47 of file catmarkScheme.h.

Split GetTopologicalSplitType ( )
inline

Definition at line 48 of file loopScheme.h.

static Split GetTopologicalSplitType ( )
static
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: