![]() |
Computer Assited Medical Intervention Tool Kit
version 3.3
|
A structural component is composed either by cell or by atoms. More...
#include <StructuralComponent.h>
Public Types | |
enum | ComposedBy { NOTHING, CELLS, ATOMS } |
What this structural component is made of. More... | |
Public Member Functions | |
void | addStructure (Structure *s, bool check=true) |
Add a Structure in the list (and tells the structure to remove this structural component from its list). More... | |
bool | addStructureIfNotIn (Structure *s) |
Add a Structure in the list, only if it is not already in (and tells the structure to remove this structural component from its list). More... | |
ComposedBy | composedBy () |
return the type of structure composing the structural component: a structural component is either a list of cells or atoms, or of nothing if it is empty (see enum ComposedBy). More... | |
virtual void | deleteAllStructures () |
this method free all the sub-components (i.e. More... | |
StructuralComponent * | getAtoms () |
Return a StructuralComponent with all the atoms of this structural component. More... | |
Cell * | getCell (unsigned int) const |
get cell by order number (not cell index) More... | |
double * | getColor () const |
Get the color. More... | |
void | getColor (double *r, double *g, double *b, double *a) const |
Get the color by its 4 componants r,g,b and a. More... | |
RenderingMode::Mode | getMode () const |
get the rendering mode More... | |
unsigned int | getNumberOfCells () const |
get the total nr of cell of the component More... | |
unsigned int | getNumberOfStructures () const |
get the number of structures More... | |
StructuralComponentProperties * | getProperties () |
get the structural component properties of this SC More... | |
StructuralComponentProperties::Color | getStructuralComponentPropertiesColor () const |
Return the color as a code (see StructuralComponentProperties::Color enum) More... | |
Structure * | getStructure (const unsigned int) const |
get a structure by its index (fisrt structure is at index 0) More... | |
Structure * | getStructureByIndex (const unsigned int) |
get a structure by its unique index More... | |
Structure * | getStructureByName (const std::string) |
get a structure by its name More... | |
bool | isCompatible (Structure *) |
return true if the given structure is compatible with what composes this structural component. More... | |
virtual bool | isInstanceOf (const char *) const |
return true only if the parameter is equal to "StructuralComponent" More... | |
bool | isStructureIn (Structure *s) |
Check if a given structure is present in the list. More... | |
virtual bool | isVisible (const RenderingMode::Mode mode) const |
tell if a specific rendering mode is visible or not More... | |
void | plannedNumberOfStructures (const unsigned int) |
optimize the I/O of the std:vector structures. More... | |
virtual void | removeStructure (Structure *s) |
Remove a structure from the list (and tells the structure to remove this structural component from its list). More... | |
void | setColor (const StructuralComponentProperties::Color c) |
Set the new color (using a StructuralComponentProperties::Color enum) More... | |
void | setColor (const double r, const double b, const double g, const double a) |
Set the new RGBA color. More... | |
void | setColor (const double r, const double b, const double g) |
Set the new RGB color. More... | |
void | setMode (const RenderingMode::Mode) |
set the rendering mode More... | |
virtual void | setPhysicalModel (PhysicalModel *) |
set the physical model (recursively to all cells or to all atoms) More... | |
virtual void | setVisible (const RenderingMode::Mode mode, const bool b) |
set the visibility of a specific rendering mode More... | |
StructuralComponent (PhysicalModel *) | |
Default Constructor. More... | |
StructuralComponent (PhysicalModel *, xmlNodePtr) | |
constructor from xml node: try to read and get the parmaters from xml More... | |
StructuralComponent (PhysicalModel *, std::string) | |
constructor that allows to name the structure. More... | |
void | xmlPrint (std::ostream &) const |
print to an output stream in "pseudo" XML format (do nothing if there are no sub structures). More... | |
virtual | ~StructuralComponent () |
delete all the structures (call the deleteAllStructures 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 | |
StructuralComponent * | atomList |
List of all the atoms of this structural component, build the first time. More... | |
std::vector< Structure * > | structures |
List of the structure representing this component, all the structure in this list are either all Atom or all Cell (no mix!) 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 structural component is composed either by cell or by atoms.
StructuralComponent::StructuralComponent | ( | PhysicalModel * | ) |
Default Constructor.
StructuralComponent::StructuralComponent | ( | PhysicalModel * | , |
xmlNodePtr | |||
) |
constructor from xml node: try to read and get the parmaters from xml
StructuralComponent::StructuralComponent | ( | PhysicalModel * | , |
std::string | |||
) |
constructor that allows to name the structure.
|
virtual |
delete all the structures (call the deleteAllStructures method)
|
inline |
Add a Structure in the list (and tells the structure to remove this structural component from its list).
s | the structure to add |
check | (default value: true) tell if the method should call isCompatible(Structure *s) before inserting s |
References Structure::addStructuralComponent(), isCompatible(), and structures.
bool StructuralComponent::addStructureIfNotIn | ( | Structure * | s | ) |
Add a Structure in the list, only if it is not already in (and tells the structure to remove this structural component from its list).
s | the structure to add |
ComposedBy StructuralComponent::composedBy | ( | ) |
return the type of structure composing the structural component: a structural component is either a list of cells or atoms, or of nothing if it is empty (see enum ComposedBy).
|
virtual |
this method free all the sub-components (i.e.
delete all the sub component and clear the list). After this methode getNumberOfSubStructures() should return 0
Reimplemented in Cell.
StructuralComponent* StructuralComponent::getAtoms | ( | ) |
Return a StructuralComponent with all the atoms of this structural component.
If this structural component is already a composed of atoms, return this. If it is composed of cells or mixed atoms and cells, return all the atoms used. Each atom is present only once in the resulting SC.
|
virtual |
get cell by order number (not cell index)
Implements Component.
double* StructuralComponent::getColor | ( | ) | const |
Get the color.
void StructuralComponent::getColor | ( | double * | r, |
double * | g, | ||
double * | b, | ||
double * | a | ||
) | const |
Get the color by its 4 componants r,g,b and a.
RenderingMode::Mode StructuralComponent::getMode | ( | ) | const |
get the rendering mode
|
virtual |
get the total nr of cell of the component
Implements Component.
|
inline |
get the number of structures
References structures.
|
inline |
get the structural component properties of this SC
References Component::properties.
StructuralComponentProperties::Color StructuralComponent::getStructuralComponentPropertiesColor | ( | ) | const |
Return the color as a code (see StructuralComponentProperties::Color enum)
|
inline |
get a structure by its index (fisrt structure is at index 0)
References structures.
Referenced by PhysicalModel::getAtom().
|
inline |
get a structure by its unique index
References structures.
|
inline |
get a structure by its name
References structures.
bool StructuralComponent::isCompatible | ( | Structure * | ) |
return true if the given structure is compatible with what composes this structural component.
E.g. if the structural is made of cell, and the structure is a cell.
Referenced by addStructure().
|
inlinevirtual |
bool StructuralComponent::isStructureIn | ( | Structure * | s | ) |
Check if a given structure is present in the list.
s | the structure to check |
|
virtual |
tell if a specific rendering mode is visible or not
Implements Component.
|
inline |
optimize the I/O of the std:vector structures.
If you know the nr of structures to be in the SC, please give it here, it will greatly speed the building of the structure
References structures.
|
inlinevirtual |
Remove a structure from the list (and tells the structure to remove this structural component from its list).
Becareful: this method DOES NOT delete the object and/or free the memory.
s | the ptr to the structure to remove |
References Structure::removeStructuralComponent(), and structures.
void StructuralComponent::setColor | ( | const StructuralComponentProperties::Color | c | ) |
Set the new color (using a StructuralComponentProperties::Color enum)
void StructuralComponent::setColor | ( | const double | r, |
const double | b, | ||
const double | g, | ||
const double | a | ||
) |
Set the new RGBA color.
void StructuralComponent::setColor | ( | const double | r, |
const double | b, | ||
const double | g | ||
) |
Set the new RGB color.
void StructuralComponent::setMode | ( | const RenderingMode::Mode | ) |
set the rendering mode
|
virtual |
set the physical model (recursively to all cells or to all atoms)
Reimplemented from Component.
|
virtual |
set the visibility of a specific rendering mode
Implements Component.
|
virtual |
print to an output stream in "pseudo" XML format (do nothing if there are no sub structures).
Implements Component.
|
protected |
List of all the atoms of this structural component, build the first time.
Return a StructuralComponent is called.
|
protected |
List of the structure representing this component, all the structure in this list are either all Atom or all Cell (no mix!)
Referenced by addStructure(), getNumberOfStructures(), getStructure(), getStructureByIndex(), getStructureByName(), plannedNumberOfStructures(), and removeStructure().