This class is the Pml explore action widget presented/controller. More...
#include <PMLExplorerWidget.h>
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 | |
CamiTKPropertyList * | createAtomPropertyList (Atom *) |
CamiTKPropertyList * | createCellPropertyList (Cell *) |
Creates a CamiTKPropertyList for this cell or get the existing one. More... | |
CamiTKPropertyList * | createMCPropertyList (MultiComponent *) |
Creates a CamiTKPropertyList for this MC or get the existing one. More... | |
CamiTKPropertyList * | createSCPropertyList (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::ObjectController * | objectController |
the QObject are displaying properties in the ObjectController More... | |
PhysicalModel * | physicalModel |
The PML Component to explore with the action. More... | |
PMLComponent * | pmlComponent |
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... | |
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:
PMLExplorerWidget::PMLExplorerWidget | ( | PMLComponent * | comp | ) |
Constructor.
References atomsItem, camitk::ObjectController::BUTTON, createNewProperty(), exclusiveComponentItem, informativeComponentItem, init(), objectController, physicalModelItem, propertyChanged(), showAtomGlyphToggled(), and ui.
|
override |
Destructor.
References objectController, ui, and widgetPropertiesMap.
|
private |
Add an entry for the current atom to the widget.
atom | the current atom parsed to add to the widget |
parent | the parent QTreeWidgetItem |
References Structure::getIndex(), and widgetAtomMap.
Referenced by buildCellTreeWidgetItem(), and buildStructuralComponentTreeWidgetItem().
|
private |
Add an entry for the current cell to the widget.
cell | the current cell parsed to add to the widget |
parent | the parent QTreeWidgetItem |
References a, buildAtomTreeWidgetItem(), Structure::getIndex(), StructuralComponent::getNumberOfStructures(), StructuralComponent::getStructure(), Structure::hasIndex, and widgetComponentMap.
Referenced by buildStructuralComponentTreeWidgetItem().
|
private |
Recursive method to add an entry for the current multicomponent to the widget.
multiComponent | the current multiComponent to add to the widget |
parent | the parent QTreeWidgetItem |
References buildStructuralComponentTreeWidgetItem(), Component::getName(), MultiComponent::getNumberOfSubComponents(), MultiComponent::getSubComponent(), and widgetComponentMap.
Referenced by 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.
References atomsItem, buildMultiComponentTreeWidgetItem(), buildStructuralComponentTreeWidgetItem(), editedItem, exclusiveComponentItem, PMLComponent::getIcon(), informativeComponentItem, physicalModelItem, pmlComponent, and ui.
Referenced by init().
|
private |
Add an entry for the current structural component to the widget.
sc | the current structural component to add to the widget |
parent | the parent QTreeWidgetItem |
References a, buildAtomTreeWidgetItem(), buildCellTreeWidgetItem(), Component::getName(), StructuralComponent::getNumberOfStructures(), StructuralComponent::getStructure(), and widgetComponentMap.
Referenced by buildMultiComponentTreeWidgetItem(), and buildPhysicalModelTreeWidgetItem().
|
private |
References a, PMLComponent::getPointId(), camitk::InterfaceGeometry::getPointSet(), pmlComponent, and camitk::Property::setGroupName().
Referenced by updateProperty().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
slot |
This slot is connected to the corresponding UI Checkbox, update the showAtomGlyph state.
References selectItems(), and showAtomGlyph.
Referenced by PMLExplorerWidget().
|
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().
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().
|
private |
Map QTreeWidgetItem <-> CamiTKPropertyList for atom For the atoms, there is only one CamiTKPropertyList per atom.
Referenced by createNewProperty(), propertyChanged(), updateProperty(), and updateTarget().
|
private |
the atom SC tree widget item
Referenced by buildPhysicalModelTreeWidgetItem(), PMLExplorerWidget(), and updateTarget().
|
private |
item being currently edited
Referenced by buildPhysicalModelTreeWidgetItem(), createNewProperty(), propertyChanged(), updateProperty(), and updateTarget().
|
private |
the exclusive component MC tree widget item
Referenced by buildPhysicalModelTreeWidgetItem(), init(), PMLExplorerWidget(), and updateTarget().
|
private |
the informative component MC tree widget item
Referenced by buildPhysicalModelTreeWidgetItem(), init(), PMLExplorerWidget(), and updateTarget().
|
private |
the QObject are displaying properties in the ObjectController
Referenced by createNewProperty(), PMLExplorerWidget(), updateProperty(), updateTarget(), and ~PMLExplorerWidget().
|
private |
The PML Component to explore with the action.
|
private |
The main tree widget items, at the base of the structure.
Referenced by buildPhysicalModelTreeWidgetItem(), createNewProperty(), init(), PMLExplorerWidget(), propertyChanged(), updateProperty(), and updateTarget().
|
private |
The PML Component associated with the action.
Referenced by buildPhysicalModelTreeWidgetItem(), createAtomPropertyList(), createNewProperty(), init(), propertyChanged(), selectItems(), and updateProperty().
|
private |
the state of the show atom glyph checkbox
Referenced by init(), selectItems(), and showAtomGlyphToggled().
|
private |
The graphical user interface automatically generated by the moc and QtDesigner.
Referenced by buildPhysicalModelTreeWidgetItem(), init(), PMLExplorerWidget(), selectItems(), updateTarget(), and ~PMLExplorerWidget().
|
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().
|
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().
|
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().