Version: 9.12.0
XAO::Group Class Reference

Class to represent a Geometrical Group.

#include <XAO_Group.hxx>

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...
 

Private Member Functions

void checkIndex (int element)
 Ensures that the given element is valid. More...
 

Private Attributes

std::string m_name
 The name of the group. More...
 
int m_nbElements
 The number of elements in the associated geometry. More...
 
XAO::Dimension m_dimension
 The dimension of the group. More...
 
int m_count
 The number of elements in the group. More...
 
std::set< int > m_elements
 The elements of the group. More...
 

Constructor & Destructor Documentation

◆ Group()

Group::Group ( XAO::Dimension  dim,
int  nbElements,
const std::string &  name = std::string("") 
)
Parameters
dimthe dimension of the group.
nbElementsthe number of geometrical elements for the dimension in the geometry.
namethe name of the group.

References m_count, m_dimension, m_name, m_nbElements, and XAO::WHOLE.

◆ ~Group()

Group::~Group ( )
virtual

Member Function Documentation

◆ add()

void Group::add ( int  value)
Parameters
valuethe index of the element to add.

References m_elements.

◆ begin()

std::set<int>::iterator XAO::Group::begin ( )
inline
Returns
an iterator on the first element.

◆ checkIndex()

void Group::checkIndex ( int  element)
private
Parameters
element
Exceptions
XAO_Exceptionif element is bigger than the number of elements.

References m_elements.

◆ count()

int XAO::Group::count ( ) const
inline
Returns
the number of elements.

◆ end()

std::set<int>::iterator XAO::Group::end ( )
inline
Returns
an iterator on the last element.

◆ get()

int XAO::Group::get ( int  index)
inline
Parameters
indexthe index of the element.
Returns
the reference of the element.
Note
use begin() and end() if you need to iterate.

◆ getDimension()

XAO::Dimension XAO::Group::getDimension ( )
inline
Returns
the dimension of the group.

◆ getName()

const std::string XAO::Group::getName ( )
inline
Returns
the name of the group.

◆ getNbElements()

int XAO::Group::getNbElements ( )
inline
Returns
the number of elements in the associated geometry.

◆ remove()

void Group::remove ( int  value)
Parameters
valuethe index of the element to remove.

References m_elements.

◆ setName()

void XAO::Group::setName ( const std::string &  name)
inline
Parameters
namethe name to set.

Member Data Documentation

◆ m_count

int XAO::Group::m_count
private

◆ m_dimension

XAO::Dimension XAO::Group::m_dimension
private

◆ m_elements

std::set<int> XAO::Group::m_elements
private

◆ m_name

std::string XAO::Group::m_name
private

◆ m_nbElements

int XAO::Group::m_nbElements
private

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