HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_EdgeGroup Class Reference

#include <GA_EdgeGroup.h>

+ Inheritance diagram for GA_EdgeGroup:

Classes

class  base_iterator
 
class  PrimEdge
 The edge data we store internally. More...
 

Public Types

typedef base_iterator< const
GA_Edge, EdgeList::iterator > 
iterator
 
typedef base_iterator< const
GA_Edge,
EdgeList::const_iterator > 
const_iterator
 

Public Member Functions

 GA_EdgeGroup (const GA_Detail &gdp, const char *name="")
 Default constructor. More...
 
 ~GA_EdgeGroup () override
 
const GA_DetailgetDetail () const override
 
int64 getMemoryUsage (bool inclusive) const override
 Report memory usage. More...
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
void countMemory (UT_MemoryCounter &counter, bool inclusive) const override
 
void toggle ()
 Toggle the existence of all edges of the detail for this group. More...
 
void toggleEntries ()
 
iterator remove (iterator it)
 
GA_Size entries () const override
 Returns the number of edges in this group. More...
 
bool isEmpty () const
 Returns true if this edge group is empty. More...
 
void clear () override
 Remove all edges from this group. More...
 
void addAll () override
 Add all edges from the associated detail into this edge group. More...
 
bool isOrdered () const override
 
bool isMixed () const override
 
GA_Size entriesWithPrimitive () const
 
bool combine (const GA_Group *input_group) override
 
bool jsonSaveData (UT_JSONWriter &w, const GA_SaveMap &m) const override
 
bool jsonLoadData (UT_JSONParser &w, const GA_LoadMap &m) override
 Load the private JSON data. More...
 
GA_EdgeGroupoperator|= (const GA_EdgeGroup &input_group)
 Combinatorial operatos. More...
 
GA_EdgeGroupoperator&= (const GA_EdgeGroup &input_group)
 
GA_EdgeGroupoperator-= (const GA_EdgeGroup &input_group)
 
GA_EdgeGroupoperator+= (const GA_EdgeGroup &input_group)
 
GA_EdgeGroupoperator^= (const GA_EdgeGroup &input_group)
 
GA_EdgeGroupoperator= (const GA_EdgeGroup &input_group)
 
GA_DataId getDataId () const
 
void bumpDataId ()
 
void cloneDataId (const GA_EdgeGroup &src)
 
void makeAllEdgesValid ()
 
GA_DataId getLastValidTopoId () const
 
void setValidTopoId (GA_DataId topology_data_id)
 
GA_DataId getLastValidPrimListId () const
 
void setValidPrimListId (GA_DataId primlist_data_id)
 
void defragment (const GA_Defragment &defrag)
 Interface for defragmentation. More...
 
const_iterator find (const GA_Edge &edge, GA_Offset primoff=GA_INVALID_OFFSET) const
 
const_iterator find (const GA_Edge &edge, const GA_Primitive *prim) const
 
iterator find (const GA_Edge &edge, GA_Offset primoff=GA_INVALID_OFFSET)
 
iterator find (const GA_Edge &edge, const GA_Primitive *prim)
 
bool contains (const GA_Edge &edge, GA_Offset primoff=GA_INVALID_OFFSET) const
 
bool contains (const GA_Edge &edge, const GA_Primitive *prim) const
 
bool add (const GA_Edge &edge, GA_Offset primoff=GA_INVALID_OFFSET)
 
bool add (GA_Offset p0, GA_Offset p1, GA_Offset primoff=GA_INVALID_OFFSET)
 
bool add (const GA_Edge &edge, const GA_Primitive *prim)
 
bool add (GA_Offset p0, GA_Offset p1, const GA_Primitive *prim)
 
bool toggle (const GA_Edge &edge, GA_Offset primoff=GA_INVALID_OFFSET)
 
bool toggle (const GA_Edge &edge, const GA_Primitive *prim)
 
bool remove (const GA_Edge &edge, GA_Offset primoff=GA_INVALID_OFFSET)
 
bool remove (const GA_Edge &edge, const GA_Primitive *prim)
 
- Public Member Functions inherited from GA_Group
virtual ~GA_Group ()
 
const UT_StringHoldergetName () const
 
bool isInternal () const
 
bool getInternal () const
 
void setInternal (bool on_off)
 
bool isDetached () const
 
GA_GroupType classType () const
 
GA_GroupMaskType classMaskType () const
 
bool isElementGroup () const
 
SYS_FORCE_INLINE bool isEmpty () const
 
void clearEntries ()
 
virtual bool stat (UT_WorkBuffer &info, uint level) const
 
virtual bool jsonShouldSave (const GA_SaveMap &map) const
 
bool jsonSaveDefinition (UT_JSONWriter &w, const char *type) const
 
void dump (std::ostream &os)
 A convenience function to do a JSON dump of the group contents. More...
 

Friends

class GA_EdgeGroupTable
 

Additional Inherited Members

- Static Public Member Functions inherited from GA_Group
static const char * groupType (GA_GroupType type)
 
static GA_GroupType groupType (const char *type)
 
static bool jsonLoadDefinition (UT_JSONParser &p, UT_WorkBuffer &type, UT_WorkBuffer &name, bool &internal)
 Load the GA_Group-Definition. More...
 
- Protected Member Functions inherited from GA_Group
 GA_Group (const UT_StringHolder &name, bool internal, GA_GroupType type, bool detached)
 
virtual bool setName (const UT_StringHolder &n)
 

Detailed Description

Definition at line 42 of file GA_EdgeGroup.h.

Member Typedef Documentation

typedef base_iterator<const GA_Edge, EdgeList::const_iterator> GA_EdgeGroup::const_iterator

Definition at line 196 of file GA_EdgeGroup.h.

typedef base_iterator<const GA_Edge, EdgeList::iterator> GA_EdgeGroup::iterator

Definition at line 195 of file GA_EdgeGroup.h.

Constructor & Destructor Documentation

GA_EdgeGroup::GA_EdgeGroup ( const GA_Detail gdp,
const char *  name = "" 
)

Default constructor.

GA_EdgeGroup::~GA_EdgeGroup ( )
override

Member Function Documentation

bool GA_EdgeGroup::add ( const GA_Edge edge,
GA_Offset  primoff = GA_INVALID_OFFSET 
)

Add an edge to this group. Returns true if the edge was added, and false if the edge already existed.

bool GA_EdgeGroup::add ( GA_Offset  p0,
GA_Offset  p1,
GA_Offset  primoff = GA_INVALID_OFFSET 
)

Add an edge to this group. Returns true if the edge was added, and false if the edge already existed.

bool GA_EdgeGroup::add ( const GA_Edge edge,
const GA_Primitive prim 
)

Add an edge to this group. Returns true if the edge was added, and false if the edge already existed.

bool GA_EdgeGroup::add ( GA_Offset  p0,
GA_Offset  p1,
const GA_Primitive prim 
)

Add an edge to this group. Returns true if the edge was added, and false if the edge already existed.

void GA_EdgeGroup::addAll ( )
overridevirtual

Add all edges from the associated detail into this edge group.

Implements GA_Group.

iterator GA_EdgeGroup::begin ( void  )
inline

Returns an iterator pointing at the beginning of the list of edges of this edge group.

Definition at line 210 of file GA_EdgeGroup.h.

const_iterator GA_EdgeGroup::begin ( void  ) const
inline

Definition at line 223 of file GA_EdgeGroup.h.

void GA_EdgeGroup::bumpDataId ( )
void GA_EdgeGroup::clear ( )
overridevirtual

Remove all edges from this group.

Implements GA_Group.

void GA_EdgeGroup::cloneDataId ( const GA_EdgeGroup src)
bool GA_EdgeGroup::combine ( const GA_Group input_group)
overridevirtual

Combine another group with this edge group. Currently, only edge groups are supported. Returns true if the other group was combined with this one.

Reimplemented from GA_Group.

bool GA_EdgeGroup::contains ( const GA_Edge edge,
GA_Offset  primoff = GA_INVALID_OFFSET 
) const

Returns true if an edge exists in this group, matching the input data.

bool GA_EdgeGroup::contains ( const GA_Edge edge,
const GA_Primitive prim 
) const

Returns true if an edge exists in this group, matching the input data.

void GA_EdgeGroup::countMemory ( UT_MemoryCounter counter,
bool  inclusive 
) const
overridevirtual

Count memory usage using a UT_MemoryCounter in order to count shared memory correctly. If inclusive is true, the size of this object is counted, else only memory owned by this object is counted. If this is pointed to by the calling object, inclusive should be true. If this is contained in the calling object, inclusive should be false. (Its memory was already counted in the size of the calling object.)

Implements GA_Group.

void GA_EdgeGroup::defragment ( const GA_Defragment defrag)

Interface for defragmentation.

iterator GA_EdgeGroup::end ( void  )
inline

Returns an iterator pointing at the beginning of the list of edges of this edge group.

Definition at line 220 of file GA_EdgeGroup.h.

const_iterator GA_EdgeGroup::end ( void  ) const
inline

Definition at line 226 of file GA_EdgeGroup.h.

GA_Size GA_EdgeGroup::entries ( ) const
inlineoverridevirtual

Returns the number of edges in this group.

Implements GA_Group.

Definition at line 309 of file GA_EdgeGroup.h.

GA_Size GA_EdgeGroup::entriesWithPrimitive ( ) const
inline

Definition at line 328 of file GA_EdgeGroup.h.

const_iterator GA_EdgeGroup::find ( const GA_Edge edge,
GA_Offset  primoff = GA_INVALID_OFFSET 
) const

Search for an edge matching the input. If the edge was found, it returns an iterator pointing at the edge in the list. Otherwise returns the end iterator.

const_iterator GA_EdgeGroup::find ( const GA_Edge edge,
const GA_Primitive prim 
) const

Search for an edge matching the input. If the edge was found, it returns an iterator pointing at the edge in the list. Otherwise returns the end iterator.

iterator GA_EdgeGroup::find ( const GA_Edge edge,
GA_Offset  primoff = GA_INVALID_OFFSET 
)

Search for an edge matching the input. If the edge was found, it returns an iterator pointing at the edge in the list. Otherwise returns the end iterator.

iterator GA_EdgeGroup::find ( const GA_Edge edge,
const GA_Primitive prim 
)

Search for an edge matching the input. If the edge was found, it returns an iterator pointing at the edge in the list. Otherwise returns the end iterator.

GA_DataId GA_EdgeGroup::getDataId ( ) const
inline

Definition at line 376 of file GA_EdgeGroup.h.

const GA_Detail& GA_EdgeGroup::getDetail ( ) const
inlineoverridevirtual

Implements GA_Group.

Definition at line 203 of file GA_EdgeGroup.h.

GA_DataId GA_EdgeGroup::getLastValidPrimListId ( ) const
inline

Definition at line 402 of file GA_EdgeGroup.h.

GA_DataId GA_EdgeGroup::getLastValidTopoId ( ) const
inline

Definition at line 393 of file GA_EdgeGroup.h.

int64 GA_EdgeGroup::getMemoryUsage ( bool  inclusive) const
overridevirtual

Report memory usage.

Implements GA_Group.

bool GA_EdgeGroup::isEmpty ( ) const
inline

Returns true if this edge group is empty.

Definition at line 312 of file GA_EdgeGroup.h.

bool GA_EdgeGroup::isMixed ( ) const
overridevirtual

Returns a boolean indicating whether this group is mixed. Edge groups are never mixed, so this function always returns false.

Implements GA_Group.

bool GA_EdgeGroup::isOrdered ( ) const
overridevirtual

Returns a boolean indicating whether this group is ordered or not. Edge groups are always ordered.

Implements GA_Group.

bool GA_EdgeGroup::jsonLoadData ( UT_JSONParser w,
const GA_LoadMap m 
)
overridevirtual

Load the private JSON data.

Implements GA_Group.

bool GA_EdgeGroup::jsonSaveData ( UT_JSONWriter w,
const GA_SaveMap m 
) const
overridevirtual

Save data to a JSON stream.

JSON Schema: GA_EdgeGroup

Private data for an edge group

"name" : "GA_EdgeGroup",
"description" : "Private data for edge groups",
"type" : "orderedmap",
"properties": {
"points": {
"type" : "array",
"items" : "integer",
"description" :
"Flat array of points, 2 points per edge. The points
are stored in interleaved pairs representing the
start/end points of each edge.",
}
"primitives": {
"type" : "array",
"items" : "integer",
"description" : "Primitives tied to the edge. May be -1.",
"optional" : true,
}
},
See Also
JSON_FileFormat, GA_GroupTable

Implements GA_Group.

void GA_EdgeGroup::makeAllEdgesValid ( )

NOTE: You don't need to call this for groups in a SOP's output detail, because it will call GA_EdgeGroupTable::makeAllEdgesValid(), which can be more efficient than calling this for each edge group, (if there are multiple). This also won't do anything if the max of the topology data ID and the primitive list data ID is equal to myLastValidTopoId, so you have to make sure that any necessary bumping has occurred. This was added for use by GU_EdgeSelection::validateEdges().

GA_EdgeGroup& GA_EdgeGroup::operator&= ( const GA_EdgeGroup input_group)
GA_EdgeGroup& GA_EdgeGroup::operator+= ( const GA_EdgeGroup input_group)
GA_EdgeGroup& GA_EdgeGroup::operator-= ( const GA_EdgeGroup input_group)
GA_EdgeGroup& GA_EdgeGroup::operator= ( const GA_EdgeGroup input_group)
GA_EdgeGroup& GA_EdgeGroup::operator^= ( const GA_EdgeGroup input_group)
GA_EdgeGroup& GA_EdgeGroup::operator|= ( const GA_EdgeGroup input_group)

Combinatorial operatos.

iterator GA_EdgeGroup::remove ( iterator  it)

Remove the edge pointed to by the iterator, and return an iterator pointing to the next edge in the group.

bool GA_EdgeGroup::remove ( const GA_Edge edge,
GA_Offset  primoff = GA_INVALID_OFFSET 
)

Remove the entry corresponding with the given edge and the optional primitive. Returns true if an edge was deleted based on the search data.

bool GA_EdgeGroup::remove ( const GA_Edge edge,
const GA_Primitive prim 
)

Remove the entry corresponding with the given edge and the optional primitive. Returns true if an edge was deleted based on the search data.

void GA_EdgeGroup::setValidPrimListId ( GA_DataId  primlist_data_id)
inline

Definition at line 406 of file GA_EdgeGroup.h.

void GA_EdgeGroup::setValidTopoId ( GA_DataId  topology_data_id)
inline

Definition at line 397 of file GA_EdgeGroup.h.

void GA_EdgeGroup::toggle ( )

Toggle the existence of all edges of the detail for this group.

bool GA_EdgeGroup::toggle ( const GA_Edge edge,
GA_Offset  primoff = GA_INVALID_OFFSET 
)

Toggles the existence of a given edge in the group. If the edge got removed, then this function returns false, if it got added, however, true is returned.

bool GA_EdgeGroup::toggle ( const GA_Edge edge,
const GA_Primitive prim 
)

Toggles the existence of a given edge in the group. If the edge got removed, then this function returns false, if it got added, however, true is returned.

void GA_EdgeGroup::toggleEntries ( )
inline

Definition at line 282 of file GA_EdgeGroup.h.

Friends And Related Function Documentation

friend class GA_EdgeGroupTable
friend

Definition at line 46 of file GA_EdgeGroup.h.


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