![]() |
Computer Assited Medical Intervention Tool Kit
version 3.3
|
A multi-component stores other components, hence providing a way to have an tree representation of components. More...
#include <MultiComponent.h>
Public Member Functions | |
void | addSubComponent (Component *) |
void | deleteAllSubComponents () |
this method free all the sub-components (i.e. More... | |
Cell * | getCell (unsigned int) const |
get cell by order number (not cell index) More... | |
Component * | getComponentByName (const std::string) |
conveniant method to get the sub component of the name given in parameter More... | |
unsigned int | getNumberOfCells () const |
get the total nr of cell of the component More... | |
unsigned int | getNumberOfSubComponents () const |
Component * | getSubComponent (const unsigned int) const |
virtual bool | isInstanceOf (const char *) const |
return true only if the parameter is equal to "MultiComponent" More... | |
virtual bool | isVisible (const RenderingMode::Mode mode) const |
return the state of a visibility mode in all the sub component (if at least one sub component is visible for this mode, it will return true; if none are visible it will return false). More... | |
MultiComponent (PhysicalModel *) | |
Default Constructor. More... | |
MultiComponent (PhysicalModel *, std::string) | |
constructor that allows to name the structure (provides a name) More... | |
void | removeSubComponent (Component *c) |
Remove a component from the list. More... | |
virtual void | setPhysicalModel (PhysicalModel *) |
set the physical model (recursively) More... | |
virtual void | setVisible (const RenderingMode::Mode mode, const bool b) |
set the state of a visibility mode in all the sub component. More... | |
void | xmlPrint (std::ostream &) const |
print to an output stream in "pseaudo" XML format (do nothing if there are no sub components). More... | |
~MultiComponent () | |
delete all the subcomponents (call the deleteAllSubComponents method) More... | |
![]() | |
Component (PhysicalModel *, std::string n="") | |
Default constructor, a component needs to know the PM it is in. More... | |
const std::string | getName () const |
get the name of the component More... | |
PhysicalModel * | getPhysicalModel () const |
get the physical model More... | |
Properties * | getProperties () |
get the component structural properties (guarantied to be non NULL) More... | |
bool | isExclusive () const |
tell if this component is exclusive or not More... | |
void | setExclusive (const bool) |
set the exclusive flag More... | |
void | setName (const std::string) |
set the name of the component More... | |
virtual | ~Component () |
Virtual destructor needed here as this is an abstract class (pure virtual) More... | |
std::vector< MultiComponent * > | getAllParentMultiComponents () |
get the list of all the Multi Component that are using this Component More... | |
unsigned int | getNumberOfParentMultiComponents () const |
get the number of MultiComponent that are using this Component (= nr of parent component) More... | |
MultiComponent * | getParentMultiComponent (unsigned int) |
get a particular MultiComponent that is using this Component (a particular parent component) More... | |
void | addParentMultiComponent (MultiComponent *) |
add a particular parent MultiComponent in the list More... | |
void | removeParentMultiComponent (MultiComponent *) |
remove a particular parent MultiComponent More... | |
Protected Attributes | |
std::vector< Component * > | components |
List of sub component. More... | |
![]() | |
Properties * | properties |
Additional Inherited Members | |
![]() | |
void | deleteProperties () |
delete the "properties" pointer and set it to NULL More... | |
void | removeFromParents () |
this tell the parent components that this component is removed from memory. More... | |
A multi-component stores other components, hence providing a way to have an tree representation of components.
Isn't that tricky?
MultiComponent::MultiComponent | ( | PhysicalModel * | ) |
Default Constructor.
MultiComponent::MultiComponent | ( | PhysicalModel * | , |
std::string | |||
) |
constructor that allows to name the structure (provides a name)
MultiComponent::~MultiComponent | ( | ) |
delete all the subcomponents (call the deleteAllSubComponents method)
|
inline |
References Component::addParentMultiComponent(), and components.
void MultiComponent::deleteAllSubComponents | ( | ) |
this method free all the sub-components (i.e.
delete all the sub component and clear the list). After this methode getNumberOfSubComponents should return 0
|
virtual |
get cell by order number (not cell index)
Implements Component.
|
inline |
conveniant method to get the sub component of the name given in parameter
References components, and Component::isInstanceOf().
|
virtual |
get the total nr of cell of the component
Implements Component.
|
inline |
References components.
|
inline |
References components.
|
inlinevirtual |
return true only if the parameter is equal to "MultiComponent"
Implements Component.
|
virtual |
return the state of a visibility mode in all the sub component (if at least one sub component is visible for this mode, it will return true; if none are visible it will return false).
Implements Component.
|
inline |
Remove a component from the list.
Becareful: this method DOES NOT delete the object and/or free the memory. This method ask the component c to remove this multicomponent from the list of its parent component
c | the ptr to the structure to remove |
References components, and Component::removeParentMultiComponent().
|
virtual |
set the physical model (recursively)
Reimplemented from Component.
|
virtual |
set the state of a visibility mode in all the sub component.
Implements Component.
|
virtual |
print to an output stream in "pseaudo" XML format (do nothing if there are no sub components).
Implements Component.
|
protected |
List of sub component.
Referenced by addSubComponent(), getComponentByName(), getNumberOfSubComponents(), getSubComponent(), and removeSubComponent().