47 using namespace UT::Literal;
49 namespace HDK_Sample {
75 point_group_deleter.reset(ptgroup);
77 point_group = ptgroup;
94 if (start >= points_end)
105 bool has_other =
false;
130 if (points_to_add <= 0)
133 numpointsadded += points_to_add;
144 bool skip_first = !has_other;
149 return numpointsadded;
151 ptwrangler->copyAttributeValues(newptoff, ptoff);
156 if (numpointsadded > 0)
177 return numpointsadded;
190 for (
int i = 0; i < tuplesize; i++)
192 if (
SYSabs(attrib.
get(v1, i) - attrib.
get(v2, i)) > tol)
199 geoSplitPointsByAttrib(
214 return numpointsadded;
218 return numpointsadded;
232 tuplesize = attribi.getTupleSize();
238 tuplesize = attribf.getTupleSize();
242 UT_ASSERT_MSG(0,
"Why does a GA_ATINumeric have a storage class other than int or float?");
251 UT_ASSERT_MSG(0,
"Missing an implementation of GA_AIFCompare!");
252 return numpointsadded;
264 if (ptidx >= initnumpts)
282 if (!group || group->
contains(is_primgroup ? primoff : vtxoff))
285 baseprimoff = primoff;
292 if (!group || group->
contains(is_primgroup ? primoff : vtxoff))
294 if (primoff > baseprimoff || (primoff == baseprimoff && vtxoff > basevtxoff))
297 baseprimoff = primoff;
311 vtxlist(0) = basevtxoff;
315 if (vtxoff == basevtxoff)
320 match = compareVertices<int64>(baseoffset, offset, attribi, tuplesize, tolerance);
322 match = compareVertices<fpreal>(baseoffset, offset, attribf, tuplesize, tolerance);
325 bool success = compare->
isEqual(match, *attrib, baseoffset, *attrib, offset);
358 ptwrangler->copyAttributeValues(newptoff, ptoff);
359 for (
exint i = 0; i < vtxlist.
size(); i++)
362 }
while (splitfound);
365 if (numpointsadded > 0)
386 return numpointsadded;
398 return geoSplitPointsByAttrib(
400 detail->
getPointRange(isptgroup ? UTverify_cast<const GA_PointGroup *>(group) :
nullptr),
401 isptgroup ?
nullptr : group,
413 return geoSplitPointsByAttrib(
SYS_FORCE_INLINE void bumpDataId()
Definition of a geometry attribute.
GLdouble GLdouble GLint GLint const GLdouble * points
Iteration over a range of elements.
static GA_AttributeFilter selectPublic(bool include_noninternal_groups=true)
Select public scope attributes and non-internal groups.
bool blockAdvance(GA_Offset &start, GA_Offset &end)
GA_EdgeGroupTable & edgeGroups()
GLfloat GLfloat GLfloat v2
void setVertexPoint(GA_Offset vertex, GA_Offset ptoff)
Given a vertex, set the corresponding point offset.
SYS_FORCE_INLINE bool GAisValid(GA_Size v)
void setSize(exint newsize)
exint GA_Size
Defines the bit width for index and offset types in GA.
#define GA_INVALID_OFFSET
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.
virtual const GA_AIFCompare * getAIFCompare() const
Return the attribute's comparison interface or NULL.
bool combine(const GA_Group *src) overridefinal
#define UT_ASSERT_MSG(ZZ,...)
CompareResults OIIO_API compare(const ImageBuf &A, const ImageBuf &B, float failthresh, float warnthresh, ROI roi={}, int nthreads=0)
GA_Range getPointRange(const GA_PointGroup *group=0) const
Get a range of all points in the detail.
const GA_IndexMap & getPointMap() const
SYS_FORCE_INLINE GA_Offset appendPointBlock(GA_Size npoints)
Append new points, returning the first offset of the contiguous block.
void sort(ComparatorBool is_less={})
Sort using std::sort with bool comparator. Defaults to operator<().
GA_StorageClass getStorageClass() const
Returns the approximate type of the attribute.
SYS_FORCE_INLINE const GA_ATITopology * getVertexNextRef() const
GA_AttributeSet & getAttributes()
SYS_FORCE_INLINE GA_Offset pointVertex(GA_Offset point) const
Attribute Interface class to perform comparisons on attributes.
GA_Size GEOsplitPointsByAttrib(GEO_Detail *detail, const GA_Range &points, const GA_Attribute *attrib, fpreal tolerance)
SYS_FORCE_INLINE T get(GA_Offset off, int comp=0) const
SYS_FORCE_INLINE GA_Offset lastOffset() const
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
SYS_FORCE_INLINE GA_Offset vertexToNextVertex(GA_Offset vtx) const
GA_GroupType classType() const
GA_Topology & getTopology()
SYS_FORCE_INLINE bool isValid() const
SYS_FORCE_INLINE GA_Index pointIndex(GA_Offset offset) const
Given a point's data offset, return its index.
SYS_FORCE_INLINE GA_Offset vertexPrimitive(GA_Offset vertex) const
SYS_FORCE_INLINE const GA_ATITopology * getVertexPrevRef() const
SYS_FORCE_INLINE GA_Offset appendPointOffset()
virtual bool isEqual(bool &result, const GA_Attribute &a, GA_Offset ai, const GA_Attribute &b, GA_Offset bi) const =0
GA_GroupType
An ordinal enum for the different types of groups in GA.
SYS_FORCE_INLINE GA_AttributeOwner getOwner() const
GA_Size GEO_API GEOsplitPoints(GEO_Detail *detail, const GA_ElementGroup *group=nullptr)
void bumpAllDataIds(GA_AttributeOwner owner)
Bumps all data IDs of attributes of the specified owner.
UT_UniquePtr< GA_PointGroup > GA_PointGroupUPtr
SYS_FORCE_INLINE bool isEmpty() const
Query whether the group is empty of primary elements.
SYS_FORCE_INLINE const GA_ATITopology * getPointRef() const
SYS_FORCE_INLINE bool contains(GA_Offset offset) const
SYS_FORCE_INLINE GA_Size getNumPoints() const
Return the number of points.