A cell has an unique index in the physical model object, is composed by atoms, and different basic properties. More...
#include <Cell.h>
Inheritance diagram for Cell:
Collaboration diagram for Cell:Public Member Functions | |
| void | addStructuralComponent (StructuralComponent *) override |
| add a particular StructuralComponent in the list (and set parentSC if null) | |
| Cell (PhysicalModel *myPM, const StructureProperties::GeometricType t) | |
| constructor that generates a unique index | |
| Cell (PhysicalModel *myPM, const StructureProperties::GeometricType t, const unsigned int ind) | |
| When you know the index of the cell, use this constructor. | |
| Cell (PhysicalModel *myPM, physicalModel::Cell xmlCell, StructuralComponent *sc) | |
| constructor from xml node: try to read and get the parameters from xml | |
| StructuralComponent::ComposedBy | composedBy () override |
| overloaded from Structural component, always return StructuralComponent::ATOMS | |
| void | deleteAllStructures () override |
| This method overload the one defined in StructuralComponent. | |
| const StructuralComponent * | getParentSC () |
| Get the direct parent structural that own this cell. | |
| CellProperties * | getProperties () |
| return the property | |
| StructuralComponent * | getQuadFaces () |
| Return a new structural component directly representing the Cell as a list of quad faces (when possible) | |
| StructuralComponent * | getTriangleFaces () |
| Return a new structural component directly representing the Cell as a list of triangular faces (when possible) | |
| bool | isInstanceOf (const char *) const override |
| return true only if the parameter is equal to "MultiComponent" | |
| bool | makePrintData (const StructuralComponent *) |
| is this sc the one that will be the one that will make the cell to print out all its data or is this a sc that will just print out the cell ref? | |
| double * | normal () |
| compute the normal of the facet Warning : Only available for QUAD and TRIANGLE type cells | |
| bool | setIndex (const unsigned int) override |
| set the index. | |
| double | signedVolumeTriangle (double p1[3], double p2[3], double p3[3]) |
| Compute the volume of a triangle with the origin of the coordinate system. | |
| double | surface () |
| Compute the surface of the cell. | |
| double | volume () |
| Compute the volume of the cell. | |
| void | xmlPrint (std::ostream &, const StructuralComponent *) override |
| print to an output stream in "pseudo" XML format. | |
| ~Cell () override | |
| the destructor, my tailor. BECAREFUL: the atoms should not not be deleted here... | |
Public Member Functions inherited from Structure | |
| std::vector< StructuralComponent * > | getAllStructuralComponents () |
| get the list of all the StructuralComponent that are using this structure | |
| unsigned int | getIndex () const |
| get the structure unique index (stored in its property) | |
| std::string | getName () const |
| get the name of the structure | |
| unsigned int | getNumberOfStructuralComponents () const |
| get the number of StructuralComponent that are using this structure | |
| StructuralComponent * | getStructuralComponent (unsigned int i) |
| get a particular StructuralComponent that is using this structure | |
| StructureProperties::GeometricType | getType () const |
| get the type of index | |
| void | removeStructuralComponent (StructuralComponent *) |
| remove a particular StructuralComponent from the list | |
| void | setName (std::string) |
| set the name of the structure | |
| virtual void | setPhysicalModel (PhysicalModel *) |
| set the physical model | |
| Structure () | |
| Base constructor. | |
| virtual | ~Structure ()=default |
| Virtual destructor needed here as this is an abstract class (pure virtual) | |
Public Member Functions inherited from StructuralComponent | |
| 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). | |
| 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 add this structural component to its list). | |
| StructuralComponent * | getAtoms () |
| Return a StructuralComponent with all the atoms of this structural component. | |
| Cell * | getCell (unsigned int) const override |
| get cell by order number (not cell index) | |
| double * | getColor () const |
| Get the color. | |
| void | getColor (double *r, double *g, double *b, double *a) const |
| Get the color by its 4 componants r,g,b and a. | |
| RenderingMode::Mode | getMode () const |
| get the rendering mode | |
| unsigned int | getNumberOfCells () const override |
| get the total nr of cell of the component | |
| unsigned int | getNumberOfStructures () const |
| get the number of structures | |
| StructuralComponentProperties * | getProperties () |
| get the structural component properties of this SC | |
| StructuralComponentProperties::Color | getStructuralComponentPropertiesColor () const |
| Return the color as a code (see StructuralComponentProperties::Color enum) | |
| Structure * | getStructure (const unsigned int) const |
| get a structure by its index (fisrt structure is at index 0) | |
| Structure * | getStructureByIndex (const unsigned int) |
| get a structure by its unique index | |
| Structure * | getStructureByName (const std::string) |
| get a structure by its name | |
| bool | isCompatible (Structure *) |
| return true if the given structure is compatible with what composes this structural component. | |
| bool | isInstanceOf (const char *) const override |
| return true only if the parameter is equal to "StructuralComponent" | |
| bool | isStructureIn (Structure *s) |
| Check if a given structure is present in the list. | |
| bool | isVisible (const RenderingMode::Mode mode) const override |
| tell if a specific rendering mode is visible or not | |
| void | plannedNumberOfStructures (const unsigned int) |
| optimize the I/O of the std:vector structures. | |
| virtual void | removeStructure (Structure *s) |
| Remove a structure from the list (and tells the structure to remove this structural component from its list). | |
| void | setColor (const double r, const double b, const double g) |
| Set the new RGB color. | |
| void | setColor (const double r, const double b, const double g, const double a) |
| Set the new RGBA color. | |
| void | setColor (const StructuralComponentProperties::Color c) |
| Set the new color (using a StructuralComponentProperties::Color enum) | |
| void | setMode (const RenderingMode::Mode) |
| set the rendering mode | |
| void | setPhysicalModel (PhysicalModel *) override |
| set the physical model (recursively to all cells or to all atoms) | |
| void | setVisible (const RenderingMode::Mode mode, const bool b) override |
| set the visibility of a specific rendering mode | |
| StructuralComponent (PhysicalModel *) | |
| Default Constructor. | |
| StructuralComponent (PhysicalModel *, std::string) | |
| constructor that allows one to name the structure. | |
| StructuralComponent (PhysicalModel *p, physicalModel::StructuralComponent xmlSC) | |
| constructor from xml node: try to read and get the parmaters from xml | |
| void | xmlPrint (std::ostream &) const override |
| print to an output stream in "pseudo" XML format (do nothing if there are no sub structures). | |
| ~StructuralComponent () override | |
| delete all the structures (call the deleteAllStructures method) | |
Public Member Functions inherited from Component | |
| Component (PhysicalModel *, std::string n="") | |
| Default constructor, a component needs to know the PM it is in. | |
| const std::string | getName () const |
| get the name of the component | |
| bool | isExclusive () const |
| tell if this component is exclusive or not | |
| void | setExclusive (const bool) |
| set the exclusive flag | |
| void | setName (const std::string) |
| set the name of the component | |
| virtual | ~Component () |
| Virtual destructor needed here as this is an abstract class (pure virtual) | |
| std::vector< MultiComponent * > | getAllParentMultiComponents () |
| get the list of all the Multi Component that are using this Component | |
| unsigned int | getNumberOfParentMultiComponents () const |
| get the number of MultiComponent that are using this Component (= nr of parent component) | |
| MultiComponent * | getParentMultiComponent (unsigned int) |
| get a particular MultiComponent that is using this Component (a particular parent component) | |
| void | addParentMultiComponent (MultiComponent *) |
| add a particular parent MultiComponent in the list | |
| void | removeParentMultiComponent (MultiComponent *) |
| remove a particular parent MultiComponent | |
| PhysicalModel * | getPhysicalModel () const |
| get the physical model | |
| Properties * | getProperties () |
| get the component structural properties (guarantied to be non nullptr) | |
Additional Inherited Members | |
Public Types inherited from StructuralComponent | |
| enum | ComposedBy { NOTHING , CELLS , ATOMS } |
| What this structural component is made of. More... | |
Public Attributes inherited from Structure | |
| bool | hasIndex |
| indicate if the Structure has an index (which is not the case all the time) | |
Protected Member Functions inherited from Component | |
| void | removeFromParents () |
| this tell the parent components that this component is removed from memory. | |
| void | deleteProperties () |
| delete the "properties" pointer and set it to nullptr | |
Protected Attributes inherited from Structure | |
| StructureProperties * | properties {nullptr} |
| Property of the current structure. | |
Protected Attributes inherited from StructuralComponent | |
| StructuralComponent * | atomList |
| List of all the atoms of this structural component, build the first time. | |
| 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!) | |
Protected Attributes inherited from Component | |
| Properties * | properties |
A cell has an unique index in the physical model object, is composed by atoms, and different basic properties.
It is the most basic component composing a physical model.
| Cell::Cell | ( | PhysicalModel * | myPM, |
| const StructureProperties::GeometricType | t | ||
| ) |
constructor that generates a unique index
| myPM | the physical model the atom belongs to |
| t | the type of the cell |
References Structure::properties.
| Cell::Cell | ( | PhysicalModel * | myPM, |
| physicalModel::Cell | xmlCell, | ||
| StructuralComponent * | sc | ||
| ) |
constructor from xml node: try to read and get the parameters from xml
| myPM | the physical model the atom belongs to |
| xmlCell | the xml node to read to get the information |
| sc | the direct parent structural component that owns this cell |
References StructuralComponent::addStructure(), StructureProperties::ATOM, PhysicalModel::getAtom(), StructureProperties::HEXAHEDRON, StructureProperties::INVALID, StructureProperties::LINE, StructuralComponent::plannedNumberOfStructures(), StructureProperties::POLY_LINE, StructureProperties::POLY_VERTEX, Structure::properties, StructureProperties::PYRAMID, StructureProperties::QUAD, StructuralComponent::setColor(), StructureProperties::TETRAHEDRON, StructureProperties::TRIANGLE, and StructureProperties::WEDGE.
Here is the call graph for this function:| Cell::Cell | ( | PhysicalModel * | myPM, |
| const StructureProperties::GeometricType | t, | ||
| const unsigned int | ind | ||
| ) |
When you know the index of the cell, use this constructor.
| myPM | the physical model the atom belongs to |
| t | the type of the cell |
| ind | give the unique index |
References Structure::properties.
|
override |
the destructor, my tailor. BECAREFUL: the atoms should not not be deleted here...
References StructuralComponent::atomList, deleteAllStructures(), Component::deleteProperties(), Structure::properties, and Component::removeFromParents().
Here is the call graph for this function:
|
inlineoverridevirtual |
add a particular StructuralComponent in the list (and set parentSC if null)
Reimplemented from Structure.
References Structure::addStructuralComponent().
Here is the call graph for this function:
|
inlineoverridevirtual |
overloaded from Structural component, always return StructuralComponent::ATOMS
Reimplemented from StructuralComponent.
References StructuralComponent::ATOMS.
|
overridevirtual |
This method overload the one defined in StructuralComponent.
The difference here is that the atoms composing the cell ARE NOT delete, still the list is cleared. After a call to this method getNumberOfSubStructures() should return 0
Reimplemented from StructuralComponent.
References StructuralComponent::structures.
Referenced by ~Cell().
Here is the caller graph for this function:
|
inline |
Get the direct parent structural that own this cell.
Referenced by PMLComponent::selectCell().
Here is the caller graph for this function:| CellProperties * Cell::getProperties | ( | ) |
return the property
References Structure::properties.
Referenced by Reference::getDistanceToTriangularMesh(), getQuadFaces(), getTriangleFaces(), normal(), surface(), and volume().
Here is the caller graph for this function:| StructuralComponent * Cell::getQuadFaces | ( | ) |
Return a new structural component directly representing the Cell as a list of quad faces (when possible)
References StructuralComponent::addStructure(), Component::getPhysicalModel(), getProperties(), StructuralComponent::getStructure(), Structure::getType(), StructureProperties::HEXAHEDRON, StructureProperties::QUAD, and StructureProperties::WEDGE.
Here is the call graph for this function:| StructuralComponent * Cell::getTriangleFaces | ( | ) |
Return a new structural component directly representing the Cell as a list of triangular faces (when possible)
References StructuralComponent::addStructure(), Component::getPhysicalModel(), getProperties(), StructuralComponent::getStructure(), Structure::getType(), StructureProperties::HEXAHEDRON, StructureProperties::QUAD, StructureProperties::TETRAHEDRON, StructureProperties::TRIANGLE, and StructureProperties::WEDGE.
Referenced by surface(), and volume().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineoverridevirtual |
return true only if the parameter is equal to "MultiComponent"
Implements Structure.
| bool Cell::makePrintData | ( | const StructuralComponent * | sc | ) |
is this sc the one that will be the one that will make the cell to print out all its data or is this a sc that will just print out the cell ref?
References Structure::getNumberOfStructuralComponents(), Structure::getStructuralComponent(), and Component::isExclusive().
Referenced by xmlPrint().
Here is the call graph for this function:
Here is the caller graph for this function:| double * Cell::normal | ( | ) |
compute the normal of the facet Warning : Only available for QUAD and TRIANGLE type cells
References getProperties(), StructuralComponent::getStructure(), Structure::getType(), StructureProperties::QUAD, and StructureProperties::TRIANGLE.
Referenced by surface(), and volume().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
set the index.
The index have to be unique otherwise this method has no effect. The sub-classes method will check that this index is not in use.
Reimplemented from Structure.
References PhysicalModel::addGlobalIndexCellPair(), Component::getPhysicalModel(), and Structure::setIndex().
Here is the call graph for this function:| double Cell::signedVolumeTriangle | ( | double | p1[3], |
| double | p2[3], | ||
| double | p3[3] | ||
| ) |
Compute the volume of a triangle with the origin of the coordinate system.
If the triangle is A,B,C it computes the volume of the tetrahedron OABC.
Referenced by volume().
Here is the caller graph for this function:| double Cell::surface | ( | ) |
Compute the surface of the cell.
References StructuralComponent::getCell(), StructuralComponent::getNumberOfCells(), StructuralComponent::getNumberOfStructures(), getProperties(), StructuralComponent::getStructure(), getTriangleFaces(), Structure::getType(), normal(), surface(), and StructureProperties::TRIANGLE.
Referenced by MonitorSurface::calculate(), surface(), and volume().
Here is the call graph for this function:
Here is the caller graph for this function:| double Cell::volume | ( | ) |
Compute the volume of the cell.
References StructuralComponent::getCell(), StructuralComponent::getNumberOfCells(), getProperties(), StructuralComponent::getStructure(), getTriangleFaces(), Structure::getType(), normal(), StructureProperties::QUAD, signedVolumeTriangle(), surface(), and StructureProperties::TRIANGLE.
Referenced by MonitorVolume::calculate().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
print to an output stream in "pseudo" XML format.
If the StructuralComponent that calls this method is not the first in the list of composing SC, then a cellRef tag is printed (otherwise the list of atom is printed).
Implements Structure.
References StructuralComponentProperties::DEFAULT, StructuralComponent::getColor(), Structure::getIndex(), makePrintData(), Component::properties, Structure::properties, and StructuralComponent::structures.
Here is the call graph for this function: