All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TopologyRefiner Class Reference

Stores topology data for a specified set of refinement options. More...

#include <topologyRefiner.h>

Public Member Functions

 TopologyRefiner (Sdc::Type type, Sdc::Options options=Sdc::Options())
 Constructor. More...
 
 ~TopologyRefiner ()
 Destructor. More...
 
Sdc::Type GetSchemeType () const
 Returns the subdivision scheme. More...
 
Sdc::Options GetSchemeOptions () const
 Returns the subdivision options. More...
 
bool IsUniform () const
 Returns true if uniform subdivision has been applied. More...
 
int GetMaxLevel () const
 Returns the highest level of refinement. More...
 
int GetNumVerticesTotal () const
 Returns the total number of vertices in all levels. More...
 
int GetNumEdgesTotal () const
 Returns the total number of edges in all levels. More...
 
int GetNumFacesTotal () const
 Returns the total number of edges in all levels. More...
 
int GetNumFaceVerticesTotal () const
 Returns the total number of face vertices in all levels. More...
 
void RefineUniform (int maxLevel, bool fullTopologyInLastLevel=false)
 Refine the topology uniformly. More...
 
void RefineAdaptive (int maxLevel, bool fullTopologyInLastLevel=false)
 Feature Adaptive topology refinement. More...
 
void Unrefine ()
 Unrefine the topology (keep control cage) More...
 
void Clear ()
 Clear the topology entirely. More...
 
template<class T , class U >
void Interpolate (T const *src, U *dst) const
 Apply vertex and varying interpolation weights to a primvar buffer. More...
 
template<class T , class U >
void Interpolate (int level, T const *src, U *dst) const
 Apply vertex and varying interpolation weights to a primvar buffer for a single level level of refinement. More...
 
template<class T , class U >
void InterpolateVarying (T const *src, U *dst) const
 Apply only varying interpolation weights to a primvar buffer. More...
 
template<class T , class U >
void InterpolateVarying (int level, T const *src, U *dst) const
 Apply only varying interpolation weights to a primvar buffer for a single level level of refinement. More...
 
template<class T , class U >
void InterpolateFaceVarying (T const *src, U *dst, int channel=0) const
 Apply face-varying interpolation weights to a primvar buffer. More...
 
template<class T , class U >
void InterpolateFaceVarying (int level, T const *src, U *dst, int channel=0) const
 
int GetNumVertices (int level) const
 Returns the number of vertices at a given level of refinement. More...
 
int GetNumEdges (int level) const
 Returns the number of edges at a given level of refinement. More...
 
int GetNumFaces (int level) const
 Returns the number of face vertex indices at a given level of refinement. More...
 
int GetNumFaceVertices (int level) const
 Returns the number of faces at a given level of refinement. More...
 
float GetEdgeSharpness (int level, Index edge) const
 Returns the sharpness of a given edge (at 'level' of refinement) More...
 
float GetVertexSharpness (int level, Index vert) const
 Returns the sharpness of a given vertex (at 'level' of refinement) More...
 
Sdc::Crease::Rule GetVertexRule (int level, Index vert) const
 Returns the subdivision rule of a given vertex (at 'level' of refinement) More...
 
IndexArray const GetFaceVertices (int level, Index face) const
 Returns the vertices of a 'face' at 'level'. More...
 
IndexArray const GetFaceEdges (int level, Index face) const
 Returns the edges of a 'face' at 'level'. More...
 
IndexArray const GetEdgeVertices (int level, Index edge) const
 Returns the vertices of an 'edge' at 'level' (2 of them) More...
 
IndexArray const GetEdgeFaces (int level, Index edge) const
 Returns the faces incident to 'edge' at 'level'. More...
 
IndexArray const GetVertexFaces (int level, Index vert) const
 Returns the faces incident to 'vertex' at 'level'. More...
 
IndexArray const GetVertexEdges (int level, Index vert) const
 Returns the edges incident to 'vertex' at 'level'. More...
 
LocalIndexArray const VertexFaceLocalIndices (int level, Index vert) const
 Returns the local face indices of vertex 'vert' at 'level'. More...
 
LocalIndexArray const VertexEdgeLocalIndices (int level, Index vert) const
 Returns the local edge indices of vertex 'vert' at 'level'. More...
 
Index FindEdge (int level, Index v0, Index v1) const
 Returns the edge with vertices'v0' and 'v1' (or -1 if they are not connected) More...
 
int GetNumFVarChannels () const
 Returns the number of face-varying channels in the tables. More...
 
int GetNumFVarValuesTotal (int channel=0) const
 Returns the total number of face-varying values in all levels. More...
 
int GetNumFVarValues (int level, int channel=0) const
 Returns the number of face-varying values at a given level of refinement. More...
 
IndexArray const GetFVarFaceValues (int level, Index face, int channel=0) const
 Returns the face-varying values of a 'face' at 'level'. More...
 
IndexArray const GetFaceChildFaces (int level, Index f) const
 Returns the child faces of face 'f' at 'level'. More...
 
IndexArray const GetFaceChildEdges (int level, Index f) const
 Returns the child edges of face 'f' at 'level'. More...
 
IndexArray const GetEdgeChildEdges (int level, Index e) const
 Returns the child edges of edge 'e' at 'level'. More...
 
Index GetFaceChildVertex (int level, Index f) const
 Returns the child vertex of face 'f' at 'level'. More...
 
Index GetEdgeChildVertex (int level, Index e) const
 Returns the child vertex of edge 'e' at 'level'. More...
 
Index GetVertexChildVertex (int level, Index v) const
 Returns the child vertex of vertex 'v' at 'level'. More...
 
int GetNumPtexFaces () const
 Returns the number of ptex faces in the mesh. More...
 
int GetPtexIndex (Index f) const
 Returns the ptex face index given a coarse face 'f' or -1. More...
 
bool ValidateTopology (int level) const
 Returns true if the topology of 'level' is valid. More...
 
void PrintTopology (int level, bool children=true) const
 Prints topology information to console. More...
 

Protected Member Functions

int getNumLevels () const
 
Vtr::LevelgetBaseLevel ()
 
Vtr::LevelgetLevel (int l)
 
Vtr::Level const & getLevel (int l) const
 
Vtr::Refinement const & getRefinement (int l) const
 
int getNumBaseFaces () const
 
int getNumBaseEdges () const
 
int getNumBaseVertices () const
 
void setNumBaseFaces (int count)
 
void setNumBaseEdges (int count)
 
void setNumBaseVertices (int count)
 
void setNumBaseFaceVertices (Index f, int count)
 
void setNumBaseEdgeFaces (Index e, int count)
 
void setNumBaseVertexFaces (Index v, int count)
 
void setNumBaseVertexEdges (Index v, int count)
 
IndexArray setBaseFaceVertices (Index f)
 
IndexArray setBaseFaceEdges (Index f)
 
IndexArray setBaseEdgeVertices (Index e)
 
IndexArray setBaseEdgeFaces (Index e)
 
IndexArray setBaseVertexFaces (Index v)
 
IndexArray setBaseVertexEdges (Index v)
 
LocalIndexArray setBaseVertexFaceLocalIndices (Index v)
 
LocalIndexArray setBaseVertexEdgeLocalIndices (Index v)
 
float & baseEdgeSharpness (Index e)
 
float & baseVertexSharpness (Index v)
 
int createFVarChannel (int numValues)
 
int createFVarChannel (int numValues, Sdc::Options const &options)
 
void completeFVarChannelTopology (int channel=0)
 
IndexArray getBaseFVarFaceValues (Index face, int channel=0)
 
void populateLocalIndices ()
 

Friends

template<class MESH >
class TopologyRefinerFactory
 
class TopologyRefinerFactoryBase
 
class PatchTablesFactory
 

Detailed Description

Stores topology data for a specified set of refinement options.

Definition at line 55 of file topologyRefiner.h.

Constructor & Destructor Documentation

TopologyRefiner ( Sdc::Type  type,
Sdc::Options  options = Sdc::Options() 
)

Constructor.

Destructor.

Member Function Documentation

float& baseEdgeSharpness ( Index  e)
inlineprotected

Definition at line 426 of file topologyRefiner.h.

float& baseVertexSharpness ( Index  v)
inlineprotected

Definition at line 427 of file topologyRefiner.h.

void Clear ( )

Clear the topology entirely.

void completeFVarChannelTopology ( int  channel = 0)
inlineprotected

Definition at line 436 of file topologyRefiner.h.

int createFVarChannel ( int  numValues)
inlineprotected

Definition at line 430 of file topologyRefiner.h.

int createFVarChannel ( int  numValues,
Sdc::Options const &  options 
)
inlineprotected

Definition at line 433 of file topologyRefiner.h.

Index FindEdge ( int  level,
Index  v0,
Index  v1 
) const
inline

Returns the edge with vertices'v0' and 'v1' (or -1 if they are not connected)

Definition at line 290 of file topologyRefiner.h.

IndexArray getBaseFVarFaceValues ( Index  face,
int  channel = 0 
)
inlineprotected

Definition at line 438 of file topologyRefiner.h.

Vtr::Level& getBaseLevel ( )
inlineprotected

Definition at line 394 of file topologyRefiner.h.

IndexArray const GetEdgeChildEdges ( int  level,
Index  e 
) const
inline

Returns the child edges of edge 'e' at 'level'.

Definition at line 336 of file topologyRefiner.h.

Index GetEdgeChildVertex ( int  level,
Index  e 
) const
inline

Returns the child vertex of edge 'e' at 'level'.

Definition at line 346 of file topologyRefiner.h.

IndexArray const GetEdgeFaces ( int  level,
Index  edge 
) const
inline

Returns the faces incident to 'edge' at 'level'.

Definition at line 264 of file topologyRefiner.h.

float GetEdgeSharpness ( int  level,
Index  edge 
) const
inline

Returns the sharpness of a given edge (at 'level' of refinement)

Definition at line 228 of file topologyRefiner.h.

IndexArray const GetEdgeVertices ( int  level,
Index  edge 
) const
inline

Returns the vertices of an 'edge' at 'level' (2 of them)

Definition at line 259 of file topologyRefiner.h.

IndexArray const GetFaceChildEdges ( int  level,
Index  f 
) const
inline

Returns the child edges of face 'f' at 'level'.

Definition at line 331 of file topologyRefiner.h.

IndexArray const GetFaceChildFaces ( int  level,
Index  f 
) const
inline

Returns the child faces of face 'f' at 'level'.

Definition at line 326 of file topologyRefiner.h.

Index GetFaceChildVertex ( int  level,
Index  f 
) const
inline

Returns the child vertex of face 'f' at 'level'.

Definition at line 341 of file topologyRefiner.h.

IndexArray const GetFaceEdges ( int  level,
Index  face 
) const
inline

Returns the edges of a 'face' at 'level'.

Definition at line 254 of file topologyRefiner.h.

IndexArray const GetFaceVertices ( int  level,
Index  face 
) const
inline

Returns the vertices of a 'face' at 'level'.

Definition at line 249 of file topologyRefiner.h.

IndexArray const GetFVarFaceValues ( int  level,
Index  face,
int  channel = 0 
) const
inline

Returns the face-varying values of a 'face' at 'level'.

Definition at line 314 of file topologyRefiner.h.

Vtr::Level& getLevel ( int  l)
inlineprotected

Definition at line 395 of file topologyRefiner.h.

Vtr::Level const& getLevel ( int  l) const
inlineprotected

Definition at line 396 of file topologyRefiner.h.

int GetMaxLevel ( ) const
inline

Returns the highest level of refinement.

Definition at line 75 of file topologyRefiner.h.

int getNumBaseEdges ( ) const
inlineprotected

Definition at line 400 of file topologyRefiner.h.

int getNumBaseFaces ( ) const
inlineprotected

Definition at line 399 of file topologyRefiner.h.

int getNumBaseVertices ( ) const
inlineprotected

Definition at line 401 of file topologyRefiner.h.

int GetNumEdges ( int  level) const
inline

Returns the number of edges at a given level of refinement.

Definition at line 213 of file topologyRefiner.h.

int GetNumEdgesTotal ( ) const

Returns the total number of edges in all levels.

int GetNumFaces ( int  level) const
inline

Returns the number of face vertex indices at a given level of refinement.

Definition at line 218 of file topologyRefiner.h.

int GetNumFacesTotal ( ) const

Returns the total number of edges in all levels.

int GetNumFaceVertices ( int  level) const
inline

Returns the number of faces at a given level of refinement.

Definition at line 223 of file topologyRefiner.h.

int GetNumFaceVerticesTotal ( ) const

Returns the total number of face vertices in all levels.

int GetNumFVarChannels ( ) const
inline

Returns the number of face-varying channels in the tables.

Definition at line 301 of file topologyRefiner.h.

int GetNumFVarValues ( int  level,
int  channel = 0 
) const
inline

Returns the number of face-varying values at a given level of refinement.

Definition at line 309 of file topologyRefiner.h.

int GetNumFVarValuesTotal ( int  channel = 0) const

Returns the total number of face-varying values in all levels.

int getNumLevels ( ) const
inlineprotected

Definition at line 393 of file topologyRefiner.h.

int GetNumPtexFaces ( ) const

Returns the number of ptex faces in the mesh.

int GetNumVertices ( int  level) const
inline

Returns the number of vertices at a given level of refinement.

Definition at line 208 of file topologyRefiner.h.

int GetNumVerticesTotal ( ) const

Returns the total number of vertices in all levels.

int GetPtexIndex ( Index  f) const

Returns the ptex face index given a coarse face 'f' or -1.

Vtr::Refinement const& getRefinement ( int  l) const
inlineprotected

Definition at line 397 of file topologyRefiner.h.

Sdc::Options GetSchemeOptions ( ) const
inline

Returns the subdivision options.

Definition at line 69 of file topologyRefiner.h.

Sdc::Type GetSchemeType ( ) const
inline

Returns the subdivision scheme.

Definition at line 66 of file topologyRefiner.h.

Index GetVertexChildVertex ( int  level,
Index  v 
) const
inline

Returns the child vertex of vertex 'v' at 'level'.

Definition at line 351 of file topologyRefiner.h.

IndexArray const GetVertexEdges ( int  level,
Index  vert 
) const
inline

Returns the edges incident to 'vertex' at 'level'.

Definition at line 274 of file topologyRefiner.h.

IndexArray const GetVertexFaces ( int  level,
Index  vert 
) const
inline

Returns the faces incident to 'vertex' at 'level'.

Definition at line 269 of file topologyRefiner.h.

Sdc::Crease::Rule GetVertexRule ( int  level,
Index  vert 
) const
inline

Returns the subdivision rule of a given vertex (at 'level' of refinement)

Definition at line 238 of file topologyRefiner.h.

float GetVertexSharpness ( int  level,
Index  vert 
) const
inline

Returns the sharpness of a given vertex (at 'level' of refinement)

Definition at line 233 of file topologyRefiner.h.

void Interpolate ( T const *  src,
U *  dst 
) const
inline

Apply vertex and varying interpolation weights to a primvar buffer.

The destination buffer must allocate an array of data for all the refined vertices (at least GetNumVerticesTotal()-GetNumVertices(0))

Parameters
srcSource primvar buffer (control vertex data)
dstDestination primvar buffer (refined vertex data)

Definition at line 480 of file topologyRefiner.h.

void Interpolate ( int  level,
T const *  src,
U *  dst 
) const
inline

Apply vertex and varying interpolation weights to a primvar buffer for a single level level of refinement.

The destination buffer must allocate an array of data for all the refined vertices (at least GetNumVertices(level))

Parameters
levelThe refinement level
srcSource primvar buffer (control vertex data)
dstDestination primvar buffer (refined vertex data)

Definition at line 495 of file topologyRefiner.h.

void InterpolateFaceVarying ( T const *  src,
U *  dst,
int  channel = 0 
) const
inline

Apply face-varying interpolation weights to a primvar buffer.

Definition at line 791 of file topologyRefiner.h.

void InterpolateFaceVarying ( int  level,
T const *  src,
U *  dst,
int  channel = 0 
) const
inline

Definition at line 806 of file topologyRefiner.h.

void InterpolateVarying ( T const *  src,
U *  dst 
) const
inline

Apply only varying interpolation weights to a primvar buffer.

This method can be a useful alternative if the varying primvar data does not need to be re-computed over time.

The destination buffer must allocate an array of data for all the refined vertices (at least GetNumVerticesTotal()-GetNumVertices(0))

Parameters
srcSource primvar buffer (control vertex data)
dstDestination primvar buffer (refined vertex data)

Definition at line 679 of file topologyRefiner.h.

void InterpolateVarying ( int  level,
T const *  src,
U *  dst 
) const
inline

Apply only varying interpolation weights to a primvar buffer for a single level level of refinement.

This method can be a useful alternative if the varying primvar data does not need to be re-computed over time.

The destination buffer must allocate an array of data for all the refined vertices (at least GetNumVertices(level))

Parameters
levelThe refinement level
srcSource primvar buffer (control vertex data)
dstDestination primvar buffer (refined vertex data)

Definition at line 694 of file topologyRefiner.h.

bool IsUniform ( ) const
inline

Returns true if uniform subdivision has been applied.

Definition at line 72 of file topologyRefiner.h.

void populateLocalIndices ( )
inlineprotected

Definition at line 440 of file topologyRefiner.h.

void PrintTopology ( int  level,
bool  children = true 
) const
inline

Prints topology information to console.

Definition at line 378 of file topologyRefiner.h.

void RefineAdaptive ( int  maxLevel,
bool  fullTopologyInLastLevel = false 
)

Feature Adaptive topology refinement.

Parameters
maxLevelHighest level of subdivision refinement
fullTopologyInLastLevelSkip secondary topological relationships at the highest level of refinement.
void RefineUniform ( int  maxLevel,
bool  fullTopologyInLastLevel = false 
)

Refine the topology uniformly.

Parameters
maxLevelHighest level of subdivision refinement
fullTopologyInLastLevelSkip secondary topological relationships at the highest level of refinement.
IndexArray setBaseEdgeFaces ( Index  e)
inlineprotected

Definition at line 417 of file topologyRefiner.h.

IndexArray setBaseEdgeVertices ( Index  e)
inlineprotected

Definition at line 416 of file topologyRefiner.h.

IndexArray setBaseFaceEdges ( Index  f)
inlineprotected

Definition at line 415 of file topologyRefiner.h.

IndexArray setBaseFaceVertices ( Index  f)
inlineprotected

Definition at line 414 of file topologyRefiner.h.

LocalIndexArray setBaseVertexEdgeLocalIndices ( Index  v)
inlineprotected

Definition at line 423 of file topologyRefiner.h.

IndexArray setBaseVertexEdges ( Index  v)
inlineprotected

Definition at line 419 of file topologyRefiner.h.

LocalIndexArray setBaseVertexFaceLocalIndices ( Index  v)
inlineprotected

Definition at line 422 of file topologyRefiner.h.

IndexArray setBaseVertexFaces ( Index  v)
inlineprotected

Definition at line 418 of file topologyRefiner.h.

void setNumBaseEdgeFaces ( Index  e,
int  count 
)
inlineprotected

Definition at line 409 of file topologyRefiner.h.

void setNumBaseEdges ( int  count)
inlineprotected

Definition at line 405 of file topologyRefiner.h.

void setNumBaseFaces ( int  count)
inlineprotected

Definition at line 404 of file topologyRefiner.h.

void setNumBaseFaceVertices ( Index  f,
int  count 
)
inlineprotected

Definition at line 408 of file topologyRefiner.h.

void setNumBaseVertexEdges ( Index  v,
int  count 
)
inlineprotected

Definition at line 411 of file topologyRefiner.h.

void setNumBaseVertexFaces ( Index  v,
int  count 
)
inlineprotected

Definition at line 410 of file topologyRefiner.h.

void setNumBaseVertices ( int  count)
inlineprotected

Definition at line 406 of file topologyRefiner.h.

void Unrefine ( )

Unrefine the topology (keep control cage)

bool ValidateTopology ( int  level) const
inline

Returns true if the topology of 'level' is valid.

Definition at line 373 of file topologyRefiner.h.

LocalIndexArray const VertexEdgeLocalIndices ( int  level,
Index  vert 
) const
inline

Returns the local edge indices of vertex 'vert' at 'level'.

Definition at line 284 of file topologyRefiner.h.

LocalIndexArray const VertexFaceLocalIndices ( int  level,
Index  vert 
) const
inline

Returns the local face indices of vertex 'vert' at 'level'.

Definition at line 279 of file topologyRefiner.h.

Friends And Related Function Documentation

friend class PatchTablesFactory
friend

Definition at line 391 of file topologyRefiner.h.

friend class TopologyRefinerFactory
friend

Definition at line 389 of file topologyRefiner.h.

friend class TopologyRefinerFactoryBase
friend

Definition at line 390 of file topologyRefiner.h.


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