25#ifndef OPENSUBDIV3_BFR_TESSELLATION_H
26#define OPENSUBDIV3_BFR_TESSELLATION_H
28#include "../version.h"
33namespace OPENSUBDIV_VERSION {
74 Options() : _preserveQuads(false), _facetSize4(false),
75 _coordStride(0), _facetStride(0) { }
100 unsigned int _preserveQuads : 1;
101 unsigned int _facetSize4 : 1;
212 int GetNumCoords()
const {
return _numInteriorPoints + _numBoundaryPoints; }
228 template <
typename REAL>
232 template <
typename REAL>
236 template <
typename REAL>
240 template <
typename REAL>
245 template <
typename REAL>
301 int const boundaryIndices[],
306 int const boundaryIndices[],
307 int const interiorIndices[]);
313 int nRates,
int const rates[],
Options const & options);
316 int nRates,
int const rates[],
Options const & options);
318 void initializeDefaults();
319 int initializeRates(
int nRates,
int const rates[]);
320 void initializeInventoryForParamTri(
int sumOfOuterRates);
321 void initializeInventoryForParamQuad(
int sumOfOuterRates);
322 void initializeInventoryForParamQPoly(
int sumOfOuterRates);
328 unsigned short _isValid : 1;
329 unsigned short _isUniform : 1;
330 unsigned short _triangulate : 1;
331 unsigned short _singleFace : 1;
332 unsigned short _segmentedFace : 1;
333 unsigned short _triangleFan : 1;
334 unsigned short _splitQuad : 1;
341 int _numBoundaryPoints;
342 int _numInteriorPoints;
347 int _outerRatesLocal[4];
360 _facetSize4 = (numIndices == 4);
365 _facetStride = (short) stride;
370 _coordStride = (short) stride;
374template <
typename REAL>
381template <
typename REAL>
392using 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.