|
|
Instances of Surface may be explicitly constructed, but are initialized by SurfaceFactory and so only default construction is provided. An instance will be invalid (and so unusable) if default constructed, or if the factory that initialized it determined that the face associated with it has no limit surface.
|
bool | IsValid () const |
| Return true if successfully initialized.
|
|
void | Clear () |
| Clear a previously initialized Surface.
|
|
| Surface () |
| Default construction produces an invalid instance.
|
|
| Surface (Surface const &src)=default |
|
Surface & | operator= (Surface const &src)=default |
|
| ~Surface ()=default |
|
|
Simple queries of valid Surface.
|
Parameterization | GetParameterization () const |
| Return the Parameterization.
|
|
int | GetFaceSize () const |
| Return the size of the face.
|
|
bool | IsRegular () const |
| Return if the Surface is a single regular patch.
|
|
bool | IsLinear () const |
| Return if the Surface is linear.
|
|
|
Control points are the subset of points in the mesh that influence a Surface. They can be identified as part of the mesh data by their indices, or gathered into an array for other purposes.
It is not necessary to deal directly with control points for evaluation, but they are useful with limit stencils and other purposes, e.g. computing a bounding box of the control hull of the Surface.
Note that methods that access control points from the array of mesh data require that the array be contiguous. If a large data set is fragmented into blocks or pages, these methods cannot be used and control points will need to be gathered explicitly.
|
int | GetNumControlPoints () const |
| Return the number of control points affecting the Surface.
|
|
int | GetControlPointIndices (Index meshPointIndices[]) const |
| Identify indices of control points in the mesh.
|
|
template<typename REAL_MESH > |
void | GatherControlPoints (REAL_MESH const meshPoints[], PointDescriptor const &meshPointDesc, REAL controlPoints[], PointDescriptor const &controlPointDesc) const |
| Gather control points in a local array.
|
|
void | BoundControlPoints (REAL const controlPoints[], PointDescriptor const &controlPointDesc, REAL minExtent[], REAL maxExtent[]) const |
| Compute bounds of control points from a local array.
|
|
void | BoundControlPointsFromMesh (REAL const meshPoints[], PointDescriptor const &meshPointDesc, REAL minExtent[], REAL maxExtent[]) const |
| Compute bounds of control points from the mesh data.
|
|
|
Patch points are derived from the control points and are used to evaluate the Surface. The patch points always include the control points as a subset.
|
int | GetNumPatchPoints () const |
| Return the number of patch points representing the Surface.
|
|
void | PreparePatchPoints (REAL const meshPoints[], PointDescriptor const &meshPointDesc, REAL patchPoints[], PointDescriptor const &patchPointDesc) const |
| Prepare patch points in a local array for evaluation.
|
|
void | ComputePatchPoints (REAL patchPoints[], PointDescriptor const &patchPointDesc) const |
| Compute all patch points following the control points.
|
|
|
Evaluation methods use the patch points to compute position, 1st and 2nd derivatives of the Surface at a given (u,v) coordinate within the domain of the Surface's Parameterization. All parameters of the different overloads are required.
|
void | Evaluate (REAL const uv[2], REAL const patchPoints[], PointDescriptor const &pointDesc, REAL P[]) const |
| Evaluation of position.
|
|
void | Evaluate (REAL const uv[2], REAL const patchPoints[], PointDescriptor const &pointDesc, REAL P[], REAL Du[], REAL Dv[]) const |
| Overload of evaluation for 1st derivatives.
|
|
void | Evaluate (REAL const uv[2], REAL const patchPoints[], PointDescriptor const &pointDesc, REAL P[], REAL Du[], REAL Dv[], REAL Duu[], REAL Duv[], REAL Dvv[]) const |
| Overload of evaluation for 2nd derivatives.
|
|
|
Limit stencils are sets of coefficients that express an evaluation as a linear combination of the control points. As with the direct evaluation methods, they are overloaded to optionally provide evaluation for 1st and 2nd derivatives.
In addition to methods to provide limit stencils, methods are also provided to apply them to the control points. Since application of stencils is identical for each (i.e. the same for position and any derivative) no overloads are provided for derivatives.
|
class | SurfaceFactory |
|
int | EvaluateStencil (REAL const uv[2], REAL sP[]) const |
| Evaluation of the limit stencil for position.
|
|
int | EvaluateStencil (REAL const uv[2], REAL sP[], REAL sDu[], REAL sDv[]) const |
| Overload of limit stencil evaluation for 1st derivatives.
|
|
int | EvaluateStencil (REAL const uv[2], REAL sP[], REAL sDu[], REAL sDv[], REAL sDuu[], REAL sDuv[], REAL sDvv[]) const |
| Overload of limit stencil evaluation for 2nd derivatives.
|
|
void | ApplyStencil (REAL const stencil[], REAL const controlPoints[], PointDescriptor const &, REAL result[]) const |
| Apply a single stencil to control points from a local array.
|
|
void | ApplyStencilFromMesh (REAL const stencil[], REAL const meshPoints[], PointDescriptor const &, REAL result[]) const |
| Apply a single stencil to control points from the mesh data.
|
|
template<typename REAL>
class OpenSubdiv::OPENSUBDIV_VERSION::Bfr::Surface< REAL >
Encapsulates the limit surface for a face of a mesh.
The Surface class encapsulates the limit surface for a face of a mesh for any data interpolation type (vertex, varying and face-varying) and provides the public interface for its evaluation. Surface is a class template parameterized to support evaluation in single or double precision.
- Template Parameters
-
REAL | Floating point precision (float or double only) |
Instances of Surface are created or initialized by a subclass of the SurfaceFactory. Since existing instances can be re-initialized, they should be tested for validity after such re-initialization.
All Surfaces are assigned a Parameterization based on the subdivision scheme and the size of the face, which can then be used for evaluation and tessellation of the surface.
Definition at line 59 of file surface.h.
void PreparePatchPoints |
( |
REAL const |
meshPoints[], |
|
|
PointDescriptor const & |
meshPointDesc, |
|
|
REAL |
patchPoints[], |
|
|
PointDescriptor const & |
patchPointDesc |
|
) |
| const |
|
inline |
Prepare patch points in a local array for evaluation.
The patch points consist of the control points plus any additional points derived from them that may be required to represent the limit surface as one or more parametric patches.
- Parameters
-
meshPoints | Input array of mesh point data |
meshPointDesc | The size and stride of mesh point data |
patchPoints | Output array of patch point data |
patchPointDesc | The size and stride of patch point data |
Note that this method requires the mesh data be in a contiguous array. If a large data set is fragmented into blocks or pages, this method cannot be used. The control points will need to be gathered explicitly as the subset of patch points, after which the method to compute the remaining patch points can be used.
Definition at line 345 of file surface.h.