12 #ifndef __GU_SubDivPatch_h__
13 #define __GU_SubDivPatch_h__
38 static const uint8 SUBD_HARD_EDGE = 0x01;
39 static const uint8 SUBD_LINEAR_CREASES = 0x02;
60 return (vtx == myVertex[0]) ?
61 myVertex[1] : myVertex[0];
82 myHardVertex[i] =
sizes(i);
86 { myHardVertex[i] = getHardVertexSize(i) | 0x80; }
88 { myHardVertex[i] = getHardVertexSize(i); }
90 {
return myHardVertex ? myHardVertex[i] & 0x80 : 0; }
92 {
return myHardVertex ? myHardVertex[i] & 0x7F : 0; }
96 for (i = 0, off = 0; off < vcount; i++)
97 off += getHardVertexSize(i);
117 static const uint8 SUBD_VTX_COMPLETE = 0x01;
118 static const uint8 SUBD_VTX_VTXSET = 0x02;
119 static const uint8 SUBD_VTX_MARK = 0x04;
146 { myEdges[idx] = edge; }
151 void removeEdge(
int idx);
161 void setAllIncomplete();
171 float *getVertexData(
int fidx)
const;
179 void setVertexData(
const float *
data,
int idx,
183 void defaultVertexData(
int low,
int high);
191 for (
int i = 0; i < myFloatCount; i++)
192 myData[i] += vtx->myData[i] *
scale;
198 int low = 0,
int high = -1,
202 for (
int i = 0; i < myFloatCount; i++)
206 int low = 0,
int high = -1);
207 void copyVertex(
int src,
int dest,
int low = 0,
int high = -1);
218 catclarkChild(
false);
236 int idx = getEdgeIndex(vtx);
237 return idx >= 0 ? myEdges[idx] : 0;
240 {
return getEdge(vtx)->
getChild(); }
245 {
return getFaceIndex(face) >= 0; }
248 bool hasHardEdge()
const;
252 void setWeight(
fpreal weight,
bool linear,
264 int creaseidx[2],
int hcount,
267 int creaseidx[2],
int hcount,
275 void catclarkChild(
bool limit);
298 static const uint8 SUBD_PATCH_LIVE = 0x01;
299 static const uint8 SUBD_PATCH_REVERSE = 0x02;
300 static const uint8 SUBD_PATCH_MARK = 0x04;
351 bool isLive()
const {
return myFlag & SUBD_PATCH_LIVE; }
358 void dumpGeo()
const;
382 void incRefCount() { myRefCount++; }
383 void catclarkChild();
403 bool linearcreases =
false,
420 bool build_polysoups);
423 {
return myPointPacking; }
425 {
return myVertexPacking; }
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
bool getFlag(uint8 f) const
void initHardVertex(int size)
void decRefCountInternal()
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
void setEdge(GU_SubDivEdge *edge, int idx)
GU_SubDivVertex * getOther(const GU_SubDivVertex *vtx) const
Return the other vertex.
GU_SubDivVertex * getChild()
Calculate the new subdivision point using the catmull-clark masks.
GU_SubDivVertex * getChild()
bool isHardVertex() const
int getValence() const
Return the number of edges and vertices bordering this patch.
void reverse(I begin, I end)
void sum(const GU_SubDivVertex *vtx, fpreal scale=1)
Operations used to build new data from subdivision rules.
bool getFlag(uint8 f) const
GLfloat GLfloat GLfloat v2
exint GA_Size
Defines the bit width for index and offset types in GA.
GLuint GLsizei const GLuint const GLintptr * offsets
int getVertexSize() const
const GU_SubDivPacking & getPointPacking() const
GA_API const UT_StringHolder scale
void setWeight(fpreal weight)
float * getData() const
Get subdivision data associated with this vertex.
bool getHardVertex(int i) const
GU_SubDivVertex * getVertex(int i) const
GU_SubDivEdge * getEdge(const GU_SubDivVertex *vtx) const
GU_SubDivVertex * getChild()
Return the face centroid.
void setHardVertex(int i)
GU_SubDivVertex * getLimit()
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
GLint GLint GLsizei GLsizei GLsizei depth
exint entries() const
Alias of size(). size() is preferred.
GU_SubDivEdge * getEdge(int idx) const
void setNum(GA_Index num)
GU_SubDivPatch * getFace(int idx) const
bool getFlag(uint8 f) const
const GU_SubDivPacking & getVertexPacking() const
bool hasFace(const GU_SubDivPatch *face) const
void initHardVertex(const UT_IntArray &sizes)
GU_SubDivVertex * getEdgeChild(const GU_SubDivVertex *vtx) const
int getHardVertexSize(int i) const
void clearHardVertex(int i)
int getHardVertexCount(int vcount) const
An interface for constructing a set of patches from geometry.