26 #ifndef MULTICOMPONENT_H 27 #define MULTICOMPONENT_H 136 std::vector <Component *>::iterator it=
components.begin();
139 foundC = ((*it)->getName()==n)?(*it):NULL;
149 return (std::string(className)==std::string(
"MultiComponent"));
152 #endif //MULTICOMPONENT_H bool isExclusive() const
tell if this component is exclusive or not
Definition: modeling/libraries/pml/Component.h:144
std::vector< Component * > components
List of sub component.
Definition: MultiComponent.h:107
A cell has an unique index in the physical model object, is composed by atoms, and different basic pr...
Definition: Cell.h:46
Cell * getCell(unsigned int) const
get cell by order number (not cell index)
Definition: MultiComponent.cpp:86
MultiComponent(PhysicalModel *)
Default Constructor.
Definition: MultiComponent.cpp:29
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 visi...
Definition: MultiComponent.cpp:109
void xmlPrint(std::ostream &) const
print to an output stream in "pseaudo" XML format (do nothing if there are no sub components)...
Definition: MultiComponent.cpp:55
virtual bool isInstanceOf(const char *) const =0
pure virtual method, implemented in the child-class
void setExclusive(const bool)
set the exclusive flag
Definition: modeling/libraries/pml/Component.h:141
Component * getComponentByName(const std::string)
conveniant method to get the sub component of the name given in parameter
Definition: MultiComponent.h:135
virtual void setVisible(const RenderingMode::Mode mode, const bool b)
set the state of a visibility mode in all the sub component.
Definition: MultiComponent.cpp:117
void removeParentMultiComponent(MultiComponent *)
remove a particular parent MultiComponent
Definition: modeling/libraries/pml/Component.h:171
unsigned int getNumberOfSubComponents() const
return the number of subcomponents
Definition: MultiComponent.h:111
virtual void setPhysicalModel(PhysicalModel *)
set the physical model (recursively)
Definition: MultiComponent.cpp:124
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:48
void removeSubComponent(Component *c)
Remove a component from the list.
Definition: MultiComponent.h:128
unsigned int getNumberOfCells() const
get the total nr of cell of the component
Definition: MultiComponent.cpp:74
Mode
This is a duplicate of RenderingMode Mode....
Definition: RenderingMode.h:40
This is the main class of this project.
Definition: PhysicalModel.h:86
void addSubComponent(Component *)
add a component in the list of subcomponents (and set the isExclusive flag accordingly to the state o...
Definition: MultiComponent.h:120
void deleteAllSubComponents()
this method free all the sub-components (i.e.
Definition: MultiComponent.cpp:48
void addParentMultiComponent(MultiComponent *)
add a particular parent MultiComponent in the list
Definition: modeling/libraries/pml/Component.h:168
~MultiComponent()
delete all the subcomponents (call the deleteAllSubComponents method)
Definition: MultiComponent.cpp:38
A multi-component stores other components, hence providing a way to have an tree representation of co...
Definition: MultiComponent.h:44
virtual bool isInstanceOf(const char *) const
return true only if the parameter is equal to "MultiComponent"
Definition: MultiComponent.h:148
Component * getSubComponent(const unsigned int) const
get a subcomponent by its order number (index in the list of subcomponents)
Definition: MultiComponent.h:114