Computer Assited Medical Intervention Tool Kit  version 4.1
Public Slots | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
PMLExplorerWidget Class Reference

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

#include <PMLExplorerWidget.h>

Inherits QWidget.

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:

Constructor & Destructor Documentation

◆ PMLExplorerWidget()

PMLExplorerWidget::PMLExplorerWidget ( PMLComponent comp)

◆ ~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().

◆ 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().

◆ 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().

◆ 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().

◆ 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().

◆ createAtomPropertyList()

CamiTKPropertyList * PMLExplorerWidget::createAtomPropertyList ( Atom a)
private

◆ createCellPropertyList()

CamiTKPropertyList * PMLExplorerWidget::createCellPropertyList ( Cell c)
private

◆ createMCPropertyList()

CamiTKPropertyList * PMLExplorerWidget::createMCPropertyList ( MultiComponent mc)
private

◆ createNewProperty

void PMLExplorerWidget::createNewProperty ( )
slot

◆ createSCPropertyList()

CamiTKPropertyList * PMLExplorerWidget::createSCPropertyList ( StructuralComponent sc)
private

◆ init()

void PMLExplorerWidget::init ( PMLComponent comp)
private

◆ propertyChanged

void PMLExplorerWidget::propertyChanged ( )
slot

◆ 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().

◆ 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().

◆ updateProperty()

void PMLExplorerWidget::updateProperty ( QTreeWidgetItem *  item)
private

◆ updateTarget()

void PMLExplorerWidget::updateTarget ( PMLComponent comp)

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: