14 #ifndef __GEO_PrimPolySoup__
15 #define __GEO_PrimPolySoup__
61 :
GA_PolyCounts::const_iterator(prim.myPolygonSizeList, polygon)
68 this->myPrim = that.myPrim;
74 return myPrim->myPolygonVertexList(
start()+i);
79 const GA_Detail &detail = myPrim->getDetail();
85 return myPrim->getDetail().vertexPoint(myPrim->myPolygonVertexList(
start()+i));
90 const GA_Detail &detail = myPrim->getDetail();
96 const GA_Detail &detail = myPrim->getDetail();
102 const GA_Detail &detail = myPrim->getDetail();
106 {
return myPrim->baryCenter(*
this); }
108 {
return myPrim->baryCenterD(*
this); }
110 {
return myPrim->computeNormal(*
this); }
112 {
return myPrim->computeNormalD(*
this); }
114 {
return myPrim->calcPerimeter(*
this); }
116 {
return myPrim->calcArea(*
this); }
118 {
return myPrim->calcVolume(refpt, *
this); }
120 {
return UTpackIntToSafeFloat(polygon()); }
124 {
return getVertexOffset(i); }
126 {
return nvertices(); }
128 {
return nvertices(); }
140 , myIndex(it.
start()+vtxnum)
141 , myEnd(it.
start()+it.nvertices())
145 return myIndex == myEnd;
171 return myPrim.myPolygonVertexList(myIndex);
185 void stashed(
bool beingstashed,
216 return myPolygonSizeList.getNumPolygons();
222 UT_ASSERT_P(myPolygonSizeList.getArray().entries() != 0);
223 return myPolygonSizeList.getSize(polygon);
232 UT_ASSERT_P(myPolygonSizeList.getArray().entries() != 0);
233 myPolygonSizeList.getVertexRange(polygon, start, count);
241 getPolygonVertexRange(polygon, start, count);
243 return myPolygonVertexList(start + vertexofpolygon);
249 return myPolygonVertexList(it.
start() + vertexofpolygon);
257 v0 = myPolygonVertexList(start);
258 v1 = myPolygonVertexList(start+1);
259 v2 = myPolygonVertexList(start+2);
268 v0 = myPolygonVertexList(start);
269 v1 = myPolygonVertexList(start+1);
270 v2 = myPolygonVertexList(start+2);
271 v3 = myPolygonVertexList(start+3);
310 mn = mx = array(0).
size();
329 void appendPolygonCopyUnique(
const GEO_PrimPoly *polygon,
334 void appendPolygonCopyShared(
const GEO_PrimPoly *polygon,
338 void appendPolygonCopyUnique(
344 void appendPolygonCopyShared(
377 {
return myPolygonVertexList.entries() == myVertexList.entries(); }
384 void makeAllVerticesUnique();
392 GA_Size cleanData(
const bool remove_near_points =
false,
float tol = 0.001F,
393 bool deleteOrphanedPoints =
true);
397 GA_Size remove012(
bool delete_orphaned_points =
true);
401 void deleteUnusedVertices(
bool andpoints =
true);
412 bool dry_run)
override;
424 void offsetsToIndirection();
427 void indirectionToOffsets();
432 return myPolygonVertexList.entries();
466 if (it.nvertices() == 0)
471 for (++vit; !vit.
atEnd(); ++vit)
474 if (!apply_func(
GA_Edge(prevptoff, currptoff)))
476 prevptoff = currptoff;
481 if (!apply_func(
GA_Edge(prevptoff, startptoff)))
498 const GA_Offset startptoff = it.getPointOffset(0);
503 if ( ((p0 == a) && (p1 == b)) || ((p0 == b) && (p1 == a)) )
513 if ( ((p0 == a) && (p1 == b)) || ((p0 == b) && (p1 == a)) )
529 bool flipedges =
false,
bool avoiddegeneracy =
false) = 0;
535 template <
typename T>
536 UT_Vector3T<T> internalComputeNormal(
const PolygonIterator &it)
const;
544 void appendSharedVertexCopy(const
GA_Offset vertex,
554 bool evaluateInteriorPointRefMap(
GA_Offset result_vtx,
560 float u,
float v,
float w) const override;
562 bool savePrivateH9(std::ostream &,
bool binary) const override;
595 bool ignattr =
false,
600 bool delprims =
true,
602 bool mergeverts =
true)
604 , ignorePrimAttributes(ignattr)
605 , ignorePrimGroups(igngrp)
609 , deleteSoupedPrimitives(delprims)
611 , mergeVertices(mergeverts)
SIM_API const UT_StringHolder vertex
SYS_FORCE_INLINE float getW() const
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
fpreal calcPerimeter() const override
GA_Size getPolygonVertexCount() const
virtual GEO_Primitive * copy(int preserve_shared_pts=0) const
GA_DereferenceStatus dereferencePoints(const GA_RangeMemberQuery &pt_q, bool dry_run=false) override
SYS_FORCE_INLINE GA_Detail & getDetail() const
void getTriangleVertexOffsets(GA_Size start, GA_Offset &v0, GA_Offset &v1, GA_Offset &v2) const
virtual void copyPrimitive(const GEO_Primitive *src)=0
Used to pass options and map offset values during saving.
SYS_FORCE_INLINE PolygonIterator & operator=(const PolygonIterator &that)
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
void getQuadVertexOffsets(GA_Size start, GA_Offset &v0, GA_Offset &v1, GA_Offset &v2, GA_Offset &v3) const
UT_Vector3D baryCenterD() const override
SYS_FORCE_INLINE fpreal calcPerimeter() const
void iterateEdges(GA_IterateEdgesFunc apply_func) const override
GA_PrimCompat::TypeMask typeMask
virtual void computeInteriorPointWeights(UT_Array< GA_Offset > &vtxlist, UT_Array< float > &weightlist, fpreal u, fpreal v, fpreal w) const
virtual UT_Vector3D computeNormalD() const =0
GA_Offset getPolygonVertexOffset(const PolygonIterator &it, GA_Size vertexofpolygon) const
GA_Size getPolygonCount() const
Get number of polygons in the soup.
SYS_FORCE_INLINE GA_Offset getPointOffset(GA_Size i) const
#define SYS_DEPRECATED_PUSH_DISABLE()
void getMinMaxPolygonSize(GA_Size &mn, GA_Size &mx) const
Return the minimum and maximum number of vertices for any face.
UT_Vector4 getPos4(GA_Offset ptoff) const
The ptoff passed is the point offset.
bool deleteSoupedPrimitives
#define SYS_DEPRECATED_POP_DISABLE()
virtual void copySubclassData(const GA_Primitive *source)
SYS_FORCE_INLINE UT_Vector3 baryCenter() const
const GLuint GLenum const void * binary
fpreal calcVolume(const UT_Vector3 &) const override
SYS_FORCE_INLINE GA_Index getPointIndex(GA_Size i) const
SYS_FORCE_INLINE fpreal calcVolume(const UT_Vector3 &refpt) const
GLboolean GLboolean GLboolean GLboolean a
JSON reader class which handles parsing of JSON or bJSON files.
void reverse() override=0
Reverse the order of vertices.
#define GA_DECLARE_INTRINSICS(OVERRIDE)
SYS_FORCE_INLINE GA_Size getVertexCount() const
SYS_FORCE_INLINE UT_Vector3 getPos3(GA_Size i) const
Class which writes ASCII or binary JSON streams.
static GA_PrimitiveFamilyMask buildFamilyMask()
Abstract base class for a range membership query object.
SYS_FORCE_INLINE UT_Vector3 getPos3(GA_Offset ptoff) const
The ptoff passed is the point offset.
Structure for the PolySouping code.
GLfloat GLfloat GLfloat v2
UT_Function< bool(const GA_Edge &edge)> GA_IterateEdgesFunc
GA_EdgeT< GA_Offset, false > GA_Edge
GLfloat GLfloat GLfloat GLfloat v3
SYS_FORCE_INLINE bool isClosed() const
VertexIterator operator-(GA_Size i)
fpreal calcArea() const override
SYS_FORCE_INLINE PolygonIterator()
virtual void swapVertexOffsets(const GA_Defragment &defrag)
exint GA_Size
Defines the bit width for index and offset types in GA.
virtual UT_Vector3 computeNormal() const =0
Return a normal vector for the primitive.
#define GA_INVALID_OFFSET
GA_Size appendVertex(GA_Offset ptoff) override
GA_Size getPolygonSize(GA_Size polygon) const
Get the number of vertices in the polygon.
SYS_FORCE_INLINE GA_Offset getFastVertexOffset(GA_Size i) const
These are just here for interchangeability with GEO_Face.
SYS_FORCE_INLINE GA_Offset getVertexOffset(GA_Size i) const
bool hasEdge(const GA_Edge &edge) const override
SYS_FORCE_INLINE UT_Vector3 computeNormalD() const
VertexIterator(const PolygonIterator &it, GA_Size vtxnum=0)
SYS_FORCE_INLINE UT_Vector3D baryCenterD() const
SYS_FORCE_INLINE UT_Vector4 getPos4(GA_Size i) const
~GEO_PrimPolySoup() override
SYS_FORCE_INLINE fpreal calcArea() const
UT_Vector3D baryCenterD() const override
virtual GA_Size appendVertex(GA_Offset ppt)
GA_Size getMaxPolygonSize() const
Return the maximum number of vertices in any face.
bool areAllVerticesUnique() const
virtual const GA_PrimitiveJSON * getJSON() const =0
GLsizei GLsizei GLchar * source
UT_Function< bool(GA_Size, GA_Size)> GA_IterateEdgesByVertexFunc
Provide a JSON interface to a primitive.
A handle to simplify manipulation of multiple attributes.
SYS_FORCE_INLINE GA_Index vertexIndex(GA_Offset offset) const
Given a vertex's data offset, return its index.
Defragmentation of IndexMaps.
SYS_FORCE_INLINE GA_Offset vertexPoint(GA_Offset vertex) const
Given a vertex, return the point it references.
GLboolean GLboolean GLboolean b
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
const GA_PrimitiveGroup * primGroup
GA_Offset getPolygonVertexOffset(GA_Size polygon, GA_Size vertexofpolygon) const
UT_Vector3 baryCenter() const override
SYS_FORCE_INLINE bool atEnd() const
SYS_FORCE_INLINE UT_Vector3 computeNormal() const
GEO_PolySoupParms(const GA_PrimitiveGroup *pg=0, bool ignattr=false, bool igngrp=false, int minp=1, bool cvx=false, int maxs=3, bool delprims=true, GA_PrimCompat::TypeMask mask=GEO_PrimTypeCompat::GEOPRIMALL, bool mergeverts=true)
SYS_FORCE_INLINE GA_Size start() const
exint entries() const
Alias of size(). size() is preferred.
SYS_FORCE_INLINE GA_Index pointIndex(GA_Offset offset) const
Given a point's data offset, return its index.
Contains transitional objects to provide some backward compatibility for code that references old GEO...
GEO_API const TypeMask GEOPRIMALL
static const UT_Array< GA_AttribSaveDataH9 > & theEmptySaveAttribs
Convience objects to pass as arguments to saveH9()/loadH9().
SYS_FORCE_INLINE PolygonIterator(const GEO_PrimPolySoup &prim, GA_Size polygon)
GEO_PrimPolySoup(GA_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
SYS_FORCE_INLINE GA_Index getVertexIndex(GA_Size i) const
UT_Vector3 baryCenter() const override
SYS_FORCE_INLINE PolygonIterator(const GEO_PrimPolySoup &prim)
VertexIterator operator+(GA_Size i)
Container class for all geometry.
GLubyte GLubyte GLubyte GLubyte w
SYS_FORCE_INLINE GA_Size getFastVertexCount() const
VertexIterator & operator--()
bool ignorePrimAttributes
VertexIterator & operator++()
void getPolygonVertexRange(GA_Size polygon, GA_Size &start, GA_Size &count) const
virtual void iterateEdgesByVertex(GA_IterateEdgesByVertexFunc apply_func) const
virtual void stashed(bool beingstashed, GA_Offset offset=GA_INVALID_OFFSET)
static GA_PrimitiveFamilyMask buildFamilyMask()
SYS_FORCE_INLINE const GEO_PrimPolySoup & prim() const
iteratorT< const GA_PolyCounts, const UT_Array< SizeCount > > & operator=(const iteratorT< const GA_PolyCounts, const UT_Array< SizeCount > > &that)
GA_Size getMinPolygonSize() const
Return the minimum number of vertices in any face.