Computer Assisted Medical Intervention Tool Kit  version 6.0
Loading...
Searching...
No Matches
StructureProperties Class Reference

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
GeometricType getType () const
 Return the type of force.
void setIndex (const unsigned int)
 set the index (BECAREFUL: it MUST be unique !!!)
void setType (const GeometricType t)
 Set the force type.
 StructureProperties (PhysicalModel *, const GeometricType)
 the only default constructor : type must be set
void xmlPrint (std::ostream &) const
 print to an output stream in "pseaudo" XML format.
 ~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!!!)
PhysicalModelgetPhysicalModel () const
 get the physical model
 Properties (const std::string n="")
 A nice simple constructor, with a given name.
 Properties (PhysicalModel *, const std::string n="")
 Another nice constructor, with the PM and a name.
void setName (std::string)
 set the name (use the string = operator)
void setPhysicalModel (PhysicalModel *)
 set the physical model
virtual ~Properties ()=default
 The default destructor.
void xmlToFields (xsd::cxx::tree::attribute_set< char > attrs)
 convert the xml node parameters to data fields
unsigned int numberOfFields () const
 get the number of extra fields found in the PML
bool isAField (std::string attName) const
 check if the field exist in the XML document, return false if it does not
std::string getField (unsigned int) const
 get the name of field of given index
double getDouble (std::string attName)
 field accessor: get the field attName as a double value, if field does not exist, 0.0 is return
int getInt (std::string attName) const
 field accessor: get the field attName as an int value, if field does not exist, 0 is return
bool getBool (std::string attName) const
 field accessor: get the field attName as a bool value, if field does not exist, false is return
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
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
void set (std::string attName, double val)
 field modificator: set field attName using a double value
void set (std::string attName, int val)
 field modificator: set field attName using an int value
void set (std::string attName, bool val)
 field modificator: set field attName using a bool value
void set (std::string attName, std::string val)
 field modificator: set field attName using a string value

Static Public Member Functions

static std::string toString (const GeometricType)
 return the string equivalent to this geometric type
static GeometricType toType (const std::string)
 return the enum corresponding to this string

Protected Attributes

unsigned int index
 unique index in the global structure
std::map< std::string, std::string > fields
 map containing all the different fields (name, value stored as string )

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::~StructureProperties ( )
default

Member Function Documentation

◆ getIndex()

unsigned int StructureProperties::getIndex ( ) const
inline

return the unique index in the global structure

References index.

◆ getType()

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

Return the type of force.

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

◆ setIndex()

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

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

References index.

Referenced by AtomProperties::AtomProperties().

◆ setType()

void StructureProperties::setType ( const GeometricType t)
inline

Set the force type.

◆ toString()

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

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

Member Data Documentation

◆ index


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