HDK
|
Class to perform subdivision refinement using OpenSubdivision. More...
#include <GT_UtilOpenSubdiv.h>
Public Types | |
using | SdcOptions = GT_OSDOptions::SdcOptions |
using | VtxBoundaryInterpolation = SdcOptions::VtxBoundaryInterpolation |
using | FVarLinearInterpolation = SdcOptions::FVarLinearInterpolation |
using | AttribId = GT_OSDAttributes::AttribId |
Class to perform subdivision refinement using OpenSubdivision.
Definition at line 102 of file GT_UtilOpenSubdiv.h.
Definition at line 111 of file GT_UtilOpenSubdiv.h.
using GT_UtilOpenSubdiv::FVarLinearInterpolation = SdcOptions::FVarLinearInterpolation |
Definition at line 110 of file GT_UtilOpenSubdiv.h.
Definition at line 108 of file GT_UtilOpenSubdiv.h.
using GT_UtilOpenSubdiv::VtxBoundaryInterpolation = SdcOptions::VtxBoundaryInterpolation |
Definition at line 109 of file GT_UtilOpenSubdiv.h.
GT_UtilOpenSubdiv::GT_UtilOpenSubdiv | ( | ) |
GT_UtilOpenSubdiv::~GT_UtilOpenSubdiv | ( | ) |
|
inline |
Option accessors
Definition at line 138 of file GT_UtilOpenSubdiv.h.
|
inline |
Error handling (used internally)
Definition at line 369 of file GT_UtilOpenSubdiv.h.
void GT_UtilOpenSubdiv::clear | ( | ) |
Clear any topology, attributes or limit surface info.
|
inline |
Error handling (used internally)
Definition at line 370 of file GT_UtilOpenSubdiv.h.
|
inline |
Option accessors
Definition at line 153 of file GT_UtilOpenSubdiv.h.
bool GT_UtilOpenSubdiv::createTopology | ( | const GT_PrimitiveHandle & | mesh | ) |
Create the OSD data structures to represent a particular subdivision mesh. The suppolied handle must refer to a GT_PrimSubdivisionMesh or the functions will fail. This function can be called once followed by ay number of calls to refine and/or extractSubdivisionMesh.
|
inline |
Option accessors
Definition at line 151 of file GT_UtilOpenSubdiv.h.
void GT_UtilOpenSubdiv::dump | ( | ) | const |
void GT_UtilOpenSubdiv::dump | ( | UT_JSONWriter & | w | ) | const |
|
inline |
Definition at line 203 of file GT_UtilOpenSubdiv.h.
GT_PrimitiveHandle GT_UtilOpenSubdiv::extractSubdividedMesh | ( | int | level = -1 | ) |
Returns a GT_PrimPolygonMesh that is the result of subdividing the mesh passed to the refine function above.
|
inline |
Option accessors
Definition at line 168 of file GT_UtilOpenSubdiv.h.
|
inline |
Option accessors
Definition at line 132 of file GT_UtilOpenSubdiv.h.
GT_Size GT_UtilOpenSubdiv::limitCoarseFaceCount | ( | ) | const |
Return the number of input faces. A cube would have 6 faces, a tetrahedron would have 4 faces.
AttribId GT_UtilOpenSubdiv::limitFindAttribute | ( | const char * | name | ) | const |
Definition of an attribute id on the topolgy.
Return the ptexture id for a given input face. For example, if the input mesh is a tetrahedron, limitFirstPatch(2)
would return 6. This is also equivalent to the ptexture index of the first patch for a given face.
bool GT_UtilOpenSubdiv::limitLookupFace | ( | GT_Size | osd_face, |
fpreal | osd_u, | ||
fpreal | osd_v, | ||
GT_Size & | hou_prim, | ||
fpreal & | hou_u, | ||
fpreal & | hou_v, | ||
const AttribId & | attrib, | ||
int | seg = 0 |
||
) | const |
Given a patch on the subdivision mesh and a uv interpolant on the patch, return the face on the coarse mesh and possibly the uv attributes. If the topology attribute id is invalid, then the u/v returned will be the uv interpolants on the patch, with the patch offset added to the uv.
bool GT_UtilOpenSubdiv::limitLookupPatch | ( | GT_Size | hou_face, |
fpreal | hou_u, | ||
fpreal | hou_v, | ||
GT_Size & | osd_face, | ||
fpreal & | osd_u, | ||
fpreal & | osd_v, | ||
const AttribId & | attrib, | ||
int | seg = 0 |
||
) | const |
Given a face on the coarse mesh and a u,v coordinate from an attribute, look up the corresponding patch and interpolant. If the attribute is invalid, then the uv's will be assumed to be the patch interpolants, with the patch offset added to the u coordinate.
|
inline |
Accessors for the limit surface evaluation options
Definition at line 194 of file GT_UtilOpenSubdiv.h.
|
inline |
Accessors for the limit surface evaluation options
Definition at line 196 of file GT_UtilOpenSubdiv.h.
GT_Size GT_UtilOpenSubdiv::limitPatchCount | ( | ) | const |
Return the number of individual patches (ptex face ids). So, a cube would have 6 patches, while a tetrahedron would have 12 patches (each triangle generates 3 patches).
Return the number of subdivision patches for a given input face. For example, if the input mesh is a tetrahedron, limitPTextureId(2)
would return 3.
GT_DataArrayHandle GT_UtilOpenSubdiv::limitSurface | ( | const char * | attrib, |
bool | vertex_attrib, | ||
const GT_DataArrayHandle & | faces, | ||
const GT_DataArrayHandle & | uvs | ||
) | const |
Evaluate the limit surface for a given point/vertex attribute at the coordinates specified.
GT_DataArrayHandle GT_UtilOpenSubdiv::limitSurface | ( | const char * | attrib, |
bool | vertex_attrib, | ||
const GT_DataArrayHandle & | faces, | ||
const GT_DataArrayHandle & | u, | ||
const GT_DataArrayHandle & | v | ||
) | const |
GT_DataArrayHandle GT_UtilOpenSubdiv::limitSurface | ( | const char * | attrib, |
bool | vertex_attrib, | ||
exint | npts, | ||
const int32 * | face_indices, | ||
const fpreal32 * | u, | ||
const fpreal32 * | v, | ||
int | uv_stride = 1 |
||
) | const |
Evaluate the limit surface for a given point/vertex attribute at the coordinates specified. The face_indices
array should have npts
entries. The uvs
array should have uv_stride*npts
entries. Only the first 2 coordinates will be used (and represent the s/t coordinates of the face).
int GT_UtilOpenSubdiv::limitSurface | ( | GT_DataArrayHandle * | result, |
GT_DataArrayHandle * | result_du, | ||
GT_DataArrayHandle * | result_dv, | ||
const AttribId & | attrib, | ||
exint | npts, | ||
const int32 * | face_indices, | ||
const fpreal32 * | u, | ||
const fpreal32 * | v, | ||
int | uv_stride = 1 |
||
) | const |
Evaluate the limit surface for a given point/vertex attribute at the coordinates specified. The face_indices
array should have npts
entries. The uvs
array should have uv_stride*npts
entries. Only the first 2 coordinates will be used (and represent the s/t coordinates of the face). The data handles determine which properties are returned: result
- Attribute result_du
- Derivative of attribute in 'u' result_dv
- Derivative of attribute in 'v' Passing 'NULL' for a handle disables evaluation of that property. The size of the evaluated attribute is returned.
int GT_UtilOpenSubdiv::limitSurface | ( | GT_DataArrayHandle * | result, |
GT_DataArrayHandle * | result_du, | ||
GT_DataArrayHandle * | result_dv, | ||
const char * | attrib, | ||
bool | vertex_attrib, | ||
exint | npts, | ||
const int32 * | face_indices, | ||
const fpreal32 * | u, | ||
const fpreal32 * | v, | ||
int | uv_stride = 1 |
||
) | const |
Evaluate the limit surface for a given point/vertex attribute at the coordinates specified. The face_indices
array should have npts
entries. The uvs
array should have uv_stride*npts
entries. Only the first 2 coordinates will be used (and represent the s/t coordinates of the face). The data handles determine which properties are returned: result
- Attribute result_du
- Derivative of attribute in 'u' result_dv
- Derivative of attribute in 'v' Passing 'NULL' for a handle disables evaluation of that property. The size of the evaluated attribute is returned.
|
inline |
Option accessors
Definition at line 118 of file GT_UtilOpenSubdiv.h.
|
inline |
Option accessors
Definition at line 163 of file GT_UtilOpenSubdiv.h.
bool GT_UtilOpenSubdiv::refine | ( | const GT_PrimitiveHandle & | mesh, |
bool | force_update = false |
||
) |
Copies attribute data from the supplied mesh into the OSD data structure, and performs the refinement. The topology of the supplied mesh must match that of the mesh passed to the createTopology function, which must be called before this one.
|
inline |
Option accessors
Definition at line 144 of file GT_UtilOpenSubdiv.h.
|
inline |
Option accessors
Definition at line 125 of file GT_UtilOpenSubdiv.h.
|
inline |
Option accessors
Definition at line 139 of file GT_UtilOpenSubdiv.h.
Option accessors
Definition at line 155 of file GT_UtilOpenSubdiv.h.
Option accessors
Definition at line 157 of file GT_UtilOpenSubdiv.h.
|
inline |
Option accessors
Definition at line 180 of file GT_UtilOpenSubdiv.h.
|
inline |
Option accessors
Definition at line 175 of file GT_UtilOpenSubdiv.h.
Option accessors
Definition at line 133 of file GT_UtilOpenSubdiv.h.
|
inline |
Option accessors
Definition at line 119 of file GT_UtilOpenSubdiv.h.
|
inline |
Option accessors
Definition at line 164 of file GT_UtilOpenSubdiv.h.
|
inline |
Option accessors
Definition at line 145 of file GT_UtilOpenSubdiv.h.
Option accessors
Definition at line 126 of file GT_UtilOpenSubdiv.h.
|
inline |
Option accessors
Definition at line 185 of file GT_UtilOpenSubdiv.h.
bool GT_UtilOpenSubdiv::setupLimitEval | ( | const GT_PrimitiveHandle & | mesh | ) |
Set up mesh for limit surface evaluation. If successful, a subdivision surface will be set up for evaluation. You can then do something like
|
inline |
Option accessors
Definition at line 170 of file GT_UtilOpenSubdiv.h.
GT_PrimitiveHandle GT_UtilOpenSubdiv::subdivide | ( | const GT_PrimitiveHandle & | mesh | ) |
Refine the mesh to the given number of levels using a given subdivision scheme. If the primitive is a subdivision mesh, the crease tags will be used in refinement. If the supplied prim is not a subdivision mesh, any required refinements will be performed automatically.
If the method fails, a null pointer will be returned.
Refine Houdini geometry.
|
inline |
Option accessors
Definition at line 166 of file GT_UtilOpenSubdiv.h.