Computer Assited Medical Intervention Tool Kit  version 4.1
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-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 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:
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 
130 
132  QTreeWidgetItem* editedItem;
133 
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
A cell has an unique index in the physical model object, is composed by atoms, and different basic pr...
Definition: Cell.h:46
QTreeWidgetItem * physicalModelItem
The main tree widget items, at the base of the structure.
Definition: PMLExplorerWidget.h:144
Ui::ui_PmlExplorerWidget * ui
The graphical user interface automatically generated by the moc and QtDesigner.
Definition: PMLExplorerWidget.h:103
QTreeWidgetItem * exclusiveComponentItem
the exclusive component MC tree widget item
Definition: PMLExplorerWidget.h:150
QMap< QTreeWidgetItem *, Component * > widgetComponentMap
A pml::component <-> QTreeWidgetItem map to find out, once selected the corresponding pml::Component ...
Definition: PMLExplorerWidget.h:107
Definition: SettingsDialog.h:31
QMap< Atom *, QObject * > atomPropertiesMap
Map QTreeWidgetItem <-> CamiTKPropertyList for atom For the atoms, there is only one CamiTKPropertyLi...
Definition: PMLExplorerWidget.h:123
QMap< QTreeWidgetItem *, QObject * > widgetPropertiesMap
Map QTreeWidgetItem <-> CamiTKPropertyList for all PML components (Cell, SC, MC). ...
Definition: PMLExplorerWidget.h:119
This class holds a list of CamiTK Properties and can be used as an editable QObject for the ObjectCon...
Definition: CamiTKPropertyList.h:35
Definition: Action.cpp:36
PhysicalModel * physicalModel
The PML Component to explore with the action.
Definition: PMLExplorerWidget.h:100
camitk::ObjectController * objectController
the QObject are displaying properties in the ObjectController
Definition: PMLExplorerWidget.h:129
This class manages a physical model (PML) CamiTK component.
Definition: PMLComponent.h:99
bool showAtomGlyph
the state of the show atom glyph checkbox
Definition: PMLExplorerWidget.h:135
This class is the Pml explore action widget presented/controller.
Definition: PMLExplorerWidget.h:66
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:48
QMap< QTreeWidgetItem *, Atom * > widgetAtomMap
A pml::Atom <-> QTreeWidgetItem map to find out, once selected the corresponding pml::Atom associated...
Definition: PMLExplorerWidget.h:111
An atom has an unique index in the physical model object, a 3D position, and different basic properti...
Definition: Atom.h:49
This is the main class of this project.
Definition: PhysicalModel.h:86
QTreeWidgetItem * atomsItem
the atom SC tree widget item
Definition: PMLExplorerWidget.h:147
QTreeWidgetItem * informativeComponentItem
the informative component MC tree widget item
Definition: PMLExplorerWidget.h:153
A structural component is composed either by cell or by atoms.
Definition: StructuralComponent.h:52
Definition: objectcontroller.h:47
PMLComponent * pmlComponent
The PML Component associated with the action.
Definition: PMLExplorerWidget.h:97
A multi-component stores other components, hence providing a way to have an tree representation of co...
Definition: MultiComponent.h:44
The object controller class.
Definition: ObjectController.h:162
QTreeWidgetItem * editedItem
item being currently edited
Definition: PMLExplorerWidget.h:132