14 #ifndef __GA_EdgeGroup_h__
15 #define __GA_EdgeGroup_h__
73 SYShashCombine(hash, myPrim);
87 using EdgeList = std::list<PrimEdge>;
91 template<
typename T,
typename IT>
93 :
public std::iterator<std::bidirectional_iterator_tag, T>
98 template<
typename ET,
typename EIT>
101 myCurrent = src.myCurrent;
106 template<
typename ET,
typename EIT>
109 myCurrent = src.myCurrent;
117 {
return myCurrent == cmp.myCurrent; }
122 {
return myCurrent != cmp.myCurrent; }
127 { ++myCurrent;
return *
this; }
132 { --myCurrent;
return *
this; }
135 {
return myCurrent == myEnd; }
151 : myCurrent(current), myEnd(end) {}
163 const char *
name=
"");
178 return iterator(myData->myEdgeList.begin(), myData->myEdgeList.end());
184 {
return iterator(myData->myEdgeList.end(), myData->myEdgeList.end()); }
187 {
return const_iterator(myData->myEdgeList.begin(), myData->myEdgeList.end()); }
190 {
return const_iterator(myData->myEdgeList.end(), myData->myEdgeList.end()); }
265 bool remove(
const GA_Edge &edge,
267 bool remove(
const GA_Edge &edge,
275 bool isEmpty()
const {
return myData->myEdgeList.empty(); }
278 virtual void clear();
292 {
return myData->myPrimEntryCount; }
341 return myData->myDataID;
358 return myData->myLastValidTopoId;
362 harden()->myLastValidTopoId = topology_data_id;
367 return myData->myLastValidPrimListId;
371 harden()->myLastValidPrimListId = primlist_data_id;
375 bool addEntry(
const PrimEdge &edge);
376 void addEntryNoDuplicateCheck(
const PrimEdge &edge);
381 SharedData(
const SharedData &that)
383 , myEdgeList(that.myEdgeList)
384 , myEdgeMap(that.myEdgeMap)
385 , myPrimEntryCount(that.myPrimEntryCount)
386 , myDataID(that.myDataID)
387 , myLastValidTopoId(that.myLastValidTopoId)
388 , myLastValidPrimListId(that.myLastValidPrimListId)
391 for (
auto it = myEdgeList.begin(); it != myEdgeList.end(); ++it)
406 int64 myLastValidTopoId;
412 int64 myLastValidPrimListId;
417 if (myData->use_count() > 1)
418 myData.reset(
new SharedData(*myData));
virtual int64 getMemoryUsage(bool inclusive) const =0
int64 getLastValidTopoId() const
size_t operator()(const PrimEdge &key) const
bool operator==(const PrimEdge &o) const
Used to pass options and map offset values during saving.
void setValidPrimListId(int64 primlist_data_id)
bool operator!=(const base_iterator &cmp) const
base_iterator(const base_iterator< ET, EIT > &src)
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.
void setValidTopoId(int64 topology_data_id)
virtual bool combine(const GA_Group *inputGroup)
A reference counter base class for use with UT_IntrusivePtr.
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
virtual bool isOrdered() const =0
GA_EdgeGroup & operator=(const GA_EdgeGroup &inputGroup)
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
GA_EdgeGroup & operator-=(const GA_EdgeGroup &inputGroup)
void cloneDataId(const GA_EdgeGroup &src)
virtual GA_Size entries() const
Returns the number of edges in this group.
GA_EdgeGroup & operator|=(const GA_EdgeGroup &inputGroup)
Combinatorial operatos.
GA_Size entriesWithPrimitive() const
bool operator!=(const PrimEdge &o) const
SYS_HashType hash() const
GA_EdgeGroup & operator&=(const GA_EdgeGroup &inputGroup)
PrimEdge(const PrimEdge &e)
The edge data we store internally.
bool contains(const GA_Edge &edge, GA_Offset primoff=GA_INVALID_OFFSET) const
GLuint const GLchar * name
void toggle()
Toggle the existence of all edges of the detail for this group.
GA_EdgeGroup & operator^=(const GA_EdgeGroup &inputGroup)
const_iterator begin() const
const_iterator find(const GA_Edge &edge, GA_Offset primoff=GA_INVALID_OFFSET) const
virtual bool jsonLoadData(UT_JSONParser &p, const GA_LoadMap &map)=0
Load the private group data.
int64 getLastValidPrimListId() const
PrimEdge(const GA_Edge &e, GA_Offset prim=GA_INVALID_OFFSET)
bool isEmpty() const
Returns true if this edge group is empty.
bool add(const GA_Edge &edge, GA_Offset primoff=GA_INVALID_OFFSET)
Container class for all geometry.
GA_EdgeGroup & operator+=(const GA_EdgeGroup &inputGroup)
GLubyte GLubyte GLubyte GLubyte w
base_iterator & operator--()
const_iterator end() const
base_iterator< const GA_Edge, EdgeList::iterator > iterator
base_iterator & operator++()
virtual const GA_Detail & getDetail() const