Describes the properties common to all structures. More...
#include <StructureProperties.h>
Public Types | |
enum | GeometricType { INVALID, ATOM, LINE, TRIANGLE, QUAD, TETRAHEDRON, WEDGE, PYRAMID, HEXAHEDRON, POLY_LINE, POLY_VERTEX } |
Geometric type gives information about which kind of geometric representation is the structure. More... | |
Public Member Functions | |
unsigned int | getIndex () const |
return the unique index in the global structure More... | |
GeometricType | getType () const |
Return the type of force. More... | |
void | setIndex (const unsigned int) |
set the index (BECAREFUL: it MUST be unique !!!) More... | |
void | setType (const GeometricType t) |
Set the force type. More... | |
StructureProperties (PhysicalModel *, const GeometricType) | |
the only default constructor : type must be set More... | |
void | xmlPrint (std::ostream &) const |
print to an output stream in "pseaudo" XML format. More... | |
~StructureProperties ()=default | |
Public Member Functions inherited from Properties | |
std::string | getName () const |
get the name (be careful, this method DOES NOT return a copy, so you got the direct ptr to the name!!!) More... | |
PhysicalModel * | getPhysicalModel () const |
get the physical model More... | |
Properties (const std::string n="") | |
A nice simple constructor, with a given name. More... | |
Properties (PhysicalModel *, const std::string n="") | |
Another nice constructor, with the PM and a name. More... | |
void | setName (std::string) |
set the name (use the string = operator) More... | |
void | setPhysicalModel (PhysicalModel *) |
set the physical model More... | |
virtual | ~Properties ()=default |
The default destructor. More... | |
void | xmlToFields (xsd::cxx::tree::attribute_set< char > attrs) |
convert the xml node parameters to data fields More... | |
unsigned int | numberOfFields () const |
get the number of extra fields found in the PML More... | |
bool | isAField (std::string attName) const |
check if the field exist in the XML document, return false if it does not More... | |
std::string | getField (unsigned int) const |
get the name of field of given index More... | |
double | getDouble (std::string attName) |
field accessor: get the field attName as a double value, if field does not exist, 0.0 is return More... | |
int | getInt (std::string attName) const |
field accessor: get the field attName as an int value, if field does not exist, 0 is return More... | |
bool | getBool (std::string attName) const |
field accessor: get the field attName as a bool value, if field does not exist, false is return More... | |
std::string | getString (std::string attName) const |
field accessor: get the field attName as a string value, if field does not exist, empty string is return More... | |
void | get (std::string attName, std::string &attVal) const |
field accessor: get the field attName as a string value in attVal, if field does not exist, empty string is return More... | |
void | set (std::string attName, double val) |
field modificator: set field attName using a double value More... | |
void | set (std::string attName, int val) |
field modificator: set field attName using an int value More... | |
void | set (std::string attName, bool val) |
field modificator: set field attName using a bool value More... | |
void | set (std::string attName, std::string val) |
field modificator: set field attName using a string value More... | |
Static Public Member Functions | |
static std::string | toString (const GeometricType) |
return the string equivalent to this geometric type More... | |
static GeometricType | toType (const std::string) |
return the enum corresponding to this string More... | |
Protected Attributes | |
unsigned int | index |
unique index in the global structure More... | |
Protected Attributes inherited from Properties | |
std::map< std::string, std::string > | fields |
map containing all the different fields (name, value stored as string ) More... | |
Private Attributes | |
GeometricType | type |
The geometric type,. More... | |
Describes the properties common to all structures.
Geometric type gives information about which kind of geometric representation is the structure.
For 3D geometric shapes, atoms have to be given in a proper order:
TRIANGLE 2 lines: / \ 0,1 / \ 0,2 0------1 1,2
QUAD 3--------2 lines: | | 0,1 | | 1,2 | | 2,3 0--------1 3,0
TETRAHEDRON 3 /| \ facets (triangles): lines: / | \ 0,1,2 (base) 0,1 1..|... 2 0,2,3 0,2 \ | / 0,3,1 0,3 \ | / 2,1,3 1,2 |/ 1,3 0 2,3
PYRAMID
4 ,/|\ ,/ .'|\ (copied from gmsh documentation) ,/ | | \ ,/ .' | `. ,/ | '. \ ,/ .' w | \ ,/ | ^ | \ 0----------.'--|-3 `. `\ | | `\ \ `\ .' +----`\ - \ -> v `\ | `\ `\ \ `.' `\ `\` 1----------------2 `\ u
WEDGE 1-------------4 facets (quad): facets (triangles): lines: /\ . \ 2,5,4,1 0,2,1 0,1 2,5 / \ / \ 0,1,4,3 3,4,5 0,2 3,4 0- - \ - - - 3 \ 2,0,3,5 1,2 4,5 \ \ \ \ 0,3 5,3 \ 2-------------5 1,4
HEXAHEDRON 2-------------6 facets (quad): lines: / \ . \ 0,3,2,1 0,1 6,7 / \ / \ 0,4,7,3 1,2 7,4 1- - -\ - - - 5 \ 0,1,5,4 2,3 0,4 \ 3-------------7 3,7,6,2 3,0 1,5 \ / \ / 1,2,6,5 4,5 2,6 \ / . / 4,5,6,7 5,6 3,7 0-------------4
StructureProperties::StructureProperties | ( | PhysicalModel * | p, |
const | GeometricType | ||
) |
the only default constructor : type must be set
References type.
|
default |
|
inline |
return the unique index in the global structure
References index.
Referenced by Structure::getIndex().
|
inline |
Return the type of force.
Referenced by PMLExplorerWidget::createCellPropertyList(), Reference::getDistanceToTriangularMesh(), Structure::getType(), and CellProperties::xmlPrint().
|
inline |
set the index (BECAREFUL: it MUST be unique !!!)
References index.
Referenced by AtomProperties::AtomProperties(), and Structure::setIndex().
|
inline |
Set the force type.
|
static |
return the string equivalent to this geometric type
References ATOM, HEXAHEDRON, LINE, POLY_LINE, POLY_VERTEX, PYRAMID, QUAD, TETRAHEDRON, TRIANGLE, and WEDGE.
Referenced by PMLExplorerWidget::createCellPropertyList(), and xmlPrint().
|
static |
return the enum corresponding to this string
References ATOM, HEXAHEDRON, INVALID, LINE, POLY_LINE, POLY_VERTEX, PYRAMID, QUAD, TETRAHEDRON, TRIANGLE, and WEDGE.
void StructureProperties::xmlPrint | ( | std::ostream & | o | ) | const |
print to an output stream in "pseaudo" XML format.
References index, toString(), and type.
|
protected |
unique index in the global structure
Referenced by AtomProperties::AtomProperties(), CellProperties::CellProperties(), getIndex(), setIndex(), CellProperties::xmlPrint(), AtomProperties::xmlPrint(), and xmlPrint().
|
private |
The geometric type,.
Referenced by StructureProperties(), and xmlPrint().