8#ifndef OPENSUBDIV3_BFR_TESSELLATION_H
9#define OPENSUBDIV3_BFR_TESSELLATION_H
11#include "../version.h"
16namespace OPENSUBDIV_VERSION {
57 Options() : _preserveQuads(false), _facetSize4(false),
58 _coordStride(0), _facetStride(0) { }
83 unsigned int _preserveQuads : 1;
84 unsigned int _facetSize4 : 1;
195 int GetNumCoords()
const {
return _numInteriorPoints + _numBoundaryPoints; }
211 template <
typename REAL>
215 template <
typename REAL>
219 template <
typename REAL>
223 template <
typename REAL>
228 template <
typename REAL>
284 int const boundaryIndices[],
289 int const boundaryIndices[],
290 int const interiorIndices[]);
296 int nRates,
int const rates[],
Options const & options);
299 int nRates,
int const rates[],
Options const & options);
301 void initializeDefaults();
302 int initializeRates(
int nRates,
int const rates[]);
303 void initializeInventoryForParamTri(
int sumOfOuterRates);
304 void initializeInventoryForParamQuad(
int sumOfOuterRates);
305 void initializeInventoryForParamQPoly(
int sumOfOuterRates);
311 unsigned short _isValid : 1;
312 unsigned short _isUniform : 1;
313 unsigned short _triangulate : 1;
314 unsigned short _singleFace : 1;
315 unsigned short _segmentedFace : 1;
316 unsigned short _triangleFan : 1;
317 unsigned short _splitQuad : 1;
324 int _numBoundaryPoints;
325 int _numInteriorPoints;
330 int _outerRatesLocal[4];
343 _facetSize4 = (numIndices == 4);
348 _facetStride = (short) stride;
353 _coordStride = (short) stride;
357template <
typename REAL>
364template <
typename REAL>
375using namespace OPENSUBDIV_VERSION;
Simple class defining the 2D parameterization of a face.
int GetFaceSize() const
Returns the size (number of vertices) of the corresponding face.
void GetVertexCoord(int vertexIndex, REAL uvCoord[2]) const
Returns the (u,v) coordinate of a given vertex.
Encapsulates a specific tessellation pattern of a Parameterization.
int GetFaceSize() const
Return the size of the face.
int GetNumBoundaryCoords() const
Return the number of boundary coordinates.
void TransformFacetCoordIndices(int facetTuples[], int const boundaryIndices[], int const interiorIndices[])
Reassign all facet coordinate indices.
int GetCoordStride() const
Return the number of elements between each coordinate.
int GetNumEdgeCoords(int edge) const
Return the number of coordinates within a given edge (excluding those at its end vertices)
int GetInteriorCoords(REAL coordTuples[]) const
Retrieve the coordinates for the boundary.
int GetFacetStride() const
Return the number of elements between each facet.
bool IsUniform() const
Return if the pattern is uniform.
int GetNumCoords() const
Return the number of coordinates in the entire pattern.
int GetCoords(REAL coordTuples[]) const
Retrieve the coordinates for the entire pattern.
void TransformFacetCoordIndices(int facetTuples[], int commonOffset)
Apply a common offset to all facet coordinate indices.
Tessellation(Parameterization const &p, int numRates, int const rates[], Options const &options=Options())
General constructor providing multiple tessellation rates for a non-uniform tessellation.
Parameterization GetParameterization() const
Return the Parameterization.
void TransformFacetCoordIndices(int facetTuples[], int const boundaryIndices[], int interiorOffset)
Reassign indices of boundary coordinates while offseting those of interior coordinates.
int GetFacetSize() const
Return the number of indices assigned to each facet.
Tessellation()=delete
Default construction is unavailable.
Tessellation(Parameterization const &p, int uniformRate, Options const &options=Options())
Simple constructor providing a single uniform tessellation rate.
int GetFacets(int facetTuples[]) const
Retrieve the facet indices for the entire pattern.
int GetNumFacets() const
Return the number of facets in the entire pattern.
int GetNumInteriorCoords() const
Return the number of interior coordinates.
int GetVertexCoord(int vertex, REAL coordTuples[]) const
Retrieve the coordinate for a given vertex of the face.
int GetBoundaryCoords(REAL coordTuples[]) const
Retrieve the coordinates for the boundary.
Tessellation(Tessellation const &)=delete
int GetRates(int rates[]) const
Retrieve the rates assigned.
bool IsValid() const
Return true if correctly initialized.
Tessellation & operator=(Tessellation const &)=delete
int GetEdgeCoords(int edge, REAL coordTuples[]) const
Retrieve the coordinates for a given edge of the face (excluding those at its end vertices)
Options configure a Tessellation to specify the nature of both its results and the structure of the c...
int GetCoordStride() const
Return the stride between (u,v) pairs.
Options & SetFacetSize(int numIndices)
Assign the number of indices per facet (must be 3 or 4, default is 3)
int GetFacetStride() const
Return the stride between facets.
int GetFacetSize() const
Return the number of indices per facet.
Options & SetCoordStride(int stride)
Assign the stride between (u,v) pairs (default is 2)
Options & SetFacetStride(int stride)
Assign the stride between facets (default is facet size)
bool PreserveQuads() const
Return if preservation of quads is set.