Computer Assited Medical Intervention Tool Kit  version 5.0
PMLExplorerWidget Class Reference

This class is the Pml explore action widget presented/controller. More...

#include <PMLExplorerWidget.h>

+ Inheritance diagram for PMLExplorerWidget:
+ Collaboration diagram for PMLExplorerWidget:

Public Slots

void createNewProperty ()
 called when the user click on new in the object controller More...
 
void propertyChanged ()
 called when the user click on apply in the object controller More...
 
void showAtomGlyphToggled (bool)
 This slot is connected to the corresponding UI Checkbox, update the showAtomGlyph state. More...
 

Public Member Functions

 PMLExplorerWidget (PMLComponent *comp)
 Constructor. More...
 
void updateTarget (PMLComponent *comp)
 Update the widget content as the input selected component changed. More...
 
 ~PMLExplorerWidget () override
 Destructor. More...
 

Private Slots

void selectItems ()
 The slot defined to select the QTreeWidgetItem in its corresponding pml element (SC, MC, Atom or Cell) to correctly highlight it in the 3D structure and display its properties. More...
 

Private Member Functions

void updateProperty (QTreeWidgetItem *)
 build a QObject from physical model properties More...
 
PML components and atoms properties

Creates a CamiTKPropertyList for this atom or get the existing one

CamiTKPropertyListcreateAtomPropertyList (Atom *)
 
CamiTKPropertyListcreateCellPropertyList (Cell *)
 Creates a CamiTKPropertyList for this cell or get the existing one. More...
 
CamiTKPropertyListcreateMCPropertyList (MultiComponent *)
 Creates a CamiTKPropertyList for this MC or get the existing one. More...
 
CamiTKPropertyListcreateSCPropertyList (StructuralComponent *)
 Creates a CamiTKPropertyList for this SC or get the existing one. More...
 

Private Attributes

QMap< Atom *, QObject * > atomPropertiesMap
 Map QTreeWidgetItem <-> CamiTKPropertyList for atom For the atoms, there is only one CamiTKPropertyList per atom. More...
 
QTreeWidgetItem * editedItem
 item being currently edited More...
 
camitk::ObjectControllerobjectController
 the QObject are displaying properties in the ObjectController More...
 
PhysicalModelphysicalModel
 The PML Component to explore with the action. More...
 
PMLComponentpmlComponent
 The PML Component associated with the action. More...
 
bool showAtomGlyph
 the state of the show atom glyph checkbox More...
 
Ui::ui_PmlExplorerWidget * ui
 The graphical user interface automatically generated by the moc and QtDesigner. More...
 
QMap< QTreeWidgetItem *, Atom * > widgetAtomMap
 A pml::Atom <-> QTreeWidgetItem map to find out, once selected the corresponding pml::Atom associated to the QTreeWidgetItem. More...
 
QMap< QTreeWidgetItem *, Component * > widgetComponentMap
 A pml::component <-> QTreeWidgetItem map to find out, once selected the corresponding pml::Component (StructuralComponent, MultiComponent or Cell) associated to the QTreeWidgetItem. More...
 
QMap< QTreeWidgetItem *, QObject * > widgetPropertiesMap
 Map QTreeWidgetItem <-> CamiTKPropertyList for all PML components (Cell, SC, MC). More...
 

Tree widget item management

QTreeWidgetItem * physicalModelItem
 The main tree widget items, at the base of the structure. More...
 
QTreeWidgetItem * atomsItem
 the atom SC tree widget item More...
 
QTreeWidgetItem * exclusiveComponentItem
 the exclusive component MC tree widget item More...
 
QTreeWidgetItem * informativeComponentItem
 the informative component MC tree widget item More...
 
void init (PMLComponent *)
 initialize component, physicalmodel and interaction More...
 
void buildPhysicalModelTreeWidgetItem ()
 Parse the basic contents of the PML component: its atoms, exclusive and informative components and call other methods to fill the widget with the pml structure. More...
 
QTreeWidgetItem * buildMultiComponentTreeWidgetItem (MultiComponent *multiComponent, QTreeWidgetItem *parent)
 Recursive method to add an entry for the current multicomponent to the widget. More...
 
QTreeWidgetItem * buildStructuralComponentTreeWidgetItem (StructuralComponent *sc, QTreeWidgetItem *parent)
 Add an entry for the current structural component to the widget. More...
 
QTreeWidgetItem * buildCellTreeWidgetItem (Cell *cell, QTreeWidgetItem *parent)
 Add an entry for the current cell to the widget. More...
 
QTreeWidgetItem * buildAtomTreeWidgetItem (Atom *atom, QTreeWidgetItem *parent)
 Add an entry for the current atom to the widget. More...
 

Detailed Description

This class is the Pml explore action widget presented/controller.

It allows to map the graphical treeview widget from the pml object.

Considering the MVP pattern:

  • M = the PMLComponent and the PhysicalModel instances it encapsulates
  • V = the Qt Widget build using Qt Designer (ui_pmlExploreWidget)
  • P = this class, it uses the data in the PMLComponent/PhysicalModel to build the GUI representation (update the widget) and use the user feedback to modify the PMLComponent/PhysicalModel.

Constructor & Destructor Documentation

◆ PMLExplorerWidget()

PMLExplorerWidget::PMLExplorerWidget ( PMLComponent comp)

Constructor.

References atomsItem, camitk::ObjectController::BUTTON, createNewProperty(), exclusiveComponentItem, informativeComponentItem, init(), objectController, physicalModelItem, propertyChanged(), showAtomGlyphToggled(), and ui.

+ Here is the call graph for this function:

◆ ~PMLExplorerWidget()

PMLExplorerWidget::~PMLExplorerWidget ( )
override

Destructor.

References objectController, ui, and widgetPropertiesMap.

Member Function Documentation

◆ buildAtomTreeWidgetItem()

QTreeWidgetItem * PMLExplorerWidget::buildAtomTreeWidgetItem ( Atom atom,
QTreeWidgetItem *  parent 
)
private

Add an entry for the current atom to the widget.

Parameters
atomthe current atom parsed to add to the widget
parentthe parent QTreeWidgetItem
Returns
the atom item

References Structure::getIndex(), and widgetAtomMap.

Referenced by buildCellTreeWidgetItem(), and buildStructuralComponentTreeWidgetItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildCellTreeWidgetItem()

QTreeWidgetItem * PMLExplorerWidget::buildCellTreeWidgetItem ( Cell cell,
QTreeWidgetItem *  parent 
)
private

Add an entry for the current cell to the widget.

Parameters
cellthe current cell parsed to add to the widget
parentthe parent QTreeWidgetItem
Returns
the top-level item

References a, buildAtomTreeWidgetItem(), Structure::getIndex(), StructuralComponent::getNumberOfStructures(), StructuralComponent::getStructure(), Structure::hasIndex, and widgetComponentMap.

Referenced by buildStructuralComponentTreeWidgetItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildMultiComponentTreeWidgetItem()

QTreeWidgetItem * PMLExplorerWidget::buildMultiComponentTreeWidgetItem ( MultiComponent multiComponent,
QTreeWidgetItem *  parent 
)
private

Recursive method to add an entry for the current multicomponent to the widget.

Parameters
multiComponentthe current multiComponent to add to the widget
parentthe parent QTreeWidgetItem
Returns
the top-level item

References buildStructuralComponentTreeWidgetItem(), Component::getName(), MultiComponent::getNumberOfSubComponents(), MultiComponent::getSubComponent(), and widgetComponentMap.

Referenced by buildPhysicalModelTreeWidgetItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildPhysicalModelTreeWidgetItem()

void PMLExplorerWidget::buildPhysicalModelTreeWidgetItem ( )
private

Parse the basic contents of the PML component: its atoms, exclusive and informative components and call other methods to fill the widget with the pml structure.

Returns
the top-level item

References atomsItem, buildMultiComponentTreeWidgetItem(), buildStructuralComponentTreeWidgetItem(), editedItem, exclusiveComponentItem, PMLComponent::getIcon(), informativeComponentItem, physicalModelItem, pmlComponent, and ui.

Referenced by init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildStructuralComponentTreeWidgetItem()

QTreeWidgetItem * PMLExplorerWidget::buildStructuralComponentTreeWidgetItem ( StructuralComponent sc,
QTreeWidgetItem *  parent 
)
private

Add an entry for the current structural component to the widget.

Parameters
scthe current structural component to add to the widget
parentthe parent QTreeWidgetItem
Returns
the top-level item

References a, buildAtomTreeWidgetItem(), buildCellTreeWidgetItem(), Component::getName(), StructuralComponent::getNumberOfStructures(), StructuralComponent::getStructure(), and widgetComponentMap.

Referenced by buildMultiComponentTreeWidgetItem(), and buildPhysicalModelTreeWidgetItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createAtomPropertyList()

CamiTKPropertyList * PMLExplorerWidget::createAtomPropertyList ( Atom a)
private

References a, PMLComponent::getPointId(), camitk::InterfaceGeometry::getPointSet(), pmlComponent, and camitk::Property::setGroupName().

Referenced by updateProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createCellPropertyList()

CamiTKPropertyList * PMLExplorerWidget::createCellPropertyList ( Cell c)
private

Creates a CamiTKPropertyList for this cell or get the existing one.

References Structure::getIndex(), StructuralComponent::getNumberOfStructures(), Cell::getProperties(), StructureProperties::getType(), camitk::Property::setReadOnly(), and StructureProperties::toString().

Referenced by updateProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createMCPropertyList()

CamiTKPropertyList * PMLExplorerWidget::createMCPropertyList ( MultiComponent mc)
private

Creates a CamiTKPropertyList for this MC or get the existing one.

References Properties::getField(), Component::getName(), MultiComponent::getNumberOfSubComponents(), Component::getProperties(), Properties::getString(), and camitk::Property::setReadOnly().

Referenced by updateProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createNewProperty

void PMLExplorerWidget::createNewProperty ( )
slot

called when the user click on new in the object controller

References a, CamiTKPropertyList::addProperty(), camitk::Component::addProperty(), atomPropertiesMap, editedItem, objectController, physicalModelItem, pmlComponent, camitk::ObjectController::setObject(), widgetAtomMap, widgetComponentMap, and widgetPropertiesMap.

Referenced by PMLExplorerWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createSCPropertyList()

CamiTKPropertyList * PMLExplorerWidget::createSCPropertyList ( StructuralComponent sc)
private

Creates a CamiTKPropertyList for this SC or get the existing one.

References StructuralComponent::ATOMS, StructuralComponent::CELLS, StructuralComponent::composedBy(), StructuralComponent::getColor(), Properties::getField(), Component::getName(), StructuralComponent::getNumberOfStructures(), StructuralComponent::getProperties(), Properties::getString(), and camitk::Property::setReadOnly().

Referenced by updateProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

void PMLExplorerWidget::init ( PMLComponent comp)
private

initialize component, physicalmodel and interaction

References buildPhysicalModelTreeWidgetItem(), exclusiveComponentItem, camitk::Component::getName(), PMLComponent::getPhysicalModel(), informativeComponentItem, physicalModelItem, pmlComponent, selectItems(), showAtomGlyph, and ui.

Referenced by PMLExplorerWidget(), and updateTarget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ propertyChanged

void PMLExplorerWidget::propertyChanged ( )
slot

called when the user click on apply in the object controller

References a, atomPropertiesMap, editedItem, Component::getProperties(), physicalModelItem, pmlComponent, camitk::Component::refresh(), PMLComponent::refreshDisplay(), Properties::set(), camitk::Component::setModified(), Component::setName(), Structure::setName(), widgetAtomMap, widgetComponentMap, and widgetPropertiesMap.

Referenced by PMLExplorerWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ selectItems

void PMLExplorerWidget::selectItems ( )
privateslot

The slot defined to select the QTreeWidgetItem in its corresponding pml element (SC, MC, Atom or Cell) to correctly highlight it in the 3D structure and display its properties.

References pmlComponent, PMLComponent::refreshDisplay(), PMLComponent::selectAtom(), PMLComponent::selectCell(), PMLComponent::selectMC(), PMLComponent::selectSC(), showAtomGlyph, ui, PMLComponent::unselectItems(), updateProperty(), PMLComponent::updateSelection(), widgetAtomMap, and widgetComponentMap.

Referenced by init(), showAtomGlyphToggled(), and updateTarget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showAtomGlyphToggled

void PMLExplorerWidget::showAtomGlyphToggled ( bool  checkBoxState)
slot

This slot is connected to the corresponding UI Checkbox, update the showAtomGlyph state.

References selectItems(), and showAtomGlyph.

Referenced by PMLExplorerWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateProperty()

void PMLExplorerWidget::updateProperty ( QTreeWidgetItem *  item)
private

build a QObject from physical model properties

References a, atomPropertiesMap, createAtomPropertyList(), createCellPropertyList(), createMCPropertyList(), createSCPropertyList(), editedItem, objectController, physicalModelItem, pmlComponent, camitk::ObjectController::setObject(), widgetAtomMap, widgetComponentMap, and widgetPropertiesMap.

Referenced by selectItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateTarget()

void PMLExplorerWidget::updateTarget ( PMLComponent comp)

Update the widget content as the input selected component changed.

References atomPropertiesMap, atomsItem, editedItem, exclusiveComponentItem, informativeComponentItem, init(), objectController, physicalModelItem, selectItems(), camitk::ObjectController::setObject(), ui, widgetAtomMap, widgetComponentMap, and widgetPropertiesMap.

Referenced by PMLExplorerAction::getWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ atomPropertiesMap

QMap<Atom*, QObject*> PMLExplorerWidget::atomPropertiesMap
private

Map QTreeWidgetItem <-> CamiTKPropertyList for atom For the atoms, there is only one CamiTKPropertyList per atom.

Referenced by createNewProperty(), propertyChanged(), updateProperty(), and updateTarget().

◆ atomsItem

QTreeWidgetItem* PMLExplorerWidget::atomsItem
private

the atom SC tree widget item

Referenced by buildPhysicalModelTreeWidgetItem(), PMLExplorerWidget(), and updateTarget().

◆ editedItem

QTreeWidgetItem* PMLExplorerWidget::editedItem
private

◆ exclusiveComponentItem

QTreeWidgetItem* PMLExplorerWidget::exclusiveComponentItem
private

the exclusive component MC tree widget item

Referenced by buildPhysicalModelTreeWidgetItem(), init(), PMLExplorerWidget(), and updateTarget().

◆ informativeComponentItem

QTreeWidgetItem* PMLExplorerWidget::informativeComponentItem
private

the informative component MC tree widget item

Referenced by buildPhysicalModelTreeWidgetItem(), init(), PMLExplorerWidget(), and updateTarget().

◆ objectController

camitk::ObjectController* PMLExplorerWidget::objectController
private

the QObject are displaying properties in the ObjectController

Referenced by createNewProperty(), PMLExplorerWidget(), updateProperty(), updateTarget(), and ~PMLExplorerWidget().

◆ physicalModel

PhysicalModel* PMLExplorerWidget::physicalModel
private

The PML Component to explore with the action.

◆ physicalModelItem

QTreeWidgetItem* PMLExplorerWidget::physicalModelItem
private

The main tree widget items, at the base of the structure.

Referenced by buildPhysicalModelTreeWidgetItem(), createNewProperty(), init(), PMLExplorerWidget(), propertyChanged(), updateProperty(), and updateTarget().

◆ pmlComponent

PMLComponent* PMLExplorerWidget::pmlComponent
private

◆ showAtomGlyph

bool PMLExplorerWidget::showAtomGlyph
private

the state of the show atom glyph checkbox

Referenced by init(), selectItems(), and showAtomGlyphToggled().

◆ ui

Ui::ui_PmlExplorerWidget* PMLExplorerWidget::ui
private

The graphical user interface automatically generated by the moc and QtDesigner.

Referenced by buildPhysicalModelTreeWidgetItem(), init(), PMLExplorerWidget(), selectItems(), updateTarget(), and ~PMLExplorerWidget().

◆ widgetAtomMap

QMap<QTreeWidgetItem*, Atom*> PMLExplorerWidget::widgetAtomMap
private

A pml::Atom <-> QTreeWidgetItem map to find out, once selected the corresponding pml::Atom associated to the QTreeWidgetItem.

Referenced by buildAtomTreeWidgetItem(), createNewProperty(), propertyChanged(), selectItems(), updateProperty(), and updateTarget().

◆ widgetComponentMap

QMap<QTreeWidgetItem*, Component*> PMLExplorerWidget::widgetComponentMap
private

A pml::component <-> QTreeWidgetItem map to find out, once selected the corresponding pml::Component (StructuralComponent, MultiComponent or Cell) associated to the QTreeWidgetItem.

Referenced by buildCellTreeWidgetItem(), buildMultiComponentTreeWidgetItem(), buildStructuralComponentTreeWidgetItem(), createNewProperty(), propertyChanged(), selectItems(), updateProperty(), and updateTarget().

◆ widgetPropertiesMap

QMap<QTreeWidgetItem*, QObject*> PMLExplorerWidget::widgetPropertiesMap
private

Map QTreeWidgetItem <-> CamiTKPropertyList for all PML components (Cell, SC, MC).

A CamiTKPropertyList is build if not already build, it allows the user to interact with the physical model field attributes/properties using the explorer's ObjectController. This is only used for PML components (Cell, SC, MC) not for atoms The only exception is for the PMLComponent holding the top-level physicalModel properties: it is not a CamiTKPropertyList but directly a QObject

Referenced by createNewProperty(), propertyChanged(), updateProperty(), updateTarget(), and ~PMLExplorerWidget().


The documentation for this class was generated from the following files: