11 #ifndef __GT_UtilOpenSubdiv__
12 #define __GT_UtilOpenSubdiv__
26 class GT_API GT_OSDDrawContext
29 GT_OSDDrawContext(
const Far::PatchTable &patchTables,
31 const GT_OSDSubdivider<OsdVertex> &subdivider);
34 class PatchArrayDescriptor
37 bool operator<(
const PatchArrayDescriptor &other)
const
39 if (myMaxValence == other.myMaxValence)
41 if (myType == other.myType)
43 if (myPattern == other.myPattern)
45 if (myRotation == other.myRotation)
47 if (mySubPatch == other.mySubPatch)
52 return mySubPatch < other.mySubPatch;
55 return myRotation < other.myRotation;
58 return myPattern < other.myPattern;
61 return myType < other.myType;
64 return myMaxValence < other.myMaxValence;
77 PatchArrayDescriptor myDescriptor;
81 exint myQuadOffsetBase;
82 exint myPrimitiveIdBase;
87 const uint32 *myPatchTable;
89 const int32 *myValenceTable;
91 const uint32 *myQuadOffsetTable;
92 exint myQuadOffsetCount;
93 const FarPatchParam *myPatchParamTable;
94 exint myPatchParamCount;
97 int myPrimitiveMultiplier;
129 myOptions.setScheme(s);
132 int levels()
const {
return myOptions.level(); }
136 myOptions.setLevel(l);
138 bool adaptive()
const {
return myOptions.adaptive(); }
142 myOptions.setAdaptive(v);
148 myOptions.setRemoveHoles(v);
152 {
return myOptions.enableCreaseOverride(); }
154 {
return myOptions.creaseOverride(); }
156 { setCreaseOverride(yes ? w : -1); }
160 myOptions.setCreaseOverride(w);
167 {
return myOptions.vtxBoundaryInterpolation(); }
169 {
return myOptions.fvarLinearInterpolation(); }
173 myOptions.setVtxBoundaryInterpolation(v);
178 myOptions.setFVarLinearInterpolation(v);
183 myOptions.setCreasingMethod(v);
188 myOptions.setTriangleSubdivision(v);
195 {
return myLimitOptions; }
197 {
return myLimitOptions; }
238 GT_Size limitCoarseFaceCount()
const;
243 GT_Size limitPatchCount()
const;
257 AttribId limitFindAttribute(
const char *
name)
const;
263 bool limitLookupPatch(
GT_Size hou_face,
267 const AttribId &attrib,
274 bool limitLookupFace(
GT_Size osd_face,
278 const AttribId &attrib,
297 const int32 *face_indices,
300 int uv_stride = 1)
const;
317 const AttribId &attrib,
319 const int32 *face_indices,
322 int uv_stride = 1)
const;
326 const char *attrib,
bool vertex_attrib,
328 const int32 *face_indices,
331 int uv_stride = 1)
const;
345 bool force_update =
false);
354 const GT_OSDDrawContext *getDrawContext();
369 void addError(
const char *msg) { myErrors.append(msg); }
378 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.
**But if you need a result
Options for setting up limit surface evaluation.
A range of elements in an index-map.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
void setCreaseOverride(bool yes, fpreal w)
fpreal creaseOverride() const
GT_OSDPatchTableOptions & limitOptions()
GT_Scheme
Subdivision schemes.
bool doCreaseOverride() const
GT_API const UT_StringHolder topology
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.