HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_PrimPolySoup Class Referenceabstract

A soup of polygons. More...

#include <GEO_PrimPolySoup.h>

+ Inheritance diagram for GEO_PrimPolySoup:

Classes

class  PolygonIterator
 
class  VertexIterator
 

Public Member Functions

void stashed (bool beingstashed, GA_Offset offset=GA_INVALID_OFFSET) override
 Have we been deactivated and stashed? More...
 
UT_Vector3 baryCenter () const override
 
UT_Vector3D baryCenterD () const override
 
UT_Vector3 computeNormal (const PolygonIterator &it) const
 
UT_Vector3D computeNormalD (const PolygonIterator &it) const
 
UT_Vector3 baryCenter (const PolygonIterator &it) const
 
UT_Vector3D baryCenterD (const PolygonIterator &it) const
 
fpreal calcVolume (const UT_Vector3 &refpt, const PolygonIterator &it) const
 
fpreal calcArea (const PolygonIterator &it) const
 
fpreal calcPerimeter (const PolygonIterator &it) const
 
GA_Size getPolygonCount () const
 Get number of polygons in the soup. More...
 
GA_Size getPolygonSize (GA_Size polygon) const
 Get the number of vertices in the polygon. More...
 
void getPolygonVertexRange (GA_Size polygon, GA_Size &start, GA_Size &count) const
 
GA_Offset getPolygonVertexOffset (GA_Size polygon, GA_Size vertexofpolygon) const
 
GA_Offset getPolygonVertexOffset (const PolygonIterator &it, GA_Size vertexofpolygon) const
 
void getTriangleVertexOffsets (GA_Size start, GA_Offset &v0, GA_Offset &v1, GA_Offset &v2) const
 
void getQuadVertexOffsets (GA_Size start, GA_Offset &v0, GA_Offset &v1, GA_Offset &v2, GA_Offset &v3) const
 
GA_Size getMaxPolygonSize () const
 Return the maximum number of vertices in any face. More...
 
GA_Size getMinPolygonSize () const
 Return the minimum number of vertices in any face. More...
 
void getMinMaxPolygonSize (GA_Size &mn, GA_Size &mx) const
 Return the minimum and maximum number of vertices for any face. More...
 
const GA_PrimitiveJSONgetJSON () const override
 
void appendPolygonCopyUnique (const GEO_PrimPoly *polygon, GA_VertexWrangler &wrangler)
 
void appendPolygonCopyShared (const GEO_PrimPoly *polygon, GA_VertexWrangler &wrangler, GA_AttributeRefMap &attributemap)
 
void appendPolygonCopyUnique (const GA_OffsetListRef &polygon, const GA_Detail &srcdetail, GA_VertexWrangler &wrangler)
 
void appendPolygonCopyShared (const GA_OffsetListRef &polygon, const GA_Detail &srcdetail, GA_VertexWrangler &wrangler, GA_AttributeRefMap &attributemap)
 
void appendPolySoupCopyUnique (const GEO_PrimPolySoup *that, GA_VertexWrangler &wrangler)
 
void appendPolySoupCopyShared (const GEO_PrimPolySoup *that, GA_VertexWrangler &wrangler, GA_AttributeRefMap &attributemap)
 
void appendPolygon (const UT_Array< GA_Offset > &vertices)
 
void appendPolygons (const GA_PolyCounts &sizes, const GA_OffsetList &vertices)
 
bool areAllVerticesUnique () const
 
void makeAllVerticesUnique ()
 
void optimize ()
 Optimizes the internal representation of the PolySoup. More...
 
GA_Size cleanData (const bool remove_near_points=false, float tol=0.001F, bool deleteOrphanedPoints=true)
 
GA_Size remove012 (bool delete_orphaned_points=true)
 
void deleteUnusedVertices (bool andpoints=true)
 
void remeshPolygons (const UT_Array< GA_Size > &polygonstoremesh, const GA_OffsetList &newvertices, const GA_PolyCounts &newpolygonsizelist)
 
GA_Primitive::GA_DereferenceStatus dereferencePoints (const GA_RangeMemberQuery &point_query, bool dry_run) override
 
void copyPrimitive (const GEO_Primitive *psrc) override
 
GEO_Primitivecopy (int preserve_shared_pts) const override
 
void copySubclassData (const GA_Primitive *source) override
 
void swapVertexOffsets (const GA_Defragment &defrag) override
 Defragmentation. More...
 
GA_Size getPolygonVertexCount () const
 
GA_Size appendVertex (GA_Offset ptoff) override
 
GA_Offset appendSharedVertices (GA_Offset startptoff, GA_Size nvertices)
 
void iterateEdges (GA_IterateEdgesFunc apply_func) const override
 
void iterateEdgesByVertex (GA_IterateEdgesByVertexFunc apply_func) const override
 
bool hasEdge (const GA_Edge &edge) const override
 
void computeInteriorPointWeights (UT_Array< GA_Offset > &vtxlist, UT_Array< float > &weightlist, fpreal u, fpreal v, fpreal w) const override
 
virtual void convex (GA_Size maxpts=3, const GA_Detail *restgdp=nullptr, bool flipedges=false, bool avoiddegeneracy=false)=0
 
UT_Vector3 computeNormal () const override
 
UT_Vector3D computeNormalD () const override
 
void reverse () override
 
fpreal calcVolume (const UT_Vector3 &refpt) const override
 
fpreal calcArea () const override
 
fpreal calcPerimeter () const override
 
bool savePolygonInfo (UT_JSONWriter &w, const GA_SaveMap &map) const
 
bool loadPolygonInfo (UT_JSONParser &p, const GA_LoadMap &map)
 
- Public Member Functions inherited from GEO_TriMesh
bool getBBox (UT_BoundingBox *bbox) const override
 
void addToBSphere (UT_BoundingSphere *bsphere) const override
 
UT_Vector3 baryCenter () const override
 
UT_Vector3D baryCenterD () const override
 
bool saveH9 (std::ostream &os, bool binary, const UT_Array< GA_AttribSaveDataH9 > &prim_attribs, const UT_Array< GA_AttribSaveDataH9 > &vtx_attribs) const override
 
bool loadH9 (UT_IStream &is, const UT_Array< GA_AttribLoadDataH9 > &prim_attribs, const UT_Array< GA_AttribLoadDataH9 > &vtx_attribs) override
 
virtual bool changePointRef (GA_Offset from, GA_Offset to)
 
bool isDegenerate () const override
 Is the primitive degenerate. More...
 
SYS_FORCE_INLINE void setSize (GA_Size nvertices)
 
int detachPoints (GA_PointGroup &grp) override
 
GA_DereferenceStatus dereferencePoint (GA_Offset point, bool dry_run=false) override
 
GA_DereferenceStatus dereferencePoints (const GA_RangeMemberQuery &pt_q, bool dry_run=false) override
 
virtual GA_Size insertVertex (GA_Offset ppt, GA_Size where=0)
 
virtual int deleteVertex (GA_Size num)
 
virtual void deleteVertices (const UT_Array< GA_Size > &nums)
 
GA_Size findVertex (GA_Offset vtx) const
 return the index of a vertex within our vertex list More...
 
virtual GA_Size stealVertex (GA_Offset vtx, GA_Offset insert_before_vtx=GA_INVALID_OFFSET)
 
SYS_FORCE_INLINE GA_Size getFastVertexCount () const
 
SYS_FORCE_INLINE GA_Offset getFastVertexOffset (GA_Size index) const
 
GA_Size find (GA_Offset pt) const
 
const GEO_Vertex operator() (GA_Size i) const
 
GEO_Vertex operator() (GA_Size i)
 
const GEO_Vertex operator[] (GA_Size i) const
 
GEO_Vertex operator[] (GA_Size i)
 
void setVertexPoint (GA_Size i, GA_Offset pt)
 
virtual bool vertexApply (bool(*apply)(GA_Offset vtx, void *), void *data=0) const final
 
void unitLengthToUnitPair (float ulength, float vlength, float &uparm, float &vparm) const override
 
void unitLengthToUnitPair (float ulength, float vlength, float &uparm, float &vparm, float tolerance) const override
 
void unitToUnitLengthPair (float uparm, float vparm, float &ulength, float &vlength) const override
 
void assignVertexList (const GA_OffsetList &list, bool destroy_existing=true, bool update_topology=true)
 
virtual bool jsonSaveBasis (UT_JSONWriter &w) const
 
virtual bool jsonSaveBasis (UT_JSONValue &v) const
 
virtual bool jsonLoadBasis (UT_JSONParser &p)
 
virtual bool jsonLoadBasis (UT_JSONParser &p, const UT_JSONValue &v)
 
bool saveVertexArray (UT_JSONWriter &w, const GA_SaveMap &map) const
 
bool loadVertexArray (UT_JSONParser &p, const GA_LoadMap &map)
 
- Public Member Functions inherited from GEO_Primitive
GA_PrimCompat::TypeMask getPrimitiveId () const override
 
void copyAttributesAndGroups (const GEO_Primitive &src, bool copy_groups=true)
 
void copyAttributesAndGroups (const GEO_Primitive &src, GA_AttributeRefMap &gah, bool copy_groups=true)
 
void copyAttributesAndGroups (const GEO_Primitive &src, GA_PrimitiveWrangler &wrangler, bool copy_groups=true)
 NOTE: The copying of groups only works if src is in the same detail. More...
 
void copyAttributeData (const GEO_Primitive &src)
 
void copyAttributeData (const GEO_Primitive &src, GA_AttributeRefMap &gah)
 
void copyAttributeData (const GEO_Primitive &src, GA_PrimitiveWrangler &wrangler)
 
void copyAttributeValues (const GEO_Primitive &src, GA_PrimitiveWrangler &wrangler)
 
void copyGroupMembership (const GEO_Primitive &src)
 
virtual void transform (const UT_Matrix4 &)
 
virtual void realToUnitPair (float ureal, float vreal, float &uunit, float &vunit) const
 
virtual void unitToRealPair (float uunit, float vunit, float &ureal, float &vreal) const
 
bool evaluateBaryCenter (GA_Offset result_vtx, GA_AttributeRefMap &map) const
 
bool evaluatePoint (GA_Offset result_vtx, GA_AttributeRefMap &map, fpreal u, fpreal v=0, uint du=0, uint dv=0) const
 
int evaluatePoint (UT_Vector4 &pos, float u, float v=0, unsigned du=0, unsigned dv=0) const
 
bool evaluateInteriorPoint (GA_Offset result_vtx, GA_AttributeRefMap &map, fpreal u, fpreal v, fpreal w=0) const
 
int evaluateInteriorPoint (UT_Vector4 &pos, fpreal u, fpreal v, fpreal w=0) const
 
SYS_FORCE_INLINE GEO_DetailgetParent () const
 
virtual bool getVisibleBBox (UT_BoundingBox *bbox) const
 
bool enlargeVisibleBoundingBox (UT_BoundingBox &b, const GA_Attribute *P) const override
 
template<typename T >
UT_Vector3T< TbaryCenterT () const
 
virtual void isolate ()
 Method to isolate a pasted surface. More...
 
GEO_Vertex getVertexElement (GA_Size i) const
 
virtual GEO_MetaPrimcastToMetaPrim ()
 
virtual const GEO_MetaPrimcastToMetaPrim () const
 
virtual int parametricBBox (float u, float v, float *u0, float *u1, float *v0, float *v1)
 
virtual float uvDist (float u1, float v1, float u2, float v2) const
 
int bboxIntersectRay (const UT_Vector3 &rayorig, const UT_Vector3 &raydir, int maxtries=10, float tmax=1E17F, float *distance=0, UT_Vector3 *nml=0) const
 
virtual bool isQuadric () const
 
virtual void normal (NormalComp &output) const =0
 
virtual void normal (NormalCompD &output) const =0
 
virtual GEO_Primitiveconvert (GEO_ConvertParms &parms, GA_PointGroup *usedpts=0)=0
 
virtual GEO_PrimitiveconvertNew (GEO_ConvertParms &parms)=0
 
virtual void clip (UT_Vector3 normal, float distance=0, GA_PrimitiveGroup *clipgrp=NULL)
 
virtual int intersectRay (const UT_Vector3 &o, const UT_Vector3 &d, float tmax=1E17F, float tol=1E-12F, float *distance=0, UT_Vector3 *pos=0, UT_Vector3 *nml=0, int accurate=0, float *u=0, float *v=0, int ignoretrim=1) const
 
bool enlargeBoundingBox (UT_BoundingRect &b, const GA_Attribute *p) const override
 
bool enlargeBoundingBox (UT_BoundingBox &b, const GA_Attribute *p) const override
 
virtual bool hasGuideEdge (int edgeid, UT_Vector3 &a, UT_Vector3 &b) const
 
virtual bool hasXsectPoint (int pointid, UT_Vector3 &p) const
 
- Public Member Functions inherited from GA_Primitive
virtual ~GA_Primitive ()
 
virtual const
GA_PrimitiveDefinition
getTypeDef () const =0
 
const char * getTypeName () const
 
SYS_FORCE_INLINE GA_DetailgetDetail () const
 
SYS_FORCE_INLINE GA_Offset getMapOffset () const
 Gets the offset of this primitive in the detail containing it. More...
 
SYS_FORCE_INLINE GA_Index getMapIndex () const
 Gets the index of this primitive in the detail containing it. More...
 
SYS_FORCE_INLINE const
GA_IndexMap
getIndexMap () const
 Gets the index map for primitives in the detail containing this primitive. More...
 
GA_Index getNum () const
 
void swapOffsetValue (const GA_Defragment &defrag)
 For defragmentation, we need to update the offset. More...
 
bool isPrimary () const
 
SYS_FORCE_INLINE const
GA_PrimitiveTypeId
getTypeId () const
 
GA_PrimitiveFamilyMask getFamilyMask () const
 
bool isFamily (unsigned family_mask) const
 
bool hasLocalTransform () const
 Whether the primitive has a transform associated with it. More...
 
virtual void getLocalTransform (UT_Matrix3D &matrix) const
 
virtual void getLocalTransform4 (UT_Matrix4D &matrix) const
 
virtual void setLocalTransform (const UT_Matrix3D &matrix)
 Set the local transform. The default implementation does nothing. More...
 
virtual int64 getMemoryUsage () const
 
virtual void countMemory (UT_MemoryCounter &counter) const
 
SYS_FORCE_INLINE GA_Size getVertexCount () const
 Return the number of vertices used by this primitive. More...
 
SYS_FORCE_INLINE GA_Offset getVertexOffset (GA_Size primvertexnum) const
 
SYS_FORCE_INLINE GA_Index getVertexIndex (GA_Size primvertexnum) const
 
SYS_FORCE_INLINE GA_Offset getPointOffset (GA_Size i) const
 
SYS_FORCE_INLINE void setPointOffset (GA_Size i, GA_Offset ptoff)
 
SYS_FORCE_INLINE GA_Index getPointIndex (GA_Size i) const
 
SYS_FORCE_INLINE UT_Vector3 getPos3 (GA_Size i) const
 
SYS_FORCE_INLINE UT_Vector3D getPos3D (GA_Size i) const
 
template<typename T >
UT_Vector3T< TgetPos3T (GA_Size i) const
 
SYS_FORCE_INLINE void setPos3 (GA_Size i, const UT_Vector3 &pos) const
 
SYS_FORCE_INLINE void setPos3 (GA_Size i, const UT_Vector3D &pos) const
 
SYS_FORCE_INLINE UT_Vector4 getPos4 (GA_Size i) const
 
SYS_FORCE_INLINE UT_Vector4D getPos4D (GA_Size i) const
 
SYS_FORCE_INLINE void setPos4 (GA_Size i, const UT_Vector4 &pos) const
 
SYS_FORCE_INLINE void setPos4 (GA_Size i, const UT_Vector4D &pos) const
 
GA_Range getVertexRange (bool harden=false) const
 Get a range of all the vertices accessed by the primitive. More...
 
GA_Range getPointRange (bool harden=false) const
 
bool isPointUsed (GA_Offset ptoff) const
 
void addPointRefToGroup (GA_PointGroup &grp) const
 
void edgeApply (GA_EdgeApplyFunc apply, void *data=nullptr) const
 
void edgeApplyIndex (GA_EdgeApplyIndexFunc apply, void *data=nullptr) const
 
bool findEdgePoints (GA_Offset ptoff0, GA_Offset ptoff1, GA_Size &vtx0, GA_Size &vtx1) const
 
virtual bool enlargeBoundingSphere (UT_BoundingSphere &b, const GA_Attribute *P) const
 
virtual void enlargePointBounds (UT_BoundingBox &box) const
 
void copyUnwiredForMerge (const GA_Primitive *src, const GA_MergeMap &map)
 
virtual bool saveSharedLoadData (UT_JSONWriter &w, GA_SaveMap &save, GA_GeometryIndex *geo_index) const
 
virtual bool registerSharedLoadData (int load_data_type, GA_SharedDataHandlePtr item)
 
const GA_IntrinsicManagergetIntrinsicManager () const
 
virtual void clearForDeletion ()
 
virtual void getAdjacentBoundaryVertices (GA_Offset vtx, GA_Offset &prev_vtx, GA_Offset &next_vtx) const
 
virtual bool supportsHedge () const
 
virtual int isVisible () const
 
virtual unsigned getNumSecondaryDetails () const
 A primitive may support any number of secondary details. More...
 
virtual const GA_DetailgetSecondaryDetail (GA_Index i) const
 
virtual GA_DetailgetSecondaryDetail (GA_Index i)
 
GA_Index getNumSecondary (GA_Index detail) const
 
const GA_PrimitivegetSecondaryByIndex (GA_Index detail, GA_Index i) const
 
GA_PrimitivegetSecondaryByIndex (GA_Index detail, GA_Index i)
 
const GA_PrimitivegetSecondaryByOffset (GA_Index detail, GA_Offset o) const
 
GA_PrimitivegetSecondaryByOffset (GA_Index detail, GA_Offset o)
 
SYS_FORCE_INLINE bool isVertexListTrivial () const
 
bool isPointListTrivial () const
 
template<typename FUNCTOR >
SYS_FORCE_INLINE void forEachVertex (FUNCTOR &&functor) const
 
template<typename FUNCTOR >
SYS_FORCE_INLINE void forEachPoint (FUNCTOR &&functor) const
 
bool vertexApply (bool(*apply)(GA_Offset vtx, void *), void *data=nullptr) const
 
virtual void flushCEWriteCaches ()
 Copy any modified caches from the GPU back to CPU cache. More...
 
virtual void flushCECaches ()
 
virtual void stealCEBuffers (const GA_Primitive *src)
 Steal the underlying CE buffer from the source. More...
 
GA_LocalIntrinsic findIntrinsic (const UT_StringRef &nm) const
 
GA_LocalIntrinsic findIntrinsic (GA_GlobalIntrinsic h) const
 
GA_GlobalIntrinsic findGlobalIntrinsic (GA_LocalIntrinsic h) const
 
const char * getIntrinsicName (GA_LocalIntrinsic h) const
 
GA_Size getIntrinsicTupleSize (GA_LocalIntrinsic h) const
 
bool getIntrinsicCollapseSingletons (GA_LocalIntrinsic h) const
 
GA_StorageClass getIntrinsicStorage (GA_LocalIntrinsic h) const
 
bool getIntrinsicReadOnly (GA_LocalIntrinsic h) const
 
const UT_OptionsgetIntrinsicOptions (GA_LocalIntrinsic h) const
 
GA_Size getIntrinsic (GA_LocalIntrinsic h, UT_String &val) const
 
GA_Size getIntrinsic (GA_LocalIntrinsic h, UT_StringArray &val) const
 
GA_Size getIntrinsic (GA_LocalIntrinsic h, UT_OptionsHolder &val) const
 
GA_Size getIntrinsic (GA_LocalIntrinsic h, UT_Array< UT_OptionsHolder > &val) const
 
GA_Size getIntrinsic (GA_LocalIntrinsic h, int64 *v, GA_Size size) const
 
GA_Size getIntrinsic (GA_LocalIntrinsic h, fpreal64 *v, GA_Size sz) const
 
bool getIntrinsic (GA_LocalIntrinsic h, float &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, int &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, UT_Vector2 &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, UT_Vector3 &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, UT_Vector4 &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, UT_Matrix2 &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, UT_Matrix3 &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, UT_Matrix4 &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, double &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, int64 &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, UT_Vector2D &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, UT_Vector3D &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, UT_Vector4D &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, UT_Matrix2D &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, UT_Matrix3D &v) const
 
bool getIntrinsic (GA_LocalIntrinsic h, UT_Matrix4D &v) const
 
GA_Size setIntrinsic (GA_LocalIntrinsic h, const char *value)
 
GA_Size setIntrinsic (GA_LocalIntrinsic h, const UT_StringArray &value)
 
GA_Size setIntrinsic (GA_LocalIntrinsic h, const char **val, GA_Size s)
 
GA_Size setIntrinsic (GA_LocalIntrinsic h, const UT_OptionsHolder &value)
 
GA_Size setIntrinsic (GA_LocalIntrinsic h, const UT_Array< UT_OptionsHolder > &value)
 
GA_Size setIntrinsic (GA_LocalIntrinsic h, const UT_OptionsHolder *value, GA_Size s)
 
GA_Size setIntrinsic (GA_LocalIntrinsic h, const int64 val)
 
GA_Size setIntrinsic (GA_LocalIntrinsic h, const fpreal64 val)
 
GA_Size setIntrinsic (GA_LocalIntrinsic h, const int64 *val, GA_Size sz)
 
GA_Size setIntrinsic (GA_LocalIntrinsic h, const fpreal64 *v, GA_Size sz)
 

Static Public Member Functions

static void convertDetail (GEO_Detail *dest_detail, const GEO_Detail *src_detail, const GEO_PolySoupParms &parms)
 
- Static Public Member Functions inherited from GEO_Primitive
static GA_PrimCompat::TypeMask getPrimitiveMaskH9 (const char *maskstr)
 
- Static Public Member Functions inherited from GA_Primitive
static SYS_FORCE_INLINE
GA_PrimCompat::TypeMask 
primCompatMaskFromTypeId (int type_id)
 

Protected Member Functions

 GEO_PrimPolySoup (GA_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
 
 ~GEO_PrimPolySoup () override
 
template<typename T >
UT_Vector3T< TinternalComputeNormal (const PolygonIterator &it) const
 
void appendUniqueVertexCopy (const GA_Offset vertex, const GA_Detail &srcdetail, GA_VertexWrangler &wrangler)
 
void appendSharedVertexCopy (const GA_Offset vertex, const GA_Detail &srcdetail, GA_VertexWrangler &wrangler, GA_AttributeRefMap &attributemap)
 
bool evaluateInteriorPointRefMap (GA_Offset result_vtx, GA_AttributeRefMap &hlist, fpreal u, fpreal v, fpreal w) const override
 
int evaluateInteriorPointV4 (UT_Vector4 &pos, fpreal u, fpreal v, fpreal w) const override
 
int evaluateNormalVector (UT_Vector3 &nml, float u, float v, float w) const override
 
bool savePrivateH9 (std::ostream &, bool binary) const override
 
bool loadPrivateH9 (UT_IStream &) override
 
- Protected Member Functions inherited from GEO_TriMesh
SYS_FORCE_INLINE GEO_TriMesh (GA_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
 
virtual bool validate () const
 
virtual GA_Size getMinVertexCount () const
 
GA_Size multipleInsert (GA_Size where, GA_Size count, bool append_pointsss=true)
 
SYS_FORCE_INLINE GA_Offset vertexPoint (GA_Size i) const
 
void swapVertices (GA_Size i, GA_Size j)
 
bool evaluatePointRefMap (GA_Offset result_vertex, GA_AttributeRefMap &hlist, fpreal u, fpreal v, uint du, uint dv) const override
 
int evaluatePointV4 (UT_Vector4 &pos, float u, float v=0, unsigned du=0, unsigned dv=0) const override
 
bool evaluateBaryCenterRefMap (GA_Offset result_vertex, GA_AttributeRefMap &hlist) const override
 
GA_Offset releaseVertex (GA_Offset vtx) override
 
- Protected Member Functions inherited from GEO_Primitive
SYS_FORCE_INLINE GEO_Primitive (GA_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
 
 ~GEO_Primitive () override
 
- Protected Member Functions inherited from GA_Primitive
SYS_FORCE_INLINE GA_Primitive (GA_Detail &detail, GA_Offset offset=GA_INVALID_OFFSET)
 
void setNumVertices (GA_Size nvertices)
 
GA_Offset allocateVertex (GA_Offset point=GA_INVALID_OFFSET)
 allocateVertex() will call wireVertex() if the point given is not -1 More...
 
void destroyVertex (GA_Offset vertex)
 
void wireVertex (GA_Offset vertex, GA_Offset point)
 
void registerVertex (GA_Offset vertex)
 
SYS_FORCE_INLINE int64 getBaseMemoryUsage () const
 Report approximate memory usage for myVertexList for subclasses. More...
 
void countBaseMemory (UT_MemoryCounter &counter) const
 
void copyVertexListForMerge (const GA_OffsetListRef &src_vertices, const GA_MergeMap &map)
 

Static Protected Member Functions

static GA_PrimitiveFamilyMask buildFamilyMask ()
 
- Static Protected Member Functions inherited from GEO_TriMesh
static GA_PrimitiveFamilyMask buildFamilyMask ()
 
static
GA_IntrinsicManager::Registrar 
registerIntrinsics (GA_PrimitiveDefinition &defn)
 
- Static Protected Member Functions inherited from GEO_Primitive
static
GA_IntrinsicManager::Registrar 
registerIntrinsics (GA_PrimitiveDefinition &defn)
 

Protected Attributes

GA_PolyCounts myPolygonSizeList
 
GA_OffsetList myPolygonVertexList
 
- Protected Attributes inherited from GA_Primitive
GA_OffsetList myVertexList
 

Friends

std::ostream & operator<< (std::ostream &os, const GEO_PrimPolySoup &d)
 

Additional Inherited Members

- Public Types inherited from GEO_Primitive
using NormalComp = NormalCompT< float >
 
using NormalCompArray = NormalCompArrayT< float >
 
using NormalCompAttr = NormalCompAttrT< float >
 
using NormalCompBuffered = NormalCompBufferedT< float >
 
using NormalCompD = NormalCompT< double >
 
using NormalCompArrayD = NormalCompArrayT< double >
 
using NormalCompAttrD = NormalCompAttrT< double >
 
using NormalCompBufferedD = NormalCompBufferedT< double >
 
- Public Types inherited from GA_Primitive
enum  GA_DereferenceStatus { GA_DEREFERENCE_FAIL, GA_DEREFERENCE_OK, GA_DEREFERENCE_DEGENERATE, GA_DEREFERENCE_DESTROY }
 
- Static Public Attributes inherited from GEO_Primitive
static const UT_Array
< GA_AttribSaveDataH9 > & 
theEmptySaveAttribs
 Convience objects to pass as arguments to saveH9()/loadH9(). More...
 

Detailed Description

A soup of polygons.

Examples:
GUI/GUI_PolySoupBox.C.

Definition at line 38 of file GEO_PrimPolySoup.h.

Constructor & Destructor Documentation

GEO_PrimPolySoup::GEO_PrimPolySoup ( GA_Detail d,
GA_Offset  offset = GA_INVALID_OFFSET 
)
inlineprotected

NOTE: The constructor should only be called from subclass constructors.

Definition at line 43 of file GEO_PrimPolySoup.h.

GEO_PrimPolySoup::~GEO_PrimPolySoup ( )
inlineoverrideprotected

NOTE: The destructor should only be called from subclass destructors.

Definition at line 49 of file GEO_PrimPolySoup.h.

Member Function Documentation

void GEO_PrimPolySoup::appendPolygon ( const UT_Array< GA_Offset > &  vertices)

Appends a polygon to this PolySoup from an array of vertex offsets NOTE: This will not wire the vertices to points or to this primitive, so that must be done manually. This assumes the vertices have already been added to the GEO_TriMesh level with appendVertex or appendVertices.

void GEO_PrimPolySoup::appendPolygonCopyShared ( const GEO_PrimPoly polygon,
GA_VertexWrangler wrangler,
GA_AttributeRefMap attributemap 
)

Appends a copy of a single polygon to this PolySoup, with any vertices whose attributes match being shared among polygons in this PolySoup

void GEO_PrimPolySoup::appendPolygonCopyShared ( const GA_OffsetListRef polygon,
const GA_Detail srcdetail,
GA_VertexWrangler wrangler,
GA_AttributeRefMap attributemap 
)

Appends a copy of a single polygon to this PolySoup, with any vertices whose attributes match being shared among polygons in this PolySoup

void GEO_PrimPolySoup::appendPolygonCopyUnique ( const GEO_PrimPoly polygon,
GA_VertexWrangler wrangler 
)

Appends a copy of a single polygon to this PolySoup, with all vertices unique

void GEO_PrimPolySoup::appendPolygonCopyUnique ( const GA_OffsetListRef polygon,
const GA_Detail srcdetail,
GA_VertexWrangler wrangler 
)

Appends a copy of a single polygon to this PolySoup, with all vertices unique

void GEO_PrimPolySoup::appendPolygons ( const GA_PolyCounts sizes,
const GA_OffsetList vertices 
)

Appends polygons to this PolySoup from an array of vertex offsets NOTE: This will not wire the vertices to points or to this primitive, so that must be done manually. This assumes the vertices have already been added to the GEO_TriMesh level with appendVertex or appendVertices.

void GEO_PrimPolySoup::appendPolySoupCopyShared ( const GEO_PrimPolySoup that,
GA_VertexWrangler wrangler,
GA_AttributeRefMap attributemap 
)

Appends a copy of another PolySoup to this PolySoup, with any vertices whose attributes match being shared among polygons in this PolySoup

void GEO_PrimPolySoup::appendPolySoupCopyUnique ( const GEO_PrimPolySoup that,
GA_VertexWrangler wrangler 
)

Appends a copy of another PolySoup to this PolySoup, with all vertices unique

void GEO_PrimPolySoup::appendSharedVertexCopy ( const GA_Offset  vertex,
const GA_Detail srcdetail,
GA_VertexWrangler wrangler,
GA_AttributeRefMap attributemap 
)
protected
GA_Offset GEO_PrimPolySoup::appendSharedVertices ( GA_Offset  startptoff,
GA_Size  nvertices 
)

This appends one vertex for each of nvertices points starting from startptoff, in parallel, and wires them to the points and this polysoup, then returns the starting vertex offset. Since each point has only one vertex, this applies to making shared vertices. NOTE: The points can't be used by any other primitives at the time that this is called. NOTE: If you leave vertices in the polysoup that are not used by any polygons, areAllVerticesUnique() may return incorrect results, since it just checks if the size of myPolygonVertexList is larger than the size of myVertexList

void GEO_PrimPolySoup::appendUniqueVertexCopy ( const GA_Offset  vertex,
const GA_Detail srcdetail,
GA_VertexWrangler wrangler 
)
protected
GA_Size GEO_PrimPolySoup::appendVertex ( GA_Offset  ptoff)
inlineoverridevirtual

These are only here because of C++ compilers erroring on the appendVertex function below, thinking it should hide these. NOTE: This will not add the vertex to myPolygonVertexList, in case it is to be shared, so use appendPolygon(const UT_Array<GA_Offset> &vertices) to add a polygon with the vertex. NOTE: If you leave vertices in the polysoup that are not used by any polygons, areAllVerticesUnique() may return incorrect results, since it just checks if the size of myPolygonVertexList is larger than the size of myVertexList

Reimplemented from GEO_TriMesh.

Definition at line 445 of file GEO_PrimPolySoup.h.

bool GEO_PrimPolySoup::areAllVerticesUnique ( ) const
inline

Returns true iff none of the vertices of the PolySoup are shared among multiple polygons in this PolySoup. NOTE: This assumes that every vertex of the PolySoup is in at least one polygon in this PolySoup.

Definition at line 376 of file GEO_PrimPolySoup.h.

UT_Vector3 GEO_PrimPolySoup::baryCenter ( ) const
inlineoverridevirtual

Return the center of the primitive. This defaults to the center of the bounding box. A better approximation might be the average value of the vertex positions (which could be different).

Reimplemented from GEO_Primitive.

Examples:
GUI/GUI_PolySoupBox.C.

Definition at line 200 of file GEO_PrimPolySoup.h.

UT_Vector3 GEO_PrimPolySoup::baryCenter ( const PolygonIterator it) const
UT_Vector3D GEO_PrimPolySoup::baryCenterD ( ) const
inlineoverridevirtual

Reimplemented from GEO_Primitive.

Definition at line 202 of file GEO_PrimPolySoup.h.

UT_Vector3D GEO_PrimPolySoup::baryCenterD ( const PolygonIterator it) const
static GA_PrimitiveFamilyMask GEO_PrimPolySoup::buildFamilyMask ( )
inlinestaticprotected

Definition at line 532 of file GEO_PrimPolySoup.h.

fpreal GEO_PrimPolySoup::calcArea ( ) const
overridevirtual

Interface from GEO_TriMesh

Reimplemented from GEO_Primitive.

fpreal GEO_PrimPolySoup::calcArea ( const PolygonIterator it) const
fpreal GEO_PrimPolySoup::calcPerimeter ( ) const
overridevirtual

Interface from GEO_TriMesh

Reimplemented from GEO_Primitive.

fpreal GEO_PrimPolySoup::calcPerimeter ( const PolygonIterator it) const
fpreal GEO_PrimPolySoup::calcVolume ( const UT_Vector3 refpt) const
overridevirtual

Interface from GEO_TriMesh

Reimplemented from GEO_Primitive.

fpreal GEO_PrimPolySoup::calcVolume ( const UT_Vector3 refpt,
const PolygonIterator it 
) const
GA_Size GEO_PrimPolySoup::cleanData ( const bool  remove_near_points = false,
float  tol = 0.001F,
bool  deleteOrphanedPoints = true 
)

Remove repeated point offsets in the polygon vertices, optionally checking distance to remove points within a specified tolerance, then remove all degenerate polygons.

void GEO_PrimPolySoup::computeInteriorPointWeights ( UT_Array< GA_Offset > &  vtxlist,
UT_Array< float > &  weightlist,
fpreal  u,
fpreal  v,
fpreal  w 
) const
overridevirtual

Finds the weightings of the vertices that will compute an interior point given the u,v,w coordinates. The offsets are into the gdp's vertex list, not indices into this primitive's vertex list. Weights are normalized. Note this cannot be used to recover the Position as it often has special case logic (as in spheres, or rational splines), in those cases use evaluateInteriorPoint(UT_Vector4 &pos, ...) It has the advantage over the other evaluateInteriorPoints in that it allows you to avoid creating any temporary vertices. Behaviour for non-sublcassed types is to return the 0th vertex.

Reimplemented from GEO_Primitive.

UT_Vector3 GEO_PrimPolySoup::computeNormal ( ) const
overridevirtual

Interface from GEO_TriMesh

Implements GEO_Primitive.

UT_Vector3 GEO_PrimPolySoup::computeNormal ( const PolygonIterator it) const
UT_Vector3D GEO_PrimPolySoup::computeNormalD ( ) const
overridevirtual

Interface from GEO_TriMesh

Implements GEO_Primitive.

UT_Vector3D GEO_PrimPolySoup::computeNormalD ( const PolygonIterator it) const
static void GEO_PrimPolySoup::convertDetail ( GEO_Detail dest_detail,
const GEO_Detail src_detail,
const GEO_PolySoupParms parms 
)
static

Create polygon soup(s), i.e. GEO_PrimPolySoup, where possible in dest_detail. src_detail can be the same as dest_detail.

virtual void GEO_PrimPolySoup::convex ( GA_Size  maxpts = 3,
const GA_Detail restgdp = nullptr,
bool  flipedges = false,
bool  avoiddegeneracy = false 
)
pure virtual

Implemented in GU_PrimPolySoup.

GEO_Primitive* GEO_PrimPolySoup::copy ( int  preserve_shared_pts) const
overridevirtual

Reimplemented from GEO_Primitive.

void GEO_PrimPolySoup::copyPrimitive ( const GEO_Primitive psrc)
overridevirtual

Implements GEO_Primitive.

void GEO_PrimPolySoup::copySubclassData ( const GA_Primitive source)
overridevirtual

Copy all subclass data from source to this.

The vertex lists of source and this must already be equivalent in some manner, though possibly referring to different vertices.

If some subclass data is dependent on the vertex list contents, (such as GEO_PrimPolySoup::myPolygonVertexList), it should be mapped based on the correspondence between the two. GEO_PrimPolySoup is currently the only primitive type with this sort of dependence, so it's probably best not to add more.

NOTE: This must be safe to call on different primitives in parallel at the same time.

Reimplemented from GA_Primitive.

void GEO_PrimPolySoup::deleteUnusedVertices ( bool  andpoints = true)

Remove vertices that are not used by any of the soup's polygons, and optionally remove their points if they are also unused.

GA_Primitive::GA_DereferenceStatus GEO_PrimPolySoup::dereferencePoints ( const GA_RangeMemberQuery point_query,
bool  dry_run 
)
overridevirtual

Implements GA_Primitive.

bool GEO_PrimPolySoup::evaluateInteriorPointRefMap ( GA_Offset  result_vtx,
GA_AttributeRefMap hlist,
fpreal  u,
fpreal  v,
fpreal  w 
) const
overrideprotectedvirtual

Evaluates the position at domain point (u,v) in the interior of the geometry, rather than on the perimeter of the poly. (Note that u, v don't have to be converted to unit domain. We assume that the barycentric coords or bilinear interpolants are already correctly scaled).

Reimplemented from GEO_Primitive.

int GEO_PrimPolySoup::evaluateInteriorPointV4 ( UT_Vector4 pos,
fpreal  u,
fpreal  v,
fpreal  w 
) const
overrideprotectedvirtual

Reimplemented from GEO_Primitive.

int GEO_PrimPolySoup::evaluateNormalVector ( UT_Vector3 nml,
float  u,
float  v,
float  w 
) const
overrideprotectedvirtual

Reimplemented from GEO_Primitive.

const GA_PrimitiveJSON* GEO_PrimPolySoup::getJSON ( ) const
overridevirtual

This method returns the JSON interface for saving/loading the primitive If the method returns a NULL pointer, then the primitive will not be saved to geometry files (and thus cannot be loaded).

Implements GA_Primitive.

GA_Size GEO_PrimPolySoup::getMaxPolygonSize ( ) const
inline

Return the maximum number of vertices in any face.

Definition at line 275 of file GEO_PrimPolySoup.h.

void GEO_PrimPolySoup::getMinMaxPolygonSize ( GA_Size mn,
GA_Size mx 
) const
inline

Return the minimum and maximum number of vertices for any face.

Definition at line 301 of file GEO_PrimPolySoup.h.

GA_Size GEO_PrimPolySoup::getMinPolygonSize ( ) const
inline

Return the minimum number of vertices in any face.

Definition at line 288 of file GEO_PrimPolySoup.h.

GA_Size GEO_PrimPolySoup::getPolygonCount ( ) const
inline

Get number of polygons in the soup.

Definition at line 214 of file GEO_PrimPolySoup.h.

GA_Size GEO_PrimPolySoup::getPolygonSize ( GA_Size  polygon) const
inline

Get the number of vertices in the polygon.

Definition at line 220 of file GEO_PrimPolySoup.h.

GA_Size GEO_PrimPolySoup::getPolygonVertexCount ( ) const
inline

Definition at line 430 of file GEO_PrimPolySoup.h.

GA_Offset GEO_PrimPolySoup::getPolygonVertexOffset ( GA_Size  polygon,
GA_Size  vertexofpolygon 
) const
inline

Definition at line 236 of file GEO_PrimPolySoup.h.

GA_Offset GEO_PrimPolySoup::getPolygonVertexOffset ( const PolygonIterator it,
GA_Size  vertexofpolygon 
) const
inline

Definition at line 246 of file GEO_PrimPolySoup.h.

void GEO_PrimPolySoup::getPolygonVertexRange ( GA_Size  polygon,
GA_Size start,
GA_Size count 
) const
inline

Get the start offset into myPolygonVertexList of vertices for a single polygon in the soup and the number of vertices in the polygon

Definition at line 228 of file GEO_PrimPolySoup.h.

void GEO_PrimPolySoup::getQuadVertexOffsets ( GA_Size  start,
GA_Offset v0,
GA_Offset v1,
GA_Offset v2,
GA_Offset v3 
) const
inline

Definition at line 262 of file GEO_PrimPolySoup.h.

void GEO_PrimPolySoup::getTriangleVertexOffsets ( GA_Size  start,
GA_Offset v0,
GA_Offset v1,
GA_Offset v2 
) const
inline

Definition at line 252 of file GEO_PrimPolySoup.h.

bool GEO_PrimPolySoup::hasEdge ( const GA_Edge edge) const
inlineoverridevirtual

This does a linear search through the whole soup. You may regret calling it for each edge of a large soup.

Reimplemented from GEO_Primitive.

Definition at line 489 of file GEO_PrimPolySoup.h.

template<typename T >
UT_Vector3T<T> GEO_PrimPolySoup::internalComputeNormal ( const PolygonIterator it) const
protected
void GEO_PrimPolySoup::iterateEdges ( GA_IterateEdgesFunc  apply_func) const
inlineoverridevirtual

Calls apply_func for each directed edge on the primitive. If the apply_func function returns false, then the traversal will be stopped.

Reimplemented from GA_Primitive.

Definition at line 461 of file GEO_PrimPolySoup.h.

void GEO_PrimPolySoup::iterateEdgesByVertex ( GA_IterateEdgesByVertexFunc  apply_func) const
overridevirtual

Calls apply_func for each directed edge on the primitive, passing in the GA_Size primitive vertex index for each point on the edge. If the apply_func function returns false, then the traversal will be stopped.

Reimplemented from GA_Primitive.

bool GEO_PrimPolySoup::loadPolygonInfo ( UT_JSONParser p,
const GA_LoadMap map 
)

Save/Load polygon list to a JSON stream

bool GEO_PrimPolySoup::loadPrivateH9 ( UT_IStream )
overrideprotectedvirtual

Implements GEO_TriMesh.

void GEO_PrimPolySoup::makeAllVerticesUnique ( )

Forces all vertices in this polysoup to be unshared, i.e. creates new vertices if any are used by multiple polygons in this polysoup. NOTE: This assumes that every vertex of the PolySoup is in at least one polygon in this PolySoup, since it calls areAllVerticesUnique().

void GEO_PrimPolySoup::optimize ( )

Optimizes the internal representation of the PolySoup.

void GEO_PrimPolySoup::remeshPolygons ( const UT_Array< GA_Size > &  polygonstoremesh,
const GA_OffsetList newvertices,
const GA_PolyCounts newpolygonsizelist 
)

Replaces specified polygons with new polygons using the same vertices, which is necessary for convexing. polygonstoremesh must be monotone increasing.

GA_Size GEO_PrimPolySoup::remove012 ( bool  delete_orphaned_points = true)

Remove polygons that have 0, 1, or 2 vertices, optionally deleting orphaned points.

void GEO_PrimPolySoup::reverse ( )
overridevirtual

Interface from GEO_TriMesh

Implements GEO_Primitive.

bool GEO_PrimPolySoup::savePolygonInfo ( UT_JSONWriter w,
const GA_SaveMap map 
) const

Save/Load polygon list to a JSON stream

bool GEO_PrimPolySoup::savePrivateH9 ( std::ostream &  ,
bool  binary 
) const
overrideprotectedvirtual

Implements GEO_TriMesh.

void GEO_PrimPolySoup::stashed ( bool  beingstashed,
GA_Offset  offset = GA_INVALID_OFFSET 
)
overridevirtual

Have we been deactivated and stashed?

Reimplemented from GA_Primitive.

void GEO_PrimPolySoup::swapVertexOffsets ( const GA_Defragment defrag)
overridevirtual

Defragmentation.

Reimplemented from GA_Primitive.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const GEO_PrimPolySoup d 
)
friend

Definition at line 569 of file GEO_PrimPolySoup.h.

Member Data Documentation

GA_PolyCounts GEO_PrimPolySoup::myPolygonSizeList
protected

Definition at line 565 of file GEO_PrimPolySoup.h.

GA_OffsetList GEO_PrimPolySoup::myPolygonVertexList
protected

Definition at line 566 of file GEO_PrimPolySoup.h.


The documentation for this class was generated from the following file: