Computer Assisted Medical Intervention Tool Kit  version 5.2
PMLExplorerWidget.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2024 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, 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 PMLEXPLORERWIDGET_H
27 #define PMLEXPLORERWIDGET_H
28 
29 // Qt includes
30 #include <QWidget>
31 #include <QMap>
32 class QTreeWidgetItem;
33 
34 // Qt Designer generated .ui
35 namespace Ui {
36 class ui_PmlExplorerWidget;
37 }
38 
39 namespace camitk {
40 class ObjectController;
41 }
42 
43 // CamiTK forward declaration
44 class PMLComponent;
45 class CamiTKPropertyList;
46 
47 // Pml forward declaration
48 class PhysicalModel;
49 class MultiComponent;
51 class Atom;
52 class Cell;
53 class Component;
54 
55 
66 class PMLExplorerWidget : public QWidget {
67  Q_OBJECT
68 
69 public:
72 
74  ~PMLExplorerWidget() override; //{ if (this->ui) delete ui; }
75 
77  void updateTarget(PMLComponent* comp);
78 
79 public slots:
81  void propertyChanged();
82 
84  void createNewProperty();
85 
87  void showAtomGlyphToggled(bool);
88 
89 private slots:
90 
93  void selectItems();
94 
95 private:
97  PMLComponent* pmlComponent;
98 
101 
103  Ui::ui_PmlExplorerWidget* ui;
104 
107  QMap<QTreeWidgetItem*, Component*> widgetComponentMap;
108 
111  QMap<QTreeWidgetItem*, Atom*> widgetAtomMap;
112 
119  QMap<QTreeWidgetItem*, QObject*> widgetPropertiesMap;
120 
123  QMap<Atom*, QObject*> atomPropertiesMap;
124 
126  void updateProperty(QTreeWidgetItem*);
127 
129  camitk::ObjectController* objectController;
130 
132  QTreeWidgetItem* editedItem;
133 
135  bool showAtomGlyph;
136 
139 
141  void init(PMLComponent*);
142 
144  QTreeWidgetItem* physicalModelItem;
145 
147  QTreeWidgetItem* atomsItem;
148 
150  QTreeWidgetItem* exclusiveComponentItem;
151 
153  QTreeWidgetItem* informativeComponentItem;
154 
158  void buildPhysicalModelTreeWidgetItem();
159 
164  QTreeWidgetItem* buildMultiComponentTreeWidgetItem(MultiComponent* multiComponent, QTreeWidgetItem* parent);
165 
170  QTreeWidgetItem* buildStructuralComponentTreeWidgetItem(StructuralComponent* sc, QTreeWidgetItem* parent);
171 
176  QTreeWidgetItem* buildCellTreeWidgetItem(Cell* cell, QTreeWidgetItem* parent);
177 
182  QTreeWidgetItem* buildAtomTreeWidgetItem(Atom* atom, QTreeWidgetItem* parent);
184 
188  CamiTKPropertyList* createAtomPropertyList(Atom*);
189 
191  CamiTKPropertyList* createCellPropertyList(Cell*);
192 
194  CamiTKPropertyList* createMCPropertyList(MultiComponent*);
195 
197  CamiTKPropertyList* createSCPropertyList(StructuralComponent*);
198 
200 };
201 
202 
203 #endif // PMLEXPLORERWIDGET_H
An atom has an unique index in the physical model object, a 3D position, and different basic properti...
Definition: Atom.h:49
This class holds a list of CamiTK Properties and can be used as an editable QObject for the ObjectCon...
Definition: CamiTKPropertyList.h:35
A cell has an unique index in the physical model object, is composed by atoms, and different basic pr...
Definition: Cell.h:46
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:48
A multi-component stores other components, hence providing a way to have an tree representation of co...
Definition: MultiComponent.h:44
Definition: objectcontroller.h:47
This class manages a physical model (PML) CamiTK component.
Definition: PMLComponent.h:103
This class is the Pml explore action widget presented/controller.
Definition: PMLExplorerWidget.h:66
void updateTarget(PMLComponent *comp)
Update the widget content as the input selected component changed.
Definition: PMLExplorerWidget.cpp:258
PMLExplorerWidget(PMLComponent *comp)
Constructor.
Definition: PMLExplorerWidget.cpp:54
void createNewProperty()
called when the user click on new in the object controller
Definition: PMLExplorerWidget.cpp:377
void showAtomGlyphToggled(bool)
This slot is connected to the corresponding UI Checkbox, update the showAtomGlyph state.
Definition: PMLExplorerWidget.cpp:207
void propertyChanged()
called when the user click on apply in the object controller
Definition: PMLExplorerWidget.cpp:604
~PMLExplorerWidget() override
Destructor.
Definition: PMLExplorerWidget.cpp:76
This is the main class of this project.
Definition: PhysicalModel.h:86
A structural component is composed either by cell or by atoms.
Definition: StructuralComponent.h:52
The object controller class.
Definition: ObjectController.h:162
Definition: SettingsDialog.h:31
Definition: Action.cpp:36
Definition: Atom.h:36