21 #ifndef __GU_TriangleMesh_h__
22 #define __GU_TriangleMesh_h__
62 {
return myNumPrimaryPoints; }
66 {
return int(myAuxiliaryPointPos.size()); }
70 {
return numPrimaryPoints() + numAuxiliaryPoints(); }
74 { myNumPrimaryPoints = num; }
78 { myAuxiliaryPointPos.append(pos);
79 return numPoints() - 1; }
82 { myVertexToDetailVertex.append(vtx); }
86 {
return myVertexToDetailVertex(v); }
90 {
return myPos.get(myPosFromVertexAttrib ? vtx
91 : myGdp->vertexPoint(vtx)); }
95 {
return myDetailVertexToVertex.get(vtx); }
99 {
return myVertexToDetailVertex.size() > 0; }
103 { myDetailVertexToVertex.set(vtx, pt); }
107 {
return myPosFromVertexAttrib; }
121 int myNumPrimaryPoints = 0;
122 PointCoordsArray myAuxiliaryPointPos;
129 bool myPosFromVertexAttrib =
false;
132 template <
typename T>
167 Tessellation tessellation = TRIANGULATE_ALL,
187 void appendPolys(
const GA_Range &polys);
220 bool allow_zero_length_edges =
false);
222 template<
typename Func>
227 auto vtxs = myGdp->getPrimitiveVertexList(poly);
228 for (
int i = 0, ie =
int(vtxs.size()); i < ie; i++)
233 template<
typename Func>
235 { forEachPolyVertex(func); }
239 {
return myLink.vertexFromDetailVertex(vtx); }
242 int pointFromDetailVertex(
GA_Offset vtx)
const;
255 {
return vertexFromDetailVertex(vtx); }
259 {
return myLink.vertexToDetailVertex(v); }
264 auto v = Base::triangleVertex(t, 0);
265 return myGdp->vertexPrimitive(vertexToDetailVertex(
v));
271 {
return vertexToDetailVertex(Base::pointVertex(pt)); }
275 GA_Offset pointToDetailPoint(
int pt)
const;
281 {
return myPolyArea(poly_idx); }
285 {
return myLink.isEngaged(); }
288 {
return myLink.numPrimaryPoints(); }
293 {
return myLink.detailVertexPosition(vtx); }
303 int indexPolyVertices(
bool allow_zesro_length_edges,
308 bool allow_zero_length_edges,
316 bool allow_zero_length_edges,
324 Tessellation myTessellation;
331 template <
typename T>
337 if (pt >= myNumPrimaryPoints)
338 return myAuxiliaryPointPos(pt - myNumPrimaryPoints);
340 auto vtx = myVertexToDetailVertex(myMesh.pointVertex(pt));
341 return detailVertexPosition(vtx);
344 template <
typename T>
348 auto vtx = vertexToDetailVertex(Base::pointVertex(pt));
351 return myGdp->vertexPoint(vtx);
354 template <
typename T>
360 int h_sym = Base::sym(h);
367 template <
typename T>
371 auto v = vertexFromDetailVertex(vtx);
374 return Base::vertexPoint(
v);
377 template <
typename T>
382 && myGdp->getPrimitiveClosedFlag(prim)
383 && myGdp->getPrimitiveVertexCount(prim) > 2;
386 template <
typename T>
390 return detailVertexPosition(vtx0) == detailVertexPosition(vtx1);
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
Definition of a geometry attribute.
SYS_FORCE_INLINE GA_Offset vertexToDetailVertex(int v) const
SYS_FORCE_INLINE bool isEngaged() const
SYS_FORCE_INLINE void assignVertexToDetailVertex(GA_Offset vtx, int pt)
void forEachDetailVertex(Func func) const
Tessellation tessellation() const
SYS_FORCE_INLINE UT_Vector3R detailVertexPosition(GA_Offset vtx) const
void forEachPolyVertex(Func func) const
GA_Offset srcVertex(GEO_Hedge)
GU_TriangleMeshT< fpreal32 > GU_TriangleMeshF
void appendMappingToDetailVertex(GA_Offset vtx)
SYS_FORCE_INLINE bool GAisValid(GA_Size v)
SYS_FORCE_INLINE int vertexFromDetailVertex(GA_Offset vtx) const
#define GA_INVALID_OFFSET
SYS_FORCE_INLINE int numAuxiliaryPoints() const
A range of elements in an index-map.
SYS_FORCE_INLINE void appendPoly(GA_Offset poly)
GU_TriangleMeshT< fpreal64 > GU_TriangleMeshD
SYS_FORCE_INLINE int vertexFromDetailVertex(GA_Offset vtx) const
SYS_FORCE_INLINE PointCoords pointPosition(int pt) const
SYS_FORCE_INLINE bool isBuilt() const
SYS_FORCE_INLINE GA_Offset dstVertex(T &iface, GEO_Hedge h)
SYS_FORCE_INLINE GA_Offset pointToDetailVertex(int pt) const
SYS_FORCE_INLINE const GU_Detail * getDetail() const
fpreal polyArea(exint poly_idx) const
UT_UniquePtr< GA_Attribute > GA_AttributeUPtr
SYS_FORCE_INLINE int numPoints() const
SYS_FORCE_INLINE int pointFromDetailVertex(GA_Offset vtx) const
SYS_FORCE_INLINE int hedgeFromDetailVertex(GA_Offset vtx) const
GLfloat GLfloat GLfloat GLfloat h
SYS_FORCE_INLINE const GA_OffsetArray & polys() const
SYS_FORCE_INLINE bool isPosFromVertexAttrib() const
SYS_FORCE_INLINE GA_Offset vertexToDetailVertex(int v) const
SYS_FORCE_INLINE int appendAuxiliaryPoint(UT_Vector3R pos)
SYS_FORCE_INLINE GA_Offset hedgeToDetailVertex(int h) const
SYS_FORCE_INLINE void setNumPrimaryPoints(int num)
SYS_FORCE_INLINE int numPrimaryPoints() const
SYS_FORCE_INLINE PointCoords detailVertexPosition(GA_Offset vtx) const
int numPrimaryPoints() const
const GEO_DetachedHedgeInterface HedgeInterface
SYS_FORCE_INLINE GA_Offset pointToDetailPoint(int pt) const
GU_TriangleMeshT< fpreal > GU_TriangleMeshR
GA_RWHandleT< int32 > GA_RWHandleI
SYS_FORCE_INLINE GA_Offset triangleToDetailPoly(int t) const
UT_StringArray JOINTS hip