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...
 
virtual ~GA_EdgeGroup ()
 
virtual const GA_DetailgetDetail () const
 
virtual int64 getMemoryUsage (bool inclusive) const
 Report memory usage. More...
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
virtual void countMemory (UT_MemoryCounter &counter, bool inclusive) const
 
void toggle ()
 Toggle the existence of all edges of the detail for this group. More...
 
void toggleEntries ()
 
iterator remove (iterator it)
 
virtual GA_Size entries () const
 Returns the number of edges in this group. More...
 
bool isEmpty () const
 Returns true if this edge group is empty. More...
 
virtual void clear ()
 Remove all edges from this group. More...
 
virtual void addAll ()
 Add all edges from the associated detail into this edge group. More...
 
virtual bool isOrdered () const
 
virtual bool isMixed () const
 
GA_Size entriesWithPrimitive () const
 
virtual bool combine (const GA_Group *inputGroup)
 
virtual bool jsonSaveData (UT_JSONWriter &w, const GA_SaveMap &m) const
 
virtual bool jsonLoadData (UT_JSONParser &w, const GA_LoadMap &m)
 Load the private JSON data. More...
 
GA_EdgeGroupoperator|= (const GA_EdgeGroup &inputGroup)
 Combinatorial operatos. More...
 
GA_EdgeGroupoperator&= (const GA_EdgeGroup &inputGroup)
 
GA_EdgeGroupoperator-= (const GA_EdgeGroup &inputGroup)
 
GA_EdgeGroupoperator+= (const GA_EdgeGroup &inputGroup)
 
GA_EdgeGroupoperator^= (const GA_EdgeGroup &inputGroup)
 
GA_EdgeGroupoperator= (const GA_EdgeGroup &inputGroup)
 
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)
 
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 onOff)
 
bool isDetached () const
 
GA_GroupType classType (void) 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 40 of file GA_EdgeGroup.h.

Member Typedef Documentation

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

Definition at line 193 of file GA_EdgeGroup.h.

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

Definition at line 192 of file GA_EdgeGroup.h.

Constructor & Destructor Documentation

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

Default constructor.

virtual GA_EdgeGroup::~GA_EdgeGroup ( )
virtual

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.

virtual void GA_EdgeGroup::addAll ( )
virtual

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 207 of file GA_EdgeGroup.h.

const_iterator GA_EdgeGroup::begin ( void  ) const
inline

Definition at line 220 of file GA_EdgeGroup.h.

void GA_EdgeGroup::bumpDataId ( )
virtual void GA_EdgeGroup::clear ( )
virtual

Remove all edges from this group.

Implements GA_Group.

void GA_EdgeGroup::cloneDataId ( const GA_EdgeGroup src)
virtual bool GA_EdgeGroup::combine ( const GA_Group inputGroup)
virtual

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.

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

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.

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 217 of file GA_EdgeGroup.h.

const_iterator GA_EdgeGroup::end ( void  ) const
inline

Definition at line 223 of file GA_EdgeGroup.h.

virtual GA_Size GA_EdgeGroup::entries ( ) const
inlinevirtual

Returns the number of edges in this group.

Implements GA_Group.

Definition at line 306 of file GA_EdgeGroup.h.

GA_Size GA_EdgeGroup::entriesWithPrimitive ( ) const
inline

Definition at line 325 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 373 of file GA_EdgeGroup.h.

virtual const GA_Detail& GA_EdgeGroup::getDetail ( ) const
inlinevirtual

Implements GA_Group.

Definition at line 200 of file GA_EdgeGroup.h.

GA_DataId GA_EdgeGroup::getLastValidPrimListId ( ) const
inline

Definition at line 399 of file GA_EdgeGroup.h.

GA_DataId GA_EdgeGroup::getLastValidTopoId ( ) const
inline

Definition at line 390 of file GA_EdgeGroup.h.

virtual int64 GA_EdgeGroup::getMemoryUsage ( bool  inclusive) const
virtual

Report memory usage.

Implements GA_Group.

bool GA_EdgeGroup::isEmpty ( ) const
inline

Returns true if this edge group is empty.

Definition at line 309 of file GA_EdgeGroup.h.

virtual bool GA_EdgeGroup::isMixed ( ) const
virtual

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

Implements GA_Group.

virtual bool GA_EdgeGroup::isOrdered ( ) const
virtual

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

Implements GA_Group.

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

Load the private JSON data.

Implements GA_Group.

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

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 inputGroup)
GA_EdgeGroup& GA_EdgeGroup::operator+= ( const GA_EdgeGroup inputGroup)
GA_EdgeGroup& GA_EdgeGroup::operator-= ( const GA_EdgeGroup inputGroup)
GA_EdgeGroup& GA_EdgeGroup::operator= ( const GA_EdgeGroup inputGroup)
GA_EdgeGroup& GA_EdgeGroup::operator^= ( const GA_EdgeGroup inputGroup)
GA_EdgeGroup& GA_EdgeGroup::operator|= ( const GA_EdgeGroup inputGroup)

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 403 of file GA_EdgeGroup.h.

void GA_EdgeGroup::setValidTopoId ( GA_DataId  topology_data_id)
inline

Definition at line 394 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 279 of file GA_EdgeGroup.h.

Friends And Related Function Documentation

friend class GA_EdgeGroupTable
friend

Definition at line 44 of file GA_EdgeGroup.h.


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