Computer Assited Medical Intervention Tool Kit  version 5.0
PMLTransform.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 PMLTRANSFORM_H
27 #define PMLTRANSFORM_H
28 
29 #include "PhysicalModel.h"
30 
31 #include <map>
32 #include <vector>
33 
34 class CellProperties;
42 class Facet {
43 public:
45  Facet(unsigned int size, unsigned int id[]);
46 
48  virtual ~Facet();
49 
51  bool testEquivalence(unsigned int size, unsigned int id[]);
52 
54  Cell* getCell(PhysicalModel*) const;
55 
57  void debug();
58 
60  unsigned int getUsed() const;
61 
62 private:
64  bool isIn(unsigned int) const;
65 
67  unsigned int* id;
68 
70  unsigned int size;
71 
73  unsigned int used;
74 };
75 
76 
77 
78 
82 class PMLTransform {
83 
84 public :
85 //-- elem to neighborhhod methods
86 
89  static std::map<unsigned int, Cell*>::iterator getIterator(unsigned int index);
90 
93 
95  static void equivalent(int size, unsigned int id[]);
96 
99 
100 
101 private :
102  // -------------------- Neigborhood Map ------------------------
103  // associative map of all the neighboors for a given index of an atom
104  static std::map<unsigned int, Cell*> neighMap;
105 
106  // -------------------- All border facets ------------------------
108  static std::vector <Facet*> allFacets;
109 
110 };
111 
112 #endif
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
AtomProperties.h
StructuralComponent::getNumberOfStructures
unsigned int getNumberOfStructures() const
get the number of structures
Definition: StructuralComponent.h:252
Structure::getType
StructureProperties::GeometricType getType() const
get the type of index
Definition: Structure.cpp:40
Atom
An atom has an unique index in the physical model object, a 3D position, and different basic properti...
Definition: Atom.h:49
StructuralComponentProperties.h
CellProperties.h
a
#define a
PhysicalModel::getAtom
Atom * getAtom(const unsigned int id)
Get the atom that has the global index given in parameters.
Definition: PhysicalModel.h:385
Structure::getIndex
unsigned int getIndex() const
get the structure unique index (stored in its property)
Definition: Structure.cpp:30
PMLTransform
PML Transform is composed by static methods It performs transformations on pml object and do a lot of...
Definition: PMLTransform.h:82
Facet::getCell
Cell * getCell(PhysicalModel *) const
return the corresponding PML cell
Definition: Facet.cpp:98
CellProperties
Describes and manages the properties attached to cells.
Definition: CellProperties.h:44
StructuralComponent
A structural component is composed either by cell or by atoms.
Definition: StructuralComponent.h:52
Structure
Pure virtual class that represent an element of the structure. This implies that every structure coul...
Definition: Structure.h:43
StructuralComponent::addStructure
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).
Definition: StructuralComponent.h:212
Atom.h
Facet
Class facet to hold and compare facet This class is used for the extraction of external surface durin...
Definition: Facet.h:38
PMLTransform::equivalent
static void equivalent(int size, unsigned int id[])
check if equivalent of already existing facet
Definition: PMLTransform.cpp:361
PhysicalModel
This is the main class of this project. Following a nice concept, a physical model is able to represe...
Definition: PhysicalModel.h:86
PMLTransform::generateNeighborhood
static StructuralComponent * generateNeighborhood(StructuralComponent *sc)
generate the neighborhoods
Definition: PMLTransform.cpp:191
Cell
A cell has an unique index in the physical model object, is composed by atoms, and different basic pr...
Definition: Cell.h:46
PMLTransform::getIterator
static std::map< unsigned int, Cell * >::iterator getIterator(unsigned int index)
get the iterator on the correct atom index in the neighMap if non existant create it
Definition: PMLTransform.cpp:164
PMLTransform::allFacets
static std::vector< Facet * > allFacets
storing all the facets
Definition: PMLTransform.h:108
StructuralComponent.h
Facet::getUsed
unsigned int getUsed() const
get the number of time it is being used
Definition: Facet.cpp:128
Facet::~Facet
virtual ~Facet()
destructor
Definition: Facet.cpp:44
MultiComponent::addSubComponent
void addSubComponent(Component *)
add a component in the list of subcomponents (and set the isExclusive flag accordingly to the state o...
Definition: MultiComponent.h:122
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
Facet::debug
void debug()
print on stdout
Definition: Facet.cpp:49
Facet::testEquivalence
bool testEquivalence(unsigned int size, unsigned int id[])
if it is the same (equivalent) facet, increment used (return true if equivalence)
Definition: Facet.cpp:70
StructuralComponent::getStructure
Structure * getStructure(const unsigned int) const
get a structure by its index (fisrt structure is at index 0)
Definition: StructuralComponent.h:220
PhysicalModel.h
Facet::size
unsigned int size
nr of atoms composing the facet (3 = triangle, 4 = quad)
Definition: Facet.h:89
Facet::isIn
bool isIn(unsigned int) const
is this atom index present in this facet (no check on the order)
Definition: Facet.cpp:89
Facet::Facet
Facet(unsigned int size, unsigned int id[])
create a facet using size nodes and their indexes
Definition: Facet.cpp:34
Facet::id
unsigned int * id
the facet atom indexes
Definition: Facet.h:86
StructuralComponent::getCell
Cell * getCell(unsigned int) const override
get cell by order number (not cell index)
Definition: StructuralComponent.cpp:197
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
MultiComponent.h
StructureProperties::QUAD
@ QUAD
the structure is a quad, i.e it must be a cell composed of 4 atoms
Definition: StructureProperties.h:158
PMLTransform.h
PMLTransform::neighMap
static std::map< unsigned int, Cell * > neighMap
Definition: PMLTransform.h:104
StructuralComponent::getNumberOfCells
unsigned int getNumberOfCells() const override
get the total nr of cell of the component
Definition: StructuralComponent.cpp:183
Facet::used
unsigned int used
nr of times the facet is used
Definition: Facet.h:92
MultiComponent
A multi-component stores other components, hence providing a way to have an tree representation of co...
Definition: MultiComponent.h:44
StructuralComponent::addStructureIfNotIn
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 ad...
Definition: StructuralComponent.cpp:248
Component::getPhysicalModel
PhysicalModel * getPhysicalModel() const
get the physical model
Definition: modeling/libraries/pml/Component.h:184
PMLTransform::generateExternalSurface
static MultiComponent * generateExternalSurface(StructuralComponent *sc)
generate the outside surface
Definition: PMLTransform.cpp:380