Computer Assited Medical Intervention Tool Kit  version 4.0
AtomDC.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2016 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 AtomDC_H
27 #define AtomDC_H
28 
29 #include <set>
30 #include <camitkcore/Component.h> // Do not remove the camitkcore/ prefix (two classes are named Component, one in pml/pmlschema and the other one is the CamiTK Component)
31 #include <GeometricObject.h>
32 
33 #include <vtkFollower.h>
34 #include <vtkSmartPointer.h>
35 class QPixmap;
36 class QMenu;
37 
38 #include "PMComponentAPI.h"
39 class PMManagerDC;
40 class Atom;
42 class AtomDCProperties;
43 class AtomDCPopup;
44 class AtomDecoration;
45 
46 namespace std {
47 
51 typedef std::pair<camitk::InterfaceNode *, unsigned int> IndexInParentItemPair;
58 typedef std::map <camitk::InterfaceNode *, unsigned int> IndexInParentItemMap;
60 typedef std::map <camitk::InterfaceNode *, unsigned int>::iterator IndexInParentItemMapIterator;
61 }
75  Q_OBJECT
76 public:
77  AtomDC(camitk::Component *parent, PMManagerDC * pmManagerDC, Atom *);
78  virtual ~AtomDC();
79 
82 
85  virtual void setParent(InterfaceNode *);
86 
87  virtual QPixmap getIcon();
88 
90  void pointPicked(vtkIdType, bool);
91 
93  virtual void setSelected(const bool, const bool recursive=false);
94 
96  virtual void setEnhancedModes(const EnhancedModes);
97 
99  virtual void setName(const QString &);
100 
102  virtual void setPointSet(vtkSmartPointer<vtkPointSet>);
103 
105  virtual QMenu * getPopupMenu(QWidget* parent);
106 
108  virtual QWidget * getPropertyWidget(QWidget* parent = 0);
109 
111  virtual QObject * getPropertyObject();
112 
114  virtual bool doubleClicked();
116 
118  void setPosition(double, double, double);
119 
121  void getPosition(double &, double &, double &);
122 
127  void updatePosition();
128 
130  void resetAlreadyMovedFlag();
131 
133  Atom * getAtom();
134 
137  return myPMManagerDC;
138  }
139 
144  unsigned int registerIndexInSCDC(const std::IndexInParentItemPair);
145 
149  unsigned int unregisterIndexInSCDC(StructuralComponentDC *);
150 
152  int getOrderNumberInSCDC(StructuralComponentDC *);
153 
155  void addPointData(StructuralComponentDC *, double *);
156 
158  void clearPointData();
159 
161  void updatePointData(const double);
162 
169  AtomDecoration *getDecoration(const QString & name, camitk::GeometricObject::Geometry t);
170 
171 private:
172 
175 
177  virtual void initRepresentation();
178 
188 
193 
196 
199 
201  static QPixmap * myPixmap;
202 
204  std::vector<double *> pointData;
205 
207  std::set<StructuralComponentDC *> pointDataSC;
208 
210  QMap<QString, AtomDecoration*> decorations;
211 
214 
215 };
216 
217 inline Atom * AtomDC::getAtom() {
218  return myAtom;
219 }
220 
221 #endif
The manager of the physical model data.
Definition: PMManagerDC.h:97
std::map< camitk::InterfaceNode *, unsigned int > IndexInParentItemMap
definition of the association set (=map in STL) IndexInParentItemMap.
Definition: AtomDC.h:58
This class allows you to display a geometric object (arrow, sphere, ...) positionned on an atom...
Definition: AtomDecoration.h:46
std::set< StructuralComponentDC * > pointDataSC
list of all the SC who asked for a point data in this AtomDC
Definition: AtomDC.h:207
static QPixmap * myPixmap
the AtomDC pixmap
Definition: AtomDC.h:201
Atom * getAtom()
get the atom this dc is representing
Definition: AtomDC.h:217
STL namespace.
#define PHYSICALMODEL_COMPONENT_API
Definition: PMComponentAPI.h:54
QMap< QString, AtomDecoration * > decorations
list of decorations attached to this AtomDC
Definition: AtomDC.h:210
The popup menu of the atom data component.
Definition: AtomDCPopup.h:38
std::pair< camitk::InterfaceNode *, unsigned int > IndexInParentItemPair
definition of a couple (=STL pair) [InterfaceNode *, unsigned int] this associates a parent data comp...
Definition: AtomDC.h:51
The class AtomDCProperties defines an object that allows interaction of some properties of an atom...
Definition: AtomDCProperties.h:47
std::map< camitk::InterfaceNode *, unsigned int >::iterator IndexInParentItemMapIterator
the iterator corresponding to the IndexInParentItemMap map
Definition: AtomDC.h:60
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:299
The manager of the Atom data.
Definition: AtomDC.h:74
AtomDCProperties * myProp
the atom&#39;properties
Definition: AtomDC.h:198
Atom * myAtom
The atom the dc is representing.
Definition: AtomDC.h:174
PMManagerDC * myPMManagerDC
the PMManagerDC
Definition: AtomDC.h:213
bool alreadyMoved
true if the atom has been already moved by another SC This is a way to solve the bug which occurs whe...
Definition: AtomDC.h:187
The manager of the Structural component data.
Definition: StructuralComponentDC.h:83
An atom has an unique index in the physical model object, a 3D position, and different basic properti...
Definition: Atom.h:49
std::IndexInParentItemMap mySCDCindexes
correspondance between a SCDC and the order number of this atom dc in a particular SCDC (parent items...
Definition: AtomDC.h:192
std::vector< double * > pointData
list of all the point data adresses
Definition: AtomDC.h:204
Geometry
the geometric type
Definition: GeometricObject.h:58
AtomDCPopup * myPopupMenu
the popup menu
Definition: AtomDC.h:195
virtual PMManagerDC * getPMManagerDC()
get the PMManagerDC (given during instanciation), allows one to get PML/Component maps ...
Definition: AtomDC.h:136