11 #ifndef __GT_UtilOpenSubdiv__
12 #define __GT_UtilOpenSubdiv__
27 class GT_API GT_OSDDrawContext
30 GT_OSDDrawContext(
const Far::PatchTable &patchTables,
32 const GT_OSDSubdivider<OsdVertex> &subdivider);
35 class PatchArrayDescriptor
38 bool operator<(
const PatchArrayDescriptor &other)
const
40 if (myMaxValence == other.myMaxValence)
42 if (myType == other.myType)
44 if (myPattern == other.myPattern)
46 if (myRotation == other.myRotation)
48 if (mySubPatch == other.mySubPatch)
53 return mySubPatch < other.mySubPatch;
56 return myRotation < other.myRotation;
59 return myPattern < other.myPattern;
62 return myType < other.myType;
65 return myMaxValence < other.myMaxValence;
78 PatchArrayDescriptor myDescriptor;
82 exint myQuadOffsetBase;
83 exint myPrimitiveIdBase;
88 const uint32 *myPatchTable;
90 const int32 *myValenceTable;
92 const uint32 *myQuadOffsetTable;
93 exint myQuadOffsetCount;
94 const FarPatchParam *myPatchParamTable;
95 exint myPatchParamCount;
98 int myPrimitiveMultiplier;
130 myOptions.setScheme(s);
133 int levels()
const {
return myOptions.level(); }
137 myOptions.setLevel(l);
139 bool adaptive()
const {
return myOptions.adaptive(); }
143 myOptions.setAdaptive(v);
149 myOptions.setRemoveHoles(v);
153 {
return myOptions.enableCreaseOverride(); }
155 {
return myOptions.creaseOverride(); }
157 { setCreaseOverride(yes ? w : -1); }
161 myOptions.setCreaseOverride(w);
168 {
return myOptions.vtxBoundaryInterpolation(); }
170 {
return myOptions.fvarLinearInterpolation(); }
174 myOptions.setVtxBoundaryInterpolation(v);
179 myOptions.setFVarLinearInterpolation(v);
184 myOptions.setCreasingMethod(v);
189 myOptions.setTriangleSubdivision(v);
196 {
return myLimitOptions; }
198 {
return myLimitOptions; }
239 GT_Size limitCoarseFaceCount()
const;
244 GT_Size limitPatchCount()
const;
258 AttribId limitFindAttribute(
const char *
name)
const;
264 bool limitLookupPatch(
GT_Size hou_face,
268 const AttribId &attrib)
const;
274 bool limitLookupFace(
GT_Size osd_face,
278 const AttribId &attrib)
const;
296 const int32 *face_indices,
299 int uv_stride = 1)
const;
316 const AttribId &attrib,
318 const int32 *face_indices,
321 int uv_stride = 1)
const;
325 const char *attrib,
bool vertex_attrib,
327 const int32 *face_indices,
330 int uv_stride = 1)
const;
344 bool force_update =
false);
353 const GT_OSDDrawContext *getDrawContext();
368 void addError(
const char *msg) { myErrors.append(msg); }
377 bool triangulate_loop =
true)
const;
VtxBoundaryInterpolation vtxBoundaryInterpolation() const
GT_OSDOptions::SdcOptions SdcOptions
OpenSubdiv::Sdc::Options SdcOptions
std::pair< int, bool > AttribId
const GT_OSDOptions & options() const
void addError(const char *msg)
Class which writes ASCII or binary JSON streams.
Options for setting up limit surface evaluation.
A range of elements in an index-map.
void setCreaseOverride(bool yes, fpreal w)
fpreal creaseOverride() const
GT_OSDPatchTableOptions & limitOptions()
GT_Scheme
Subdivision schemes.
bool doCreaseOverride() const
FVarLinearInterpolation fvarLinearInterpolation() const
void setVtxBoundaryInterpolation(VtxBoundaryInterpolation v)
bool operator<(const GU_TetrahedronFacet &a, const GU_TetrahedronFacet &b)
SdcOptions::VtxBoundaryInterpolation VtxBoundaryInterpolation
GLuint const GLchar * name
GT_OSDAttributes::AttribId AttribId
void setScheme(GT_Scheme s)
const UT_StringArray & errors() const
void setCreasingMethod(SdcOptions::CreasingMethod v)
SdcOptions::FVarLinearInterpolation FVarLinearInterpolation
const GT_OSDPatchTableOptions & limitOptions() const
void setOptions(const GT_OSDOptions &options)
GLubyte GLubyte GLubyte GLubyte w
void setTriangleSubdivision(SdcOptions::TriangleSubdivision v)
Topology definition for opensubdiv classes.
void setFVarLinearInterpolation(FVarLinearInterpolation v)
void setRemoveHoles(bool v)
void setCreaseOverride(fpreal w)
Class to perform subdivision refinement using OpenSubdivision.
Options for topology and refinement.