SHAPER  9.12.0
XAO::GeometricElementList Class Reference

Generic class to manipulate a list of topologic element. More...

Public Types

typedef std::map< int, GeometricElement >::iterator iterator
 Iterator on the element of the list. More...
 

Public Member Functions

 GeometricElementList ()
 Default constructor. More...
 
 GeometricElementList (int nb)
 Constructor with size. More...
 
virtual ~GeometricElementList ()
 Destructor. More...
 
int getSize () const
 Gets the size of the list. More...
 
void setSize (int nb)
 Sets the size of the list. More...
 
void setElement (int index, const std::string &name, const std::string &reference)
 Sets the name and the reference of an element. More...
 
const std::string getName (int index)
 Gets the name of an element. More...
 
void setName (int index, const std::string &name)
 Sets the name of an element. More...
 
bool hasName (int index)
 Checks if an element has a name. More...
 
const std::string getReference (int index)
 Gets the reference of an element. More...
 
void setReference (int index, const std::string &reference)
 Sets the reference of an element. More...
 
int getIndexByReference (const std::string &reference)
 Gets the index of an element using its reference. More...
 
iterator begin ()
 Gets an iterator on the first element. More...
 
iterator end ()
 Gets an iterator on the last element. More...
 

Detailed Description

Generic class to manipulate a list of topologic element.

Member Typedef Documentation

◆ iterator

Iterator on the element of the list.

Constructor & Destructor Documentation

◆ GeometricElementList() [1/2]

GeometricElementList::GeometricElementList ( )

Default constructor.

◆ GeometricElementList() [2/2]

GeometricElementList::GeometricElementList ( int  nb)

Constructor with size.

Parameters
nbthe size to set.

◆ ~GeometricElementList()

virtual XAO::GeometricElementList::~GeometricElementList ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ getSize()

int XAO::GeometricElementList::getSize ( ) const
inline

Gets the size of the list.

Returns
the size of the list.

◆ setSize()

void GeometricElementList::setSize ( int  nb)

Sets the size of the list.

Parameters
nbthe size to set.
Warning
the list will be cleared.

◆ setElement()

void GeometricElementList::setElement ( int  index,
const std::string &  name,
const std::string &  reference 
)

Sets the name and the reference of an element.

Parameters
indexthe index of the element to set.
namethe name to set.
referencethe reference to set.
Exceptions
XAO_Exceptionif index is bigger than the size of the list.

◆ getName()

const std::string GeometricElementList::getName ( int  index)

Gets the name of an element.

Parameters
indexthe index of the element to set.
Returns
the name of the element with the given index.
Exceptions
XAO_Exceptionif index is bigger than the size of the list.

◆ setName()

void GeometricElementList::setName ( int  index,
const std::string &  name 
)

Sets the name of an element.

Parameters
indexthe index of the element.
namethe name to set.
Exceptions
XAO_Exceptionif index is bigger than the size of the list.

◆ hasName()

bool GeometricElementList::hasName ( int  index)

Checks if an element has a name.

Parameters
indexthe index of the element.
Returns
true if the element has a name, false otherwise.

◆ getReference()

const std::string GeometricElementList::getReference ( int  index)

Gets the reference of an element.

Parameters
indexthe index of the element.
Returns
the reference of the element.
Exceptions
XAO_Exceptionif index is bigger than the size of the list.

◆ setReference()

void GeometricElementList::setReference ( int  index,
const std::string &  reference 
)

Sets the reference of an element.

Parameters
indexthe index of the element to set.
referencethe reference to set.
Exceptions
XAO_Exceptionif index is bigger than the size of the list.

◆ getIndexByReference()

int GeometricElementList::getIndexByReference ( const std::string &  reference)

Gets the index of an element using its reference.

Parameters
referencethe searched reference.
Returns
the index of the element or -1 if no element found.

◆ begin()

iterator XAO::GeometricElementList::begin ( )
inline

Gets an iterator on the first element.

Returns
an iterator on the first element.

◆ end()

iterator XAO::GeometricElementList::end ( )
inline

Gets an iterator on the last element.

Returns
an iterator on the last element.