SHAPER  9.12.0
XAO::Group Class Reference

Class to represent a Geometrical Group. More...

Public Member Functions

 Group (XAO::Dimension dim, int nbElements, const std::string &name=std::string(""))
 Constructor. More...
 
virtual ~Group ()
 Destructor. More...
 
const std::string getName ()
 Gets the name of the group. More...
 
void setName (const std::string &name)
 Sets the name of the group. More...
 
XAO::Dimension getDimension ()
 Gets the dimension of the group. More...
 
int getNbElements ()
 Gets the numbers of elements in the geometry of the same type than the group. More...
 
int count () const
 Gets the number of elements in the group. More...
 
int get (int index)
 Gets the reference of an element. More...
 
void add (int value)
 Adds an element to the group. More...
 
void remove (int value)
 Removes an element from the group. More...
 
std::set< int >::iterator begin ()
 Gets an iterator on the first element in the group. More...
 
std::set< int >::iterator end ()
 Gets an iterator on the last element in the group. More...
 

Detailed Description

Class to represent a Geometrical Group.

Constructor & Destructor Documentation

◆ Group()

Group::Group ( XAO::Dimension  dim,
int  nbElements,
const std::string &  name = std::string("") 
)

Constructor.

Parameters
dimthe dimension of the group.
nbElementsthe number of geometrical elements for the dimension in the geometry.
namethe name of the group.

◆ ~Group()

Group::~Group ( )
virtual

Destructor.

Member Function Documentation

◆ getName()

const std::string XAO::Group::getName ( )
inline

Gets the name of the group.

Returns
the name of the group.

◆ setName()

void XAO::Group::setName ( const std::string &  name)
inline

Sets the name of the group.

Parameters
namethe name to set.

◆ getDimension()

XAO::Dimension XAO::Group::getDimension ( )
inline

Gets the dimension of the group.

Returns
the dimension of the group.

◆ getNbElements()

int XAO::Group::getNbElements ( )
inline

Gets the numbers of elements in the geometry of the same type than the group.

Returns
the number of elements in the associated geometry.

◆ count()

int XAO::Group::count ( ) const
inline

Gets the number of elements in the group.

Returns
the number of elements.

◆ get()

int XAO::Group::get ( int  index)
inline

Gets the reference of an element.

Parameters
indexthe index of the element.
Returns
the reference of the element.
Note
use begin() and end() if you need to iterate.

◆ add()

void Group::add ( int  value)

Adds an element to the group.

Parameters
valuethe index of the element to add.

◆ remove()

void Group::remove ( int  value)

Removes an element from the group.

Parameters
valuethe index of the element to remove.

◆ begin()

std::set<int>::iterator XAO::Group::begin ( )
inline

Gets an iterator on the first element in the group.

Returns
an iterator on the first element.

◆ end()

std::set<int>::iterator XAO::Group::end ( )
inline

Gets an iterator on the last element in the group.

Returns
an iterator on the last element.