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

A set of element indices in a GT_Primitive, e.g. points / faces / tets. More...

#include <GT_ElementSet.h>

+ Inheritance diagram for GT_ElementSet:

Classes

class  SetType
 

Public Member Functions

 GT_ElementSet ()=default
 
 GT_ElementSet (const GT_DataArrayHandle &members)
 
 ~GT_ElementSet ()
 
 UT_NON_COPYABLE (GT_ElementSet)
 
bool contains (GT_Offset element) const
 Test whether an element is in the set. More...
 
void addElement (GT_Offset element)
 Add an element to the set. More...
 
void removeElement (GT_Offset element)
 Remove an element from the set. More...
 
GT_DataArrayHandle extractMembers () const
 Extract the member list as a sorted array of integers. More...
 
bool save (UT_JSONWriter &w) const
 Save sets to a JSON stream. More...
 
SetType::const_iterator begin () const
 
SetType::const_iterator end () const
 
bool anyIntersect (const UT_Set< int > &elements) const
 
GT_ElementSetPtr deleteElements (const UT_Set< int > &elements, const GT_Int32Array &mapping) const
 
void addFace (GT_Offset face_index)
 Add a face to the set. More...
 
void removeFace (GT_Offset face_index)
 Remove a face from the set. More...
 
GT_ElementSetPtr deleteFaces (const UT_Set< int > &faces, const GT_Int32Array &mapping) const
 
GT_Size entries () const
 
GT_Size size () const
 
exint getMemoryUsage () const
 
void addElements (const int32 *indices, exint count)
 
void addElements (const int64 *indices, exint count)
 
void addFaces (const int32 *indices, exint count)
 
void addFaces (const int64 *indices, exint count)
 
- Public Member Functions inherited from UT_IntrusiveRefCounter< GT_ElementSet >
SYS_FORCE_INLINE UT_IntrusiveRefCounter () noexcept
 Default constructor: Sets counter to 0. More...
 
SYS_FORCE_INLINE UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &) noexcept
 Copy constructor: Sets counter to 0. More...
 
UT_IntrusiveRefCounteroperator= (const UT_IntrusiveRefCounter &) noexcept
 Assignment operator: Does not modify counter. More...
 
SYS_FORCE_INLINE uint32 use_count () const noexcept
 Return current counter. More...
 
SYS_FORCE_INLINE bool conditionalAddRef () noexcept
 

Protected Attributes

SetType myMembers
 
bool my64bit = false
 

Additional Inherited Members

- Protected Member Functions inherited from UT_IntrusiveRefCounter< GT_ElementSet >
SYS_FORCE_INLINE ~UT_IntrusiveRefCounter ()
 Destructor: Only derived classes can destruct this. More...
 

Detailed Description

A set of element indices in a GT_Primitive, e.g. points / faces / tets.

Definition at line 30 of file GT_ElementSet.h.

Constructor & Destructor Documentation

GT_ElementSet::GT_ElementSet ( )
default
GT_ElementSet::GT_ElementSet ( const GT_DataArrayHandle members)
GT_ElementSet::~GT_ElementSet ( )

Member Function Documentation

void GT_ElementSet::addElement ( GT_Offset  element)

Add an element to the set.

void GT_ElementSet::addElements ( const int32 indices,
exint  count 
)

Add a list of elements

void GT_ElementSet::addElements ( const int64 indices,
exint  count 
)

Add a list of elements

void GT_ElementSet::addFace ( GT_Offset  face_index)
inline

Add a face to the set.

Definition at line 186 of file GT_ElementSet.h.

void GT_ElementSet::addFaces ( const int32 indices,
exint  count 
)
inline

Add a list of faces

Definition at line 192 of file GT_ElementSet.h.

void GT_ElementSet::addFaces ( const int64 indices,
exint  count 
)
inline

Add a list of faces

Definition at line 195 of file GT_ElementSet.h.

bool GT_ElementSet::anyIntersect ( const UT_Set< int > &  elements) const

Check whether any of the elements in this set are in the list of elements to be deleted.

SetType::const_iterator GT_ElementSet::begin ( void  ) const
inline

Definition at line 168 of file GT_ElementSet.h.

bool GT_ElementSet::contains ( GT_Offset  element) const
inline

Test whether an element is in the set.

Definition at line 147 of file GT_ElementSet.h.

GT_ElementSetPtr GT_ElementSet::deleteElements ( const UT_Set< int > &  elements,
const GT_Int32Array mapping 
) const

Delete elements from the set. The second argument is an array mapping the old element numbers to the new element numbers. For example, deleting polygon 2 from a set of [0,1,2,3] would expect a remapping array of [0,1,x,2] (the value of 2 doesn't actually matter)

GT_ElementSetPtr GT_ElementSet::deleteFaces ( const UT_Set< int > &  faces,
const GT_Int32Array mapping 
) const
inline

Delete polygons from the face set. The second argument is an array mapping the old face numbers to the new face numbers. For example, deleting polygon 2 from a set of [0,1,2,3] would expect a remapping array of [0,1,x,2] (the value of 2 doesn't actually matter)

Definition at line 209 of file GT_ElementSet.h.

SetType::const_iterator GT_ElementSet::end ( void  ) const
inline

Definition at line 169 of file GT_ElementSet.h.

GT_Size GT_ElementSet::entries ( ) const
inline

Number of elements in the set

Definition at line 141 of file GT_ElementSet.h.

GT_DataArrayHandle GT_ElementSet::extractMembers ( ) const

Extract the member list as a sorted array of integers.

exint GT_ElementSet::getMemoryUsage ( ) const

Number of elements in the set

void GT_ElementSet::removeElement ( GT_Offset  element)

Remove an element from the set.

void GT_ElementSet::removeFace ( GT_Offset  face_index)
inline

Remove a face from the set.

Definition at line 201 of file GT_ElementSet.h.

bool GT_ElementSet::save ( UT_JSONWriter w) const

Save sets to a JSON stream.

GT_Size GT_ElementSet::size ( void  ) const
inline

Number of elements in the set

Definition at line 142 of file GT_ElementSet.h.

GT_ElementSet::UT_NON_COPYABLE ( GT_ElementSet  )

Member Data Documentation

bool GT_ElementSet::my64bit = false
protected

Definition at line 215 of file GT_ElementSet.h.

SetType GT_ElementSet::myMembers
protected

Definition at line 214 of file GT_ElementSet.h.


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