25 #ifndef OPENSUBDIV3_BFR_TESSELLATION_H 26 #define OPENSUBDIV3_BFR_TESSELLATION_H 28 #include "../version.h" 30 #include "../bfr/parameterization.h" 33 namespace OPENSUBDIV_VERSION {
67 Options() : _preserveQuads(false), _facetSize4(false),
68 _coordStride(0), _facetStride(0) { }
93 unsigned int _preserveQuads : 1;
94 unsigned int _facetSize4 : 1;
119 Options
const & options = Options());
159 Options
const & options = Options());
205 int GetNumCoords()
const {
return _numInteriorPoints + _numBoundaryPoints; }
221 template <
typename REAL>
225 template <
typename REAL>
229 template <
typename REAL>
233 template <
typename REAL>
238 template <
typename REAL>
290 int const boundaryIndices[],
295 int const boundaryIndices[],
296 int const interiorIndices[]);
302 int nRates,
int const rates[], Options
const & options);
305 int nRates,
int const rates[], Options
const & options);
307 void initializeDefaults();
308 int initializeRates(
int nRates,
int const rates[]);
309 void initializeInventoryForParamTri(
int sumOfOuterRates);
310 void initializeInventoryForParamQuad(
int sumOfOuterRates);
311 void initializeInventoryForParamQPoly(
int sumOfOuterRates);
317 unsigned short _isValid : 1;
318 unsigned short _isUniform : 1;
319 unsigned short _triangulate : 1;
320 unsigned short _singleFace : 1;
321 unsigned short _segmentedFace : 1;
322 unsigned short _triangleFan : 1;
323 unsigned short _splitQuad : 1;
330 int _numBoundaryPoints;
331 int _numInteriorPoints;
336 int _outerRatesLocal[4];
342 inline Tessellation::Options &
349 _facetSize4 = (numIndices == 4);
354 _facetStride = (short) stride;
359 _coordStride = (short) stride;
363 template <
typename REAL>
370 template <
typename REAL>
381 using namespace OPENSUBDIV_VERSION;
Tessellation()=delete
Default construction is unavailable.
bool IsUniform() const
Return if the pattern is uniform.
int GetFacetStride() const
Return the stride between facets.
Tessellation & operator=(Tessellation const &)=delete
bool IsValid() const
Return true if correctly initialized.
int GetNumCoords() const
Return the number of coordinates in the entire pattern.
bool PreserveQuads() const
Return if preservation of quads is set.
int GetCoords(REAL coordTuples[]) const
Retrieve the coordinates for the entire pattern.
int GetNumEdgeCoords(int edge) const
Return the number of coordinates within a given edge (excluding those at its end vertices)
Simple class defining the 2D parameterization of a face.
Options & SetCoordStride(int stride)
Assign the stride between (u,v) pairs (default is 2)
int GetNumInteriorCoords() const
Return the number of interior coordinates.
int GetFaceSize() const
Returns the size (number of vertices) of the corresponding face.
int GetInteriorCoords(REAL coordTuples[]) const
Retrieve the coordinates for the boundary.
int GetRates(int rates[]) const
Retrieve the rates assigned.
int GetFacetSize() const
Return the number of indices assigned to each facet.
Encapsulates a specific tessellation pattern of a Parameterization.
void TransformFacetCoordIndices(int facetTuples[], int commonOffset)
Apply a common offset to all facet coordinate indices.
int GetVertexCoord(int vertex, REAL coordTuples[]) const
Retrieve the coordinate for a given vertex of the face.
void GetVertexCoord(int vertexIndex, REAL uvCoord[2]) const
Returns the (u,v) coordinate of a given vertex.
int GetEdgeCoords(int edge, REAL coordTuples[]) const
Retrieve the coordinates for a given edge of the face (excluding those at its end vertices)
int GetCoordStride() const
Return the number of elements between each coordinate.
int GetNumBoundaryCoords() const
Return the number of boundary coordinates.
int GetBoundaryCoords(REAL coordTuples[]) const
Retrieve the coordinates for the boundary.
Options & SetFacetSize(int numIndices)
Assign the number of indices per facet (must be 3 or 4, default is 3)
int GetFacetStride() const
Return the number of elements between each facet.
int GetFacets(int facetTuples[]) const
Retrieve the facet indices for the entire pattern.
int GetCoordStride() const
Return the stride between (u,v) pairs.
int GetNumFacets() const
Return the number of facets in the entire pattern.
int GetFaceSize() const
Return the size of the face.
Options configure a Tessellation to specify the nature of both its results and the structure of the c...
Parameterization GetParameterization() const
Return the Parameterization.
Options & SetFacetStride(int stride)
Assign the stride between facets (default is facet size)