Computer Assited Medical Intervention Tool Kit  version 5.0
StructureProperties.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef STRUCTUREPROPERTIES_H
27 #define STRUCTUREPROPERTIES_H
28 
29 #include "PhysicalModelIO.h"
30 #include "Properties.h"
39 public:
107  enum GeometricType {
108  INVALID,
109  ATOM,
110  LINE,
111  TRIANGLE,
112  QUAD,
113  TETRAHEDRON,
114  WEDGE,
115  PYRAMID,
116  HEXAHEDRON,
117  POLY_LINE,
118  POLY_VERTEX
119  };
120 
122  static GeometricType toType(const std::string);
123 
125  static std::string toString(const GeometricType);
126 
129  ~StructureProperties() = default;
130 
132  void setType(const GeometricType t);
133 
135  GeometricType getType() const;
136 
139  void xmlPrint(std::ostream&) const;
140 
142  unsigned int getIndex() const;
143 
145  void setIndex(const unsigned int);
146 
147 private:
152 
153 protected:
155  unsigned int index;
156 
157 };
158 
159 // ---------------- inlines -------------------
161  return type;
162 }
164  type = t;
165 }
166 inline unsigned int StructureProperties::getIndex() const {
167  return index;
168 }
169 inline void StructureProperties::setIndex(const unsigned int newIndex) {
170  index = newIndex;
171 }
172 
173 #endif //STRUCTUREPROPERTIES_H
StructureProperties
Describes the properties common to all structures.
Definition: StructureProperties.h:38
StructureProperties::WEDGE
@ WEDGE
the structure is a wedge (like the Pink Floyd's "Dark Side Of the Moon" prism), it must be a cell and...
Definition: StructureProperties.h:160
StructureProperties::TETRAHEDRON
@ TETRAHEDRON
the structure is a tetrahedron, it must be a cell and have sub-structures that are atoms
Definition: StructureProperties.h:159
StructureProperties::GeometricType
GeometricType
Geometric type gives information about which kind of geometric representation is the structure.
Definition: StructureProperties.h:130
Properties.h
StructureProperties::getIndex
unsigned int getIndex() const
return the unique index in the global structure
Definition: StructureProperties.h:166
StructureProperties.h
StructureProperties::xmlPrint
void xmlPrint(std::ostream &) const
print to an output stream in "pseaudo" XML format.
Definition: StructureProperties.cpp:115
StructureProperties::toType
static GeometricType toType(const std::string)
return the enum corresponding to this string
Definition: StructureProperties.cpp:35
PhysicalModel
This is the main class of this project. Following a nice concept, a physical model is able to represe...
Definition: PhysicalModel.h:86
StructureProperties::INVALID
@ INVALID
invalid geometry type
Definition: StructureProperties.h:154
StructureProperties::type
GeometricType type
The geometric type,.
Definition: StructureProperties.h:174
PhysicalModelIO.h
StructureProperties::PYRAMID
@ PYRAMID
the structure has a quad base and one vertex outside the defined base plane (like an egyptian pyramid...
Definition: StructureProperties.h:161
StructureProperties::setIndex
void setIndex(const unsigned int)
set the index (BECAREFUL: it MUST be unique !!!)
Definition: StructureProperties.h:169
StructureProperties::setType
void setType(const GeometricType t)
Set the force type.
Definition: StructureProperties.h:163
StructureProperties::HEXAHEDRON
@ HEXAHEDRON
the structure is a hexahedron, it must be a cell and have sub-structures that are atoms
Definition: StructureProperties.h:162
StructureProperties::TRIANGLE
@ TRIANGLE
the structure is a triangle, i.e it must be a cell composed of 3 atoms
Definition: StructureProperties.h:157
StructureProperties::LINE
@ LINE
the structure is a simple line, i.e it must be a cell composed of only 2 atoms
Definition: StructureProperties.h:156
StructureProperties::StructureProperties
StructureProperties(PhysicalModel *, const GeometricType)
the only default constructor : type must be set
Definition: StructureProperties.cpp:29
StructureProperties::index
unsigned int index
unique index in the global structure
Definition: StructureProperties.h:178
StructureProperties::POLY_VERTEX
@ POLY_VERTEX
the structure is a poly vertex, i.e it must be a cell and it is a point clouds
Definition: StructureProperties.h:164
StructureProperties::ATOM
@ ATOM
the structure is an atom, and hence should be represented by a single point
Definition: StructureProperties.h:155
Properties
Describes the properties common to all structures and components.
Definition: Properties.h:59
StructureProperties::QUAD
@ QUAD
the structure is a quad, i.e it must be a cell composed of 4 atoms
Definition: StructureProperties.h:158
StructureProperties::toString
static std::string toString(const GeometricType)
return the string equivalent to this geometric type
Definition: StructureProperties.cpp:72
StructureProperties::getType
GeometricType getType() const
Return the type of force.
Definition: StructureProperties.h:160
StructureProperties::~StructureProperties
~StructureProperties()=default
StructureProperties::POLY_LINE
@ 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...
Definition: StructureProperties.h:163