OpenSubdiv
Loading...
Searching...
No Matches
Tessellation Class Reference

Encapsulates a specific tessellation pattern of a Parameterization. More...

#include <tessellation.h>

Classes

class  Options
 Options configure a Tessellation to specify the nature of both its results and the structure of the coordinate and facet index arrays that its methods will populate. More...
 

Public Member Functions

Construction and initialization

Constructors require a Parameterization of a face, a set of one or more tessellation rates, and a standard set of options.

As with other classes, constructors can produce invalid instances if given obviously invalid arguments, e.g. an invalid Parameterization, non-positive tessellation rate, etc.

 Tessellation (Parameterization const &p, int uniformRate, Options const &options=Options())
 Simple constructor providing a single uniform tessellation rate.
 
 Tessellation (Parameterization const &p, int numRates, int const rates[], Options const &options=Options())
 General constructor providing multiple tessellation rates for a non-uniform tessellation.
 
bool IsValid () const
 Return true if correctly initialized.
 
 Tessellation ()=delete
 Default construction is unavailable.
 
 Tessellation (Tessellation const &)=delete
 
Tessellationoperator= (Tessellation const &)=delete
 
 ~Tessellation ()
 
Simple queries

Simple queries of a valid Tessellation.

Parameterization GetParameterization () const
 Return the Parameterization.
 
int GetFaceSize () const
 Return the size of the face.
 
int GetRates (int rates[]) const
 Retrieve the rates assigned.
 
bool IsUniform () const
 Return if the pattern is uniform.
 
Methods to inspect and gather coordinates

Methods to determine the number of sample points involved in the tessellation pattern and their content are available for the entire pattern, or for parts of the boundary or interior of the pattern.

The methods that assign the coordinate arrays also return the number of coordinates assigned, so the methods that just return those sizes are not necessary if arrays for the resulting coords have already been sufficiently allocated.

int GetNumCoords () const
 Return the number of coordinates in the entire pattern.
 
int GetCoordStride () const
 Return the number of elements between each coordinate.
 
int GetNumBoundaryCoords () const
 Return the number of boundary coordinates.
 
int GetNumInteriorCoords () const
 Return the number of interior coordinates.
 
int GetNumEdgeCoords (int edge) const
 Return the number of coordinates within a given edge (excluding those at its end vertices)
 
template<typename REAL >
int GetCoords (REAL coordTuples[]) const
 Retrieve the coordinates for the entire pattern.
 
template<typename REAL >
int GetBoundaryCoords (REAL coordTuples[]) const
 Retrieve the coordinates for the boundary.
 
template<typename REAL >
int GetInteriorCoords (REAL coordTuples[]) const
 Retrieve the coordinates for the boundary.
 
template<typename REAL >
int GetVertexCoord (int vertex, REAL coordTuples[]) const
 Retrieve the coordinate for a given vertex of the face.
 
template<typename REAL >
int GetEdgeCoords (int edge, REAL coordTuples[]) const
 Retrieve the coordinates for a given edge of the face (excluding those at its end vertices)
 
Methods to inspect and gather facets

Methods to inspect the number and values of facets. Facets are simply integer tuples of size 3 or 4 which contain the indices of the coordinates generated by the Tessellation.

Unlike the coordinates – which can be separated into those on the boundary or interior of the pattern – the facets are not distinguished in any way.

int GetNumFacets () const
 Return the number of facets in the entire pattern.
 
int GetFacetSize () const
 Return the number of indices assigned to each facet.
 
int GetFacetStride () const
 Return the number of elements between each facet.
 
int GetFacets (int facetTuples[]) const
 Retrieve the facet indices for the entire pattern.
 

Methods to modify the coordinate indices of facets

Methods to modify the coordinate indices of facets rely on the coordinate indices being identifiable as those of boundary or interior coordinates. The first N coordinates generated by Tessellation will be on the boundary, while the remaining M will be for the interior.

The boundary and interior coordinate indices can be transformed collectively or separately by offsets or by explicit reassignment. Both the boundary and interior indices must be modified at the same time while the Tessellation can distinguish them, i.e. a boundary coord is identified by index < N and an interior coord by index >= N.

void TransformFacetCoordIndices (int facetTuples[], int commonOffset)
 Apply a common offset to all facet coordinate indices.
 
void TransformFacetCoordIndices (int facetTuples[], int const boundaryIndices[], int interiorOffset)
 Reassign indices of boundary coordinates while offseting those of interior coordinates.
 
void TransformFacetCoordIndices (int facetTuples[], int const boundaryIndices[], int const interiorIndices[])
 Reassign all facet coordinate indices.
 

Detailed Description

Encapsulates a specific tessellation pattern of a Parameterization.

Tessellation is a simple class that encapsulates a specified tessellation pattern for a given Parameterization. Tessellation parameters are given on construction and are fixed for its lifetime.

Methods allow inspection of the pattern in terms of the 2D coordinates of the points comprising the pattern and the faces that connect them. The 2D coordinates are referred to both in the documentation and the interface as "coords" while the faces connecting them are referred to as "facets" (to distinguish from the faces of the mesh, to which a Tessellation is applied).

Definition at line 51 of file tessellation.h.

Constructor & Destructor Documentation

◆ Tessellation() [1/4]

Tessellation ( Parameterization const &  p,
int  uniformRate,
Options const &  options = Options() 
)

Simple constructor providing a single uniform tessellation rate.

Parameters
pParameterization of a face to be tessellated
uniformRateInteger tessellation rate (non-zero)
optionsOptions describing tessellation results

◆ Tessellation() [2/4]

Tessellation ( Parameterization const &  p,
int  numRates,
int const  rates[],
Options const &  options = Options() 
)

General constructor providing multiple tessellation rates for a non-uniform tessellation.

Parameters
pParameterization of a face to be tessellated
numRatesThe number of tessellation rates provided, which usually includes one per edge of the face (more details below)
ratesThe array of non-zero integer tessellation rates
optionsOptions describing tessellation results

For a Parameterization of a face with N edges, the acceptable number of tessellation rates can vary. Aside from N "outer" tessellation rates (one for each edge), all faces can have at least one "inner" rate additionally specified while quads can have two inner rates.

If inner rates are not specified in addition to the N outer rates, they will be inferred (so it is not necessary to initialize quads distinctly from other faces). Similarly – though less useful – the smaller set of inner rates can be specified, leaving all outer rates to be inferred.

For a face with N edges, the full set of acceptable rates and their interpretations is as follows:

 1  - single explicit inner rate (uniform)
 2  - (quads only) two explicit inner rates, outer rates inferred
 N  - explicit edge rates, inner rates inferred
N+1 - explicit edge rates, explicit inner rate
N+2 - (quads only) explicit edge rates, two explicit inner rates

When associating rates with edges, note that rates[0] corresponds to the edge between vertices 0 and 1. This is consistent with use elsewhere in OpenSubdiv – where edge i lies between vertices i and i+1 – but differs from the conventions used with many hardware tessellation interfaces.

◆ Tessellation() [3/4]

Tessellation ( )
delete

Default construction is unavailable.

◆ Tessellation() [4/4]

Tessellation ( Tessellation const &  )
delete

◆ ~Tessellation()

Member Function Documentation

◆ GetBoundaryCoords()

int GetBoundaryCoords ( REAL  coordTuples[]) const

Retrieve the coordinates for the boundary.

◆ GetCoords()

int GetCoords ( REAL  coordTuples[]) const
inline

Retrieve the coordinates for the entire pattern.

Definition at line 372 of file tessellation.h.

◆ GetCoordStride()

int GetCoordStride ( ) const
inline

Return the number of elements between each coordinate.

Definition at line 208 of file tessellation.h.

◆ GetEdgeCoords()

int GetEdgeCoords ( int  edge,
REAL  coordTuples[] 
) const

Retrieve the coordinates for a given edge of the face (excluding those at its end vertices)

◆ GetFaceSize()

int GetFaceSize ( ) const
inline

Return the size of the face.

Definition at line 182 of file tessellation.h.

◆ GetFacets()

int GetFacets ( int  facetTuples[]) const

Retrieve the facet indices for the entire pattern.

◆ GetFacetSize()

int GetFacetSize ( ) const
inline

Return the number of indices assigned to each facet.

Definition at line 258 of file tessellation.h.

◆ GetFacetStride()

int GetFacetStride ( ) const
inline

Return the number of elements between each facet.

Definition at line 261 of file tessellation.h.

◆ GetInteriorCoords()

int GetInteriorCoords ( REAL  coordTuples[]) const

Retrieve the coordinates for the boundary.

◆ GetNumBoundaryCoords()

int GetNumBoundaryCoords ( ) const
inline

Return the number of boundary coordinates.

Definition at line 211 of file tessellation.h.

◆ GetNumCoords()

int GetNumCoords ( ) const
inline

Return the number of coordinates in the entire pattern.

Definition at line 205 of file tessellation.h.

◆ GetNumEdgeCoords()

int GetNumEdgeCoords ( int  edge) const
inline

Return the number of coordinates within a given edge (excluding those at its end vertices)

Definition at line 218 of file tessellation.h.

◆ GetNumFacets()

int GetNumFacets ( ) const
inline

Return the number of facets in the entire pattern.

Definition at line 255 of file tessellation.h.

◆ GetNumInteriorCoords()

int GetNumInteriorCoords ( ) const
inline

Return the number of interior coordinates.

Definition at line 214 of file tessellation.h.

◆ GetParameterization()

Parameterization GetParameterization ( ) const
inline

Return the Parameterization.

Definition at line 179 of file tessellation.h.

◆ GetRates()

int GetRates ( int  rates[]) const

Retrieve the rates assigned.

◆ GetVertexCoord()

int GetVertexCoord ( int  vertex,
REAL  coordTuples[] 
) const
inline

Retrieve the coordinate for a given vertex of the face.

Definition at line 365 of file tessellation.h.

◆ IsUniform()

bool IsUniform ( ) const
inline

Return if the pattern is uniform.

Definition at line 188 of file tessellation.h.

◆ IsValid()

bool IsValid ( ) const
inline

Return true if correctly initialized.

Definition at line 162 of file tessellation.h.

◆ operator=()

Tessellation & operator= ( Tessellation const &  )
delete

◆ TransformFacetCoordIndices() [1/3]

void TransformFacetCoordIndices ( int  facetTuples[],
int  commonOffset 
)

Apply a common offset to all facet coordinate indices.

◆ TransformFacetCoordIndices() [2/3]

void TransformFacetCoordIndices ( int  facetTuples[],
int const  boundaryIndices[],
int const  interiorIndices[] 
)

Reassign all facet coordinate indices.

◆ TransformFacetCoordIndices() [3/3]

void TransformFacetCoordIndices ( int  facetTuples[],
int const  boundaryIndices[],
int  interiorOffset 
)

Reassign indices of boundary coordinates while offseting those of interior coordinates.


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