14 #ifndef __GA_EdgeGroup_h__
15 #define __GA_EdgeGroup_h__
55 using EdgeList = std::list<PrimEdge>;
77 SYShashCombine(hash, myPrim);
87 using PairType = std::pair<PrimEdge,EdgeList::iterator>;
91 v.second = EdgeList::iterator();
102 return isClear(v.first);
112 static const bool clearNeedsDestruction =
false;
123 template<
typename T,
typename IT>
135 template<
typename ET,
typename EIT>
138 myCurrent = src.myCurrent;
143 template<
typename ET,
typename EIT>
146 myCurrent = src.myCurrent;
154 {
return myCurrent == cmp.myCurrent; }
159 {
return myCurrent != cmp.myCurrent; }
164 { ++myCurrent;
return *
this; }
169 { --myCurrent;
return *
this; }
172 {
return myCurrent == myEnd; }
188 : myCurrent(current), myEnd(end) {}
200 const char *
name=
"");
215 return iterator(myData->myEdgeList.begin(), myData->myEdgeList.end());
221 {
return iterator(myData->myEdgeList.end(), myData->myEdgeList.end()); }
224 {
return const_iterator(myData->myEdgeList.begin(), myData->myEdgeList.end()); }
227 {
return const_iterator(myData->myEdgeList.end(), myData->myEdgeList.end()); }
302 bool remove(
const GA_Edge &edge,
304 bool remove(
const GA_Edge &edge,
312 bool isEmpty()
const {
return myData->myEdgeList.empty(); }
315 void clear()
override;
329 {
return myData->myPrimEntryCount; }
378 return myData->myDataID;
395 return myData->myLastValidTopoId;
399 harden()->myLastValidTopoId = topology_data_id;
404 return myData->myLastValidPrimListId;
408 harden()->myLastValidPrimListId = primlist_data_id;
415 bool addEntry(
const PrimEdge &edge);
416 void addEntryNoDuplicateCheck(
const PrimEdge &edge);
421 SharedData(
const SharedData &that)
423 , myEdgeList(that.myEdgeList)
424 , myEdgeMap(that.myEdgeMap)
425 , myPrimEntryCount(that.myPrimEntryCount)
426 , myDataID(that.myDataID)
427 , myLastValidTopoId(that.myLastValidTopoId)
428 , myLastValidPrimListId(that.myLastValidPrimListId)
431 for (
auto it = myEdgeList.begin(); it != myEdgeList.end(); ++it)
457 if (myData->use_count() > 1)
458 myData.reset(
new SharedData(*myData));
virtual int64 getMemoryUsage(bool inclusive) const =0
GA_Size entries() const override
Returns the number of edges in this group.
GA_DataId getDataId() const
size_t operator()(const PrimEdge &key) const
bool operator==(const PrimEdge &o) const
GA_DataId getLastValidPrimListId() const
Used to pass options and map offset values during saving.
OrtDmlDeviceFilter & operator^=(OrtDmlDeviceFilter &a, OrtDmlDeviceFilter b)
static SYS_FORCE_INLINE void clearConstruct(PairType *p)
bool operator!=(const base_iterator &cmp) const
base_iterator(const base_iterator< ET, EIT > &src)
GA_DataId getLastValidTopoId() const
std::size_t SYS_HashType
Define the type for hash values.
JSON reader class which handles parsing of JSON or bJSON files.
Class which writes ASCII or binary JSON streams.
GA_EdgeT< GA_Offset, false > GA_Edge
A reference counter base class for use with UT_IntrusivePtr.
SYS_FORCE_INLINE bool GAisValid(GA_Size v)
static SYS_FORCE_INLINE void clearConstruct(PrimEdge *p)
exint GA_Size
Defines the bit width for index and offset types in GA.
virtual bool isMixed() const =0
#define GA_INVALID_OFFSET
base_iterator< const GA_Edge, EdgeList::const_iterator > const_iterator
virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const =0
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
IMATH_HOSTDEVICE constexpr int cmp(T a, T b) IMATH_NOEXCEPT
virtual bool isOrdered() const =0
auto base_iterator(std::back_insert_iterator< Container > &it, checked_ptr< typename Container::value_type >) -> std::back_insert_iterator< Container >
virtual bool jsonSaveData(UT_JSONWriter &w, const GA_SaveMap &map) const =0
Save the private group data.
const base_iterator & operator=(const base_iterator< ET, EIT > &src)
Assignment operator.
bool operator==(const base_iterator &cmp) const
UT_UniquePtr< const GA_EdgeGroup > GA_ConstEdgeGroupUPtr
OIIO_FORCEINLINE const vint4 & operator+=(vint4 &a, const vint4 &b)
void cloneDataId(const GA_EdgeGroup &src)
GA_Size entriesWithPrimitive() const
bool operator!=(const PrimEdge &o) const
SYS_HashType hash() const
The edge data we store internally.
Defragmentation of IndexMaps.
GLuint const GLchar * name
static SYS_FORCE_INLINE void clear(PairType &v)
void toggle()
Toggle the existence of all edges of the detail for this group.
void defragment(const GA_Defragment &defrag)
Interface for defragmentation.
static SYS_FORCE_INLINE bool isClear(const PairType &v)
virtual bool combine(const GA_Group *input_group)
const_iterator begin() const
OrtDmlDeviceFilter & operator&=(OrtDmlDeviceFilter &a, OrtDmlDeviceFilter b)
static SYS_FORCE_INLINE void clear(PrimEdge &v)
static SYS_FORCE_INLINE bool isClear(const PrimEdge &v)
An overload for when there's only a key.
const GA_Detail & getDetail() const override
virtual bool jsonLoadData(UT_JSONParser &p, const GA_LoadMap &map)=0
Load the private group data.
PrimEdge(const GA_Edge &e, GA_Offset prim=GA_INVALID_OFFSET)
LeafData & operator=(const LeafData &)=delete
std::pair< PrimEdge, EdgeList::iterator > PairType
bool isEmpty() const
Returns true if this edge group is empty.
std::ptrdiff_t difference_type
void setValidTopoId(GA_DataId topology_data_id)
OIIO_FORCEINLINE const vint4 & operator-=(vint4 &a, const vint4 &b)
Container class for all geometry.
GLubyte GLubyte GLubyte GLubyte w
base_iterator & operator--()
ImageBuf OIIO_API add(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
const_iterator end() const
bool OIIO_UTIL_API contains(string_view a, string_view b)
Does 'a' contain the string 'b' within it?
base_iterator< const GA_Edge, EdgeList::iterator > iterator
base_iterator & operator++()
void setValidPrimListId(GA_DataId primlist_data_id)
UT_UniquePtr< GA_EdgeGroup > GA_EdgeGroupUPtr
OrtDmlDeviceFilter & operator|=(OrtDmlDeviceFilter &a, OrtDmlDeviceFilter b)
std::bidirectional_iterator_tag iterator_category
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool