47 namespace HDK_Sample {
73 point_group_deleter.reset(ptgroup);
75 point_group = ptgroup;
92 if (start >= points_end)
103 bool has_other =
false;
128 if (points_to_add <= 0)
131 numpointsadded += points_to_add;
140 vtxoffs.
stdsort(std::less<GA_Offset>());
142 bool skip_first = !has_other;
144 for (
exint j =
exint(skip_first); j < nvtx; ++j, ++newptoff)
147 return numpointsadded;
149 ptwrangler->copyAttributeValues(newptoff, ptoff);
154 if (numpointsadded > 0)
175 return numpointsadded;
188 for (
int i = 0; i < tuplesize; i++)
190 if (
SYSabs(attrib.
get(v1, i) - attrib.
get(v2, i)) > tol)
197 geoSplitPointsByAttrib(
212 return numpointsadded;
216 return numpointsadded;
230 tuplesize = attribi.getTupleSize();
236 tuplesize = attribf.getTupleSize();
240 UT_ASSERT_MSG(0,
"Why does a GA_ATINumeric have a storage class other than int or float?");
249 UT_ASSERT_MSG(0,
"Missing an implementation of GA_AIFCompare!");
250 return numpointsadded;
262 if (ptidx >= initnumpts)
280 if (!group || group->
contains(is_primgroup ? primoff : vtxoff))
283 baseprimoff = primoff;
290 if (!group || group->
contains(is_primgroup ? primoff : vtxoff))
292 if (primoff > baseprimoff || (primoff == baseprimoff && vtxoff > basevtxoff))
295 baseprimoff = primoff;
309 vtxlist(0) = basevtxoff;
313 if (vtxoff == basevtxoff)
318 match = compareVertices<int64>(baseoffset, offset, attribi, tuplesize, tolerance);
320 match = compareVertices<fpreal>(baseoffset, offset, attribf, tuplesize, tolerance);
323 bool success = compare->
isEqual(match, *attrib, baseoffset, *attrib, offset);
356 ptwrangler->copyAttributeValues(newptoff, ptoff);
357 for (
exint i = 0; i < vtxlist.
size(); i++)
360 }
while (splitfound);
363 if (numpointsadded > 0)
384 return numpointsadded;
396 return geoSplitPointsByAttrib(
398 detail->
getPointRange(isptgroup ? UTverify_cast<const GA_PointGroup *>(group) :
nullptr),
399 isptgroup ?
nullptr :
group,
411 return geoSplitPointsByAttrib(
SYS_FORCE_INLINE void bumpDataId()
Definition of a geometry attribute.
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)
bool GAisValid(GA_Size v)
void stdsort(ComparatorBool is_less)
Sort using std::sort. The ComparatorBool uses the less-than semantics.
GA_Size GEOsplitPointsByAttrib(GEO_Detail *detail, const GA_ElementGroup *group, const GA_Attribute *attrib, fpreal tolerance)
GA_EdgeGroupTable & edgeGroups()
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)
GLfloat GLfloat GLfloat v2
void wireVertexPoint(GA_Offset vtx, GA_Offset pt)
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.
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.
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.
GA_AttributeOwner getOwner() const
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.
GLuint GLdouble GLdouble GLint GLint const GLdouble * points
void bumpAllDataIds(GA_AttributeOwner owner)
Bumps all data IDs of attributes of the specified owner.
GA_Size GEOsplitPoints(GEO_Detail *detail, const GA_ElementGroup *group)
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.