Computer Assisted Medical Intervention Tool Kit  version 5.2
StructureProperties Class Reference

Describes the properties common to all structures. More...

#include <StructureProperties.h>

+ Inheritance diagram for StructureProperties:
+ Collaboration diagram for StructureProperties:

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...
 
PhysicalModelgetPhysicalModel () 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...
 

Detailed Description

Describes the properties common to all structures.

Member Enumeration Documentation

◆ GeometricType

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

Enumerator
INVALID 

invalid geometry type

ATOM 

the structure is an atom, and hence should be represented by a single point

LINE 

the structure is a simple line, i.e it must be a cell composed of only 2 atoms

TRIANGLE 

the structure is a triangle, i.e it must be a cell composed of 3 atoms

QUAD 

the structure is a quad, i.e it must be a cell composed of 4 atoms

TETRAHEDRON 

the structure is a tetrahedron, it must be a cell and have sub-structures that are atoms

WEDGE 

the structure is a wedge (like the Pink Floyd's "Dark Side Of the Moon" prism), it must be a cell and have sub-structures that are atoms

PYRAMID 

the structure has a quad base and one vertex outside the defined base plane (like an egyptian pyramid!)

HEXAHEDRON 

the structure is a hexahedron, it must be a cell and have sub-structures that are atoms

POLY_LINE 

the structure is a polyline, i.e it must be a cell and the order of the atom in the cell are arranged along a line

POLY_VERTEX 

the structure is a poly vertex, i.e it must be a cell and it is a point clouds

Constructor & Destructor Documentation

◆ StructureProperties()

StructureProperties::StructureProperties ( PhysicalModel p,
const  GeometricType 
)

the only default constructor : type must be set

◆ ~StructureProperties()

StructureProperties::~StructureProperties ( )
default

Member Function Documentation

◆ getIndex()

unsigned int StructureProperties::getIndex ( ) const
inline

return the unique index in the global structure

References index.

Referenced by Structure::getIndex().

+ Here is the caller graph for this function:

◆ getType()

StructureProperties::GeometricType StructureProperties::getType ( ) const
inline

Return the type of force.

Referenced by Reference::getDistanceToTriangularMesh(), Structure::getType(), and CellProperties::xmlPrint().

+ Here is the caller graph for this function:

◆ setIndex()

void StructureProperties::setIndex ( const unsigned int  newIndex)
inline

set the index (BECAREFUL: it MUST be unique !!!)

References index.

Referenced by AtomProperties::AtomProperties(), and Structure::setIndex().

+ Here is the caller graph for this function:

◆ setType()

void StructureProperties::setType ( const GeometricType  t)
inline

Set the force type.

◆ toString()

std::string StructureProperties::toString ( const  GeometricType)
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 xmlPrint().

+ Here is the caller graph for this function:

◆ toType()

StructureProperties::GeometricType StructureProperties::toType ( const std::string  t)
static

return the enum corresponding to this string

References ATOM, HEXAHEDRON, INVALID, LINE, POLY_LINE, POLY_VERTEX, PYRAMID, QUAD, TETRAHEDRON, TRIANGLE, and WEDGE.

◆ xmlPrint()

void StructureProperties::xmlPrint ( std::ostream &  o) const

print to an output stream in "pseaudo" XML format.

References index, and toString().

+ Here is the call graph for this function:

Member Data Documentation

◆ index

unsigned int StructureProperties::index
protected

The documentation for this class was generated from the following files: