26 #ifndef STRUCTURALCOMPONENT_H 27 #define STRUCTURALCOMPONENT_H 69 unsigned int getNumberOfStructures()
const;
77 void addStructure(
Structure* s,
bool check =
true);
100 virtual void removeStructure(
Structure* s);
107 virtual void deleteAllStructures();
112 Structure* getStructure(
const unsigned int)
const;
117 Structure* getStructureByName(
const std::string);
122 Structure* getStructureByIndex(
const unsigned int);
126 void xmlPrint(std::ostream&)
const override;
129 bool isInstanceOf(
const char*)
const override;
132 unsigned int getNumberOfCells()
const override;
135 Cell* getCell(
unsigned int)
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);
156 double* getColor()
const;
158 void getColor(
double* r,
double* g,
double* b,
double* a)
const;
194 void plannedNumberOfStructures(
const unsigned int);
214 if (!check || isCompatible(s)) {
215 structures.push_back(s);
221 if (i < structures.size()) {
222 return structures[i];
229 auto it = structures.begin();
230 while (it != structures.end() && (*it)->getIndex() != i) {
233 if (it == structures.end()) {
241 auto it = structures.begin();
242 while (it != structures.end() && (*it)->getName() != n) {
245 if (it == structures.end()) {
253 return (
unsigned int) structures.size();
258 auto it = std::find(structures.begin(), structures.end(), s);
259 if (it != structures.end()) {
260 structures.erase(it);
267 return (std::string(className) == std::string(
"StructuralComponent"));
271 structures.reserve(size);
278 #endif //STRUCTURALCOMPONENT_H void plannedNumberOfStructures(const unsigned int)
optimize the I/O of the std:vector structures.
Definition: StructuralComponent.h:270
A cell has an unique index in the physical model object, is composed by atoms, and different basic pr...
Definition: Cell.h:46
bool isInstanceOf(const char *) const override
return true only if the parameter is equal to "StructuralComponent"
Definition: StructuralComponent.h:266
Pure virtual class that represent an element of the structure.
Definition: Structure.h:43
ComposedBy
What this structural component is made of.
Definition: StructuralComponent.h:173
StructuralComponentProperties * getProperties()
get the structural component properties of this SC
Definition: StructuralComponent.h:274
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
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
void removeStructuralComponent(StructuralComponent *)
remove a particular StructuralComponent from the list
Definition: Structure.h:132
unsigned int getNumberOfStructures() const
get the number of structures
Definition: StructuralComponent.h:252
StructuralComponent * atomList
List of all the atoms of this structural component, build the first time.
Definition: StructuralComponent.h:207
there are no structure yet, so everything is possible
Definition: StructuralComponent.h:174
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:48
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
Mode
This is a duplicate of RenderingMode Mode....
Definition: RenderingMode.h:40
Structure * getStructureByIndex(const unsigned int)
get a structure by its unique index
Definition: StructuralComponent.h:228
A class that manages the structural component properties.
Definition: StructuralComponentProperties.h:44
This is the main class of this project.
Definition: PhysicalModel.h:86
Structure * getStructure(const unsigned int) const
get a structure by its index (fisrt structure is at index 0)
Definition: StructuralComponent.h:220
A structural component is composed either by cell or by atoms.
Definition: StructuralComponent.h:52
Color
Default color settings.
Definition: StructuralComponentProperties.h:49
the structural component is made of cells
Definition: StructuralComponent.h:175
virtual void addStructuralComponent(StructuralComponent *)
add a particular StructuralComponent in the list
Definition: Structure.h:128
Structure * getStructureByName(const std::string)
get a structure by its name
Definition: StructuralComponent.h:240