Computer Assited Medical Intervention Tool Kit  version 4.1
Cell.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2018 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
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 CELL_H
27 #define CELL_H
28 
29 #include "Structure.h"
30 #include "StructuralComponent.h"
31 
32 //pmlschema forward declarations
33 namespace physicalModel {
34 class Cell;
35 }
36 
37 class CellProperties;
46 class Cell : public Structure, public StructuralComponent {
47 public:
53 
59  Cell(PhysicalModel* myPM, physicalModel::Cell xmlCell, StructuralComponent* sc);
60 
66  Cell(PhysicalModel* myPM, const StructureProperties::GeometricType t, const unsigned int ind);
67 
69  ~Cell() override;
70 
76  void xmlPrint(std::ostream&, const StructuralComponent*) override;
77 
79  bool isInstanceOf(const char*) const override;
80 
87  void deleteAllStructures() override;
88 
90  CellProperties* getProperties();
91 
93  StructuralComponent::ComposedBy composedBy() override;
94 
98  bool makePrintData(const StructuralComponent*);
99 
106  bool setIndex(const unsigned int) override;
107 
111  double* normal();
112 
114  StructuralComponent* getQuadFaces();
115 
117  StructuralComponent* getTriangleFaces();
118 
120  double surface();
121 
123  double volume();
124 
136  double signedVolumeTriangle(double p1[3], double p2[3], double p3[3]);
137 
140  return this->parentSC;
141  }
142 
144  void addStructuralComponent(StructuralComponent*) override;
145 
146 private:
149 
150 };
151 
152 // ------- INLINE -----------
153 inline bool Cell::isInstanceOf(const char* className) const {
154  return (std::string(className) == std::string("Cell"));
155 }
156 
159 }
160 
163  if (!parentSC) {
164  parentSC = sc;
165  }
166 }
167 
168 #endif //CELL_H
A cell has an unique index in the physical model object, is composed by atoms, and different basic pr...
Definition: Cell.h:46
const StructuralComponent * getParentSC()
Get the direct parent structural that own this cell.
Definition: Cell.h:139
bool isInstanceOf(const char *) const override
return true only if the parameter is equal to "MultiComponent"
Definition: Cell.h:153
Pure virtual class that represent an element of the structure.
Definition: Structure.h:43
ComposedBy
What this structural component is made of.
Definition: StructuralComponent.h:173
StructuralComponent * parentSC
Keep a reference to the direct parent structural component.
Definition: Cell.h:148
Definition: Atom.h:36
void addStructuralComponent(StructuralComponent *) override
add a particular StructuralComponent in the list (and set parentSC if null)
Definition: Cell.h:161
This is the main class of this project.
Definition: PhysicalModel.h:86
the structural component is made of atoms
Definition: StructuralComponent.h:176
GeometricType
Geometric type gives information about which kind of geometric representation is the structure...
Definition: StructureProperties.h:107
A structural component is composed either by cell or by atoms.
Definition: StructuralComponent.h:52
Describes and manages the properties attached to cells.
Definition: CellProperties.h:44
StructuralComponent::ComposedBy composedBy() override
overloaded from Structural component, always return StructuralComponent::ATOMS
Definition: Cell.h:157
virtual void addStructuralComponent(StructuralComponent *)
add a particular StructuralComponent in the list
Definition: Structure.h:128