Computer Assited Medical Intervention Tool Kit  version 5.0
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-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 PMLEXPLORERWIDGET_H
27#define PMLEXPLORERWIDGET_H
28
29// Qt includes
30#include <QWidget>
31#include <QMap>
32class QTreeWidgetItem;
33
34// Qt Designer generated .ui
35namespace Ui {
36class ui_PmlExplorerWidget;
37}
38
39namespace camitk {
41}
42
43// CamiTK forward declaration
44class PMLComponent;
46
47// Pml forward declaration
48class PhysicalModel;
49class MultiComponent;
51class Atom;
52class Cell;
53class Component;
54
55
66class PMLExplorerWidget : public QWidget {
67 Q_OBJECT
68
69public:
72
74 ~PMLExplorerWidget() override; //{ if (this->ui) delete ui; }
75
77 void updateTarget(PMLComponent* comp);
78
79public slots:
81 void propertyChanged();
82
84 void createNewProperty();
85
87 void showAtomGlyphToggled(bool);
88
89private slots:
90
93 void selectItems();
94
95private:
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
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
189
192
195
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
CamiTKPropertyList * createCellPropertyList(Cell *)
Creates a CamiTKPropertyList for this cell or get the existing one.
Definition: PMLExplorerWidget.cpp:485
PMLExplorerWidget(PMLComponent *comp)
Constructor.
Definition: PMLExplorerWidget.cpp:54
QTreeWidgetItem * buildCellTreeWidgetItem(Cell *cell, QTreeWidgetItem *parent)
Add an entry for the current cell to the widget.
Definition: PMLExplorerWidget.cpp:183
bool showAtomGlyph
the state of the show atom glyph checkbox
Definition: PMLExplorerWidget.h:135
void createNewProperty()
called when the user click on new in the object controller
Definition: PMLExplorerWidget.cpp:377
CamiTKPropertyList * createMCPropertyList(MultiComponent *)
Creates a CamiTKPropertyList for this MC or get the existing one.
Definition: PMLExplorerWidget.cpp:579
QMap< Atom *, QObject * > atomPropertiesMap
Map QTreeWidgetItem <-> CamiTKPropertyList for atom For the atoms, there is only one CamiTKPropertyLi...
Definition: PMLExplorerWidget.h:123
void buildPhysicalModelTreeWidgetItem()
Parse the basic contents of the PML component: its atoms, exclusive and informative components and ca...
Definition: PMLExplorerWidget.cpp:90
QMap< QTreeWidgetItem *, Component * > widgetComponentMap
A pml::component <-> QTreeWidgetItem map to find out, once selected the corresponding pml::Component ...
Definition: PMLExplorerWidget.h:107
QTreeWidgetItem * buildMultiComponentTreeWidgetItem(MultiComponent *multiComponent, QTreeWidgetItem *parent)
Recursive method to add an entry for the current multicomponent to the widget.
Definition: PMLExplorerWidget.cpp:127
QMap< QTreeWidgetItem *, Atom * > widgetAtomMap
A pml::Atom <-> QTreeWidgetItem map to find out, once selected the corresponding pml::Atom associated...
Definition: PMLExplorerWidget.h:111
void showAtomGlyphToggled(bool)
This slot is connected to the corresponding UI Checkbox, update the showAtomGlyph state.
Definition: PMLExplorerWidget.cpp:207
QTreeWidgetItem * informativeComponentItem
the informative component MC tree widget item
Definition: PMLExplorerWidget.h:153
QTreeWidgetItem * buildAtomTreeWidgetItem(Atom *atom, QTreeWidgetItem *parent)
Add an entry for the current atom to the widget.
Definition: PMLExplorerWidget.cpp:171
QTreeWidgetItem * editedItem
item being currently edited
Definition: PMLExplorerWidget.h:132
void init(PMLComponent *)
initialize component, physicalmodel and interaction
Definition: PMLExplorerWidget.cpp:291
CamiTKPropertyList * createAtomPropertyList(Atom *)
Definition: PMLExplorerWidget.cpp:431
CamiTKPropertyList * createSCPropertyList(StructuralComponent *)
Creates a CamiTKPropertyList for this SC or get the existing one.
Definition: PMLExplorerWidget.cpp:527
PMLComponent * pmlComponent
The PML Component associated with the action.
Definition: PMLExplorerWidget.h:97
camitk::ObjectController * objectController
the QObject are displaying properties in the ObjectController
Definition: PMLExplorerWidget.h:129
QTreeWidgetItem * physicalModelItem
The main tree widget items, at the base of the structure.
Definition: PMLExplorerWidget.h:144
void selectItems()
The slot defined to select the QTreeWidgetItem in its corresponding pml element (SC,...
Definition: PMLExplorerWidget.cpp:213
Ui::ui_PmlExplorerWidget * ui
The graphical user interface automatically generated by the moc and QtDesigner.
Definition: PMLExplorerWidget.h:103
QTreeWidgetItem * atomsItem
the atom SC tree widget item
Definition: PMLExplorerWidget.h:147
QTreeWidgetItem * exclusiveComponentItem
the exclusive component MC tree widget item
Definition: PMLExplorerWidget.h:150
void propertyChanged()
called when the user click on apply in the object controller
Definition: PMLExplorerWidget.cpp:604
void updateProperty(QTreeWidgetItem *)
build a QObject from physical model properties
Definition: PMLExplorerWidget.cpp:325
QTreeWidgetItem * buildStructuralComponentTreeWidgetItem(StructuralComponent *sc, QTreeWidgetItem *parent)
Add an entry for the current structural component to the widget.
Definition: PMLExplorerWidget.cpp:149
~PMLExplorerWidget() override
Destructor.
Definition: PMLExplorerWidget.cpp:76
QMap< QTreeWidgetItem *, QObject * > widgetPropertiesMap
Map QTreeWidgetItem <-> CamiTKPropertyList for all PML components (Cell, SC, MC).
Definition: PMLExplorerWidget.h:119
PhysicalModel * physicalModel
The PML Component to explore with the action.
Definition: PMLExplorerWidget.h:100
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:35