|
Computer Assited Medical Intervention Tool Kit
version 5.0
|
|
Go to the documentation of this file.
26 #ifndef STRUCTURALCOMPONENT_H
27 #define STRUCTURALCOMPONENT_H
126 void xmlPrint(std::ostream&)
const override;
150 void setColor(
const double r,
const double b,
const double g,
const double a);
152 void setColor(
const double r,
const double b,
const double g);
158 void getColor(
double* r,
double* g,
double* b,
double*
a)
const;
230 while (it !=
structures.end() && (*it)->getIndex() != i) {
242 while (it !=
structures.end() && (*it)->getName() != n) {
267 return (std::string(className) == std::string(
"StructuralComponent"));
278 #endif //STRUCTURALCOMPONENT_H
bool isCompatible(Structure *)
return true if the given structure is compatible with what composes this structural component.
Definition: StructuralComponent.cpp:310
ComposedBy
What this structural component is made of.
Definition: StructuralComponent.h:173
unsigned int getNumberOfStructures() const
get the number of structures
Definition: StructuralComponent.h:252
virtual bool isInstanceOf(const char *) const =0
pure virtual method, implemented in the child-class
bool isInstanceOf(const char *) const override
return true only if the parameter is equal to "StructuralComponent"
Definition: StructuralComponent.h:266
~StructuralComponent() override
delete all the structures (call the deleteAllStructures method)
Definition: StructuralComponent.cpp:73
void removeFromParents()
this tell the parent components that this component is removed from memory.
Definition: modeling/libraries/pml/Component.cpp:48
bool isStructureIn(Structure *s)
Check if a given structure is present in the list.
Definition: StructuralComponent.cpp:239
Properties * properties
Definition: modeling/libraries/pml/Component.h:118
Structure * getStructureByName(const std::string)
get a structure by its name
Definition: StructuralComponent.h:240
virtual void deleteAllStructures()
this method free all the sub-components (i.e.
Definition: StructuralComponent.cpp:89
void setColor(const StructuralComponentProperties::Color c)
Set the new color (using a StructuralComponentProperties::Color enum)
Definition: StructuralComponent.cpp:105
void deleteProperties()
delete the "properties" pointer and set it to NULL
Definition: modeling/libraries/pml/Component.cpp:42
void setVisible(const RenderingMode::Mode mode, const bool b) override
set the visibility of a specific rendering mode
Definition: StructuralComponent.cpp:149
A structural component is composed either by cell or by atoms.
Definition: StructuralComponent.h:52
StructuralComponentProperties::Color getStructuralComponentPropertiesColor() const
Return the color as a code (see StructuralComponentProperties::Color enum)
Definition: StructuralComponent.cpp:128
virtual void removeStructure(Structure *s)
Remove a structure from the list (and tells the structure to remove this structural component from it...
Definition: StructuralComponent.h:255
Pure virtual class that represent an element of the structure. This implies that every structure coul...
Definition: Structure.h:43
void addStructure(Structure *s, bool check=true)
Add a Structure in the list (and tells the structure to add this structural component in its list).
Definition: StructuralComponent.h:212
A class that manages the structural component properties.
Definition: StructuralComponentProperties.h:44
StructuralComponent(PhysicalModel *)
Default Constructor.
Definition: StructuralComponent.cpp:37
virtual void addStructuralComponent(StructuralComponent *)
add a particular StructuralComponent in the list
Definition: Structure.h:128
@ NOTHING
there are no structure yet, so everything is possible
Definition: StructuralComponent.h:174
This is the main class of this project. Following a nice concept, a physical model is able to represe...
Definition: PhysicalModel.h:86
StructuralComponent * getAtoms()
Return a StructuralComponent with all the atoms of this structural component.
Definition: StructuralComponent.cpp:261
Structure * getStructureByIndex(const unsigned int)
get a structure by its unique index
Definition: StructuralComponent.h:228
PhysicalModel * getPhysicalModel() const
get the physical model
Definition: Properties.h:262
void setPhysicalModel(PhysicalModel *) override
set the physical model (recursively to all cells or to all atoms)
Definition: StructuralComponent.cpp:321
A cell has an unique index in the physical model object, is composed by atoms, and different basic pr...
Definition: Cell.h:46
void setMode(const RenderingMode::Mode)
set the rendering mode
Definition: StructuralComponent.cpp:134
std::vector< Structure * > structures
List of the structure representing this component, all the structure in this list are either all Atom...
Definition: StructuralComponent.h:203
double * getColor() const
Get the color.
Definition: StructuralComponent.cpp:116
virtual ComposedBy composedBy()
return the type of structure composing the structural component: a structural component is either a l...
Definition: StructuralComponent.cpp:296
@ CELLS
the structural component is made of cells
Definition: StructuralComponent.h:175
@ DEFAULT
no color given, decided by the GUI
Definition: StructuralComponentProperties.h:50
virtual void setPhysicalModel(PhysicalModel *)
set the physical model
Definition: Structure.cpp:53
StructuralComponent * atomList
List of all the atoms of this structural component, build the first time.
Definition: StructuralComponent.h:207
Structure * getStructure(const unsigned int) const
get a structure by its index (fisrt structure is at index 0)
Definition: StructuralComponent.h:220
Mode
This is a duplicate of RenderingMode Mode....
Definition: RenderingMode.h:63
void xmlPrint(std::ostream &) const override
print to an output stream in "pseudo" XML format (do nothing if there are no sub structures).
Definition: StructuralComponent.cpp:154
bool isVisible(const RenderingMode::Mode mode) const override
tell if a specific rendering mode is visible or not
Definition: StructuralComponent.cpp:144
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:48
Cell * getCell(unsigned int) const override
get cell by order number (not cell index)
Definition: StructuralComponent.cpp:197
Color
Default color settings.
Definition: StructuralComponentProperties.h:49
StructuralComponentProperties * getProperties()
get the structural component properties of this SC
Definition: StructuralComponent.h:274
unsigned int getNumberOfCells() const override
get the total nr of cell of the component
Definition: StructuralComponent.cpp:183
RenderingMode::Mode getMode() const
get the rendering mode
Definition: StructuralComponent.cpp:139
void removeStructuralComponent(StructuralComponent *)
remove a particular StructuralComponent from the list
Definition: Structure.h:132
@ ATOMS
the structural component is made of atoms
Definition: StructuralComponent.h:176
virtual void setPhysicalModel(PhysicalModel *)
set the physical model
Definition: modeling/libraries/pml/Component.h:180
bool addStructureIfNotIn(Structure *s)
Add a Structure in the list, only if it is not already in (and in this case tells the structure to ad...
Definition: StructuralComponent.cpp:248
void plannedNumberOfStructures(const unsigned int)
optimize the I/O of the std:vector structures.
Definition: StructuralComponent.h:270