|
Computer Assited Medical Intervention Tool Kit
version 5.0
|
|
Go to the documentation of this file.
25 #ifndef PML_COMPONENT_H
26 #define PML_COMPONENT_H
45 class vtkUnstructuredGrid;
61 #include <CamiTKDisableWarnings>
62 #include <vtkExtractSelection.h>
63 #include <CamiTKReEnableWarnings>
65 #include <vtkSelectionNode.h>
135 virtual void setSelected(
const bool b,
const bool recursive =
true);
143 vtkIdType getPointId(
const Atom*
a);
155 void selectCell(
Cell* cell,
bool showAtomGlyph);
159 void selectAtom(
const Atom* atom);
172 void unselectItems();
176 void updateSelection();
186 void refreshDisplay();
234 void create3DStructure();
244 vtkSmartPointer<vtkCell> cellToVTK(
Cell* cell);
283 void createAtomSelectionVTKPipeline();
void selectSC(StructuralComponent *sc, bool showAtomGlyph)
Select the given structural component in the 3D structure by highlighting all its atoms and cells.
Definition: PMLComponent.cpp:473
bool setIndex(const unsigned int) override
set the index.
Definition: Cell.cpp:139
vtkIdType getPointId(const Atom *a)
get the point Id from the corresponding atom, this is the opposite of pml->getAtom(id)
Definition: PMLComponent.h:290
vtkSmartPointer< vtkPointSet > vtkSmartPointer< vtkAlgorithmOutput > vtkSmartPointer< vtkActor >
Definition: sdk/libraries/core/component/Component.h:589
virtual void updateProperty(QString name, QVariant value)
update top-level properties and synchronize the physical model values
Definition: PMLComponent.cpp:169
vtkSmartPointer< vtkUnstructuredGrid > mainGrid
The 3D grid containing all the cells of the PML.
Definition: PMLComponent.h:228
@ WEDGE
the structure is a wedge (like the Pink Floyd's "Dark Side Of the Moon" prism), it must be a cell and...
Definition: StructureProperties.h:160
@ TETRAHEDRON
the structure is a tetrahedron, it must be a cell and have sub-structures that are atoms
Definition: StructureProperties.h:159
unsigned int getNumberOfStructures() const
get the number of structures
Definition: StructuralComponent.h:252
std::map< const Atom *, const vtkIdType >::iterator AtomPointIdMapIterator
the iterator corresponding to the AtomPointIdMap map
Definition: PMLComponent.h:81
StructureProperties::GeometricType getType() const
get the type of index
Definition: Structure.cpp:40
Component * getSubComponent(const unsigned int) const
get a subcomponent by its order number (index in the list of subcomponents)
Definition: MultiComponent.h:114
An atom has an unique index in the physical model object, a 3D position, and different basic properti...
Definition: Atom.h:49
PhysicalModel * getPhysicalModel()
Definition: PMLComponent.cpp:104
bool addProp(const QString &name, vtkSmartPointer< vtkProp > prop) override
insert an additional prop, defining it by its name (default visibility = false)
Definition: sdk/libraries/core/component/Component.h:626
InsertionPolicy
Definition: MeshSelectionModel.h:50
vtkSmartPointer< vtkPolyVertex > atomSCToVTK(StructuralComponent *sc)
Create a 3D vtkPolyVertex of a structural component which ONLY contains atoms ref.
Definition: PMLComponent.cpp:332
void updateProperty(QString, QVariant) override
update property: no specific properties to manage, this is needed to avoid console warnings.
Definition: MeshComponent.h:134
std::pair< const Atom *, const vtkIdType > AtomPointIdPair
As the PhysicalModel atom index can be different to the node index (continuity in id is not mandatory...
Definition: PMLComponent.h:73
void selectAtom(const Atom *atom)
Select the given atom in the 3D structure.
Definition: PMLComponent.cpp:441
void create3DStructure()
Create the 3D VTK structure representing the mesh.
Definition: PMLComponent.cpp:184
void init()
initialisation of the mesh component members
Definition: MeshComponent.cpp:128
unsigned int getIndex() const
get the structure unique index (stored in its property)
Definition: Structure.cpp:30
unsigned int getNumberOfSubComponents() const
return the number of subcomponents
Definition: MultiComponent.h:111
double getBoundingRadius() override
compute the object's bounding sphere radius,
Definition: sdk/libraries/core/component/Component.cpp:701
static QPixmap * myPixmap
the PMLComponent icon
Definition: PMLComponent.h:216
A structural component is composed either by cell or by atoms.
Definition: StructuralComponent.h:52
Exception class to handle abortion in the xmlReading Particularly useful to handle constructor's abor...
Definition: PMLAbortException.h:39
virtual void initDynamicProperties()
create and initialize dynamic properties using the global xml attributes from the PhysicalModel objec...
Definition: PMLComponent.cpp:139
bool neverSelected
the first selection should trigger the pml exporer action (default action)
Definition: PMLComponent.h:219
void createAtomSelectionVTKPipeline()
Create the VTK selection pipeline (selection, extractor, mapper, actor) needed to represent the selec...
Definition: PMLComponent.cpp:360
@ REPLACE
Definition: MeshSelectionModel.h:51
void updateSelection()
Update the POINTS and CELLS selection for the whole 3D structure by telling the corresponding extract...
Definition: PMLComponent.cpp:513
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:303
vtkSmartPointer< vtkPointSet > getDataPort
Definition: sdk/libraries/core/component/Component.h:585
virtual vtkSmartPointer< vtkPointSet > getPointSet()=0
This is the main class of this project. Following a nice concept, a physical model is able to represe...
Definition: PhysicalModel.h:86
Action class is an abstract class that enables you to build a action (generally on a component)....
Definition: Action.h:231
virtual QAction * getQAction(Component *target=nullptr)
Get the corresponding QAction.
Definition: Action.cpp:204
void init()
initialize information (properties) and geometric representation from the physical model
Definition: PMLComponent.cpp:109
int getSelectionIndex(const QString &name) const
Get the selection index in the list from its name.
Definition: MeshComponent.cpp:495
vtkSmartPointer< vtkPoints > thePoints
The 3D VTK cloud points of the atoms read.
Definition: PMLComponent.h:225
A cell has an unique index in the physical model object, is composed by atoms, and different basic pr...
Definition: Cell.h:46
const std::string getName() const
get the name of the component
Definition: modeling/libraries/pml/Component.h:147
virtual int addSelection(const QString &name, int fieldType, int contentType, vtkSmartPointer< vtkAbstractArray > array, camitk::MeshSelectionModel::InsertionPolicy policy=camitk::MeshSelectionModel::REPLACE)
Add a selection (inherited from MeshComponent inorder to show a glyph on selected atoms).
Definition: PMLComponent.cpp:564
void parseMultiComponent(MultiComponent *mc)
Create the 3D structure of the given MultiComponent and its children (recursively).
Definition: PMLComponent.cpp:239
PhysicalModel * physicalModel
The library pml object that uses pmlschema to read the pml information for the xml file.
Definition: PMLComponent.h:213
Exception class to handle abortion in component instantiation. Particularly useful to handle construc...
Definition: AbortException.h:66
#define CAMITK_ERROR(MSG)
Log for error verbosity (the minimum verbosity) Will always appear.
Definition: Log.h:276
@ PYRAMID
the structure has a quad base and one vertex outside the defined base plane (like an egyptian pyramid...
Definition: StructureProperties.h:161
#define PML_COMPONENT_API
Definition: PMLComponentAPI.h:12
virtual void setSelected(const bool b, const bool recursive=true)
Update the selection flag.
Definition: sdk/libraries/core/component/Component.cpp:445
InterfaceGeometry * myGeometry
myGeometry is the 3d representation of this Component, the Component delegates all InterfaceGeometry ...
Definition: sdk/libraries/core/component/Component.h:824
This class manages a physical model (PML) CamiTK component.
Definition: PMLComponent.h:103
const char * what() const noexcept
get the detailed reason from the exception
Definition: PMLAbortException.h:71
const StructuralComponent * getParentSC()
Get the direct parent structural that own this cell.
Definition: Cell.h:151
double * getColor() const
Get the color.
Definition: StructuralComponent.cpp:116
QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding)
bool removeProp(const QString &name) override
remove a given additional prop.
Definition: sdk/libraries/core/component/Component.h:638
virtual ComposedBy composedBy()
return the type of structure composing the structural component: a structural component is either a l...
Definition: StructuralComponent.cpp:296
@ HEXAHEDRON
the structure is a hexahedron, it must be a cell and have sub-structures that are atoms
Definition: StructureProperties.h:162
@ CELLS
the structural component is made of cells
Definition: StructuralComponent.h:175
void selectCell(Cell *cell, bool showAtomGlyph)
Select the given cell in the 3D structure.
Definition: PMLComponent.cpp:447
@ TRIANGLE
the structure is a triangle, i.e it must be a cell composed of 3 atoms
Definition: StructureProperties.h:157
@ LINE
the structure is a simple line, i.e it must be a cell composed of only 2 atoms
Definition: StructureProperties.h:156
QMap< QString, vtkSmartPointer< vtkSelection > > scCellSelectionMap
The association structural component <-> vtkSelection for Cells selection.
Definition: PMLComponent.h:272
vtkSmartPointer< vtkIdTypeArray > selectedAtomIdArray
The vtkIdTypeArray for atom selection (contains all the id array that corresponds to a selected atom)
Definition: PMLComponent.h:259
void createCellSelectionVTKPipeline(const StructuralComponent *sc)
Create a new VTK selection pipeline (selection, extractor, mapper, actor) for a given SC if it does n...
Definition: PMLComponent.cpp:398
virtual void setVisibility(QString, bool)
set the visibility inside the viewer of the given name (the viewer needs to be a registered viewer)
Definition: sdk/libraries/core/component/Component.cpp:224
Structure * getStructure(const unsigned int) const
get a structure by its index (fisrt structure is at index 0)
Definition: StructuralComponent.h:220
std::AtomPointIdMap atomPointIdMap
the Atom / vtkPoint Id map
Definition: PMLComponent.h:231
virtual QPixmap getIcon()
get the pixmap for physical model component
Definition: PMLComponent.cpp:584
std::map< const Atom *, const vtkIdType > AtomPointIdMap
definition of the association set (=map in STL) AtomPointIdMap.
Definition: PMLComponent.h:79
bool isAField(std::string attName) const
check if the field exist in the XML document, return false if it does not
Definition: Properties.h:140
vtkSmartPointer< vtkCell > cellToVTK(Cell *cell)
Create a 3D vtkCell corresponding to a structural component's cell.
Definition: PMLComponent.cpp:268
Cell * getCell(unsigned int) const override
get cell by order number (not cell index)
Definition: StructuralComponent.cpp:197
@ POLY_VERTEX
the structure is a poly vertex, i.e it must be a cell and it is a point clouds
Definition: StructureProperties.h:164
void setReadOnly(bool)
set this property as read-only
Definition: Property.cpp:82
Describes the properties common to all structures and components.
Definition: Properties.h:59
@ QUAD
the structure is a quad, i.e it must be a cell composed of 4 atoms
Definition: StructureProperties.h:158
void setName(const QString &) override
set the name to be displayed
Definition: sdk/libraries/core/component/Component.h:932
Basic component to manage any kind of mesh.
Definition: MeshComponent.h:53
void set(std::string attName, double val)
field modificator: set field attName using a double value
Definition: Properties.h:200
QPixmap getIcon() override
Get the pixmap that will be displayed for this node.
Definition: MeshComponent.cpp:1172
virtual void refresh()
refresh all the viewer that are currently displaying this Component At the end the InterfaceNode modi...
Definition: sdk/libraries/core/component/Component.cpp:286
bool addProperty(Property *) override
Add a new CamiTK property to the component.
Definition: sdk/libraries/core/component/Component.cpp:517
QMap< QString, vtkSmartPointer< vtkIdTypeArray > > scCellIdArrayMap
The association structural component <-> vtkIdTypeArray for Cells selection.
Definition: PMLComponent.h:267
virtual int addSelection(const QString &name, int fieldType, int contentType, vtkSmartPointer< vtkAbstractArray > array, MeshSelectionModel::InsertionPolicy policy=MeshSelectionModel::REPLACE)
Add a selection.
Definition: MeshComponent.cpp:519
@ ATOMS
the structural component is made of atoms
Definition: StructuralComponent.h:176
PMLComponent(const QString &file)
Construct the PML component directly from the .pml xml file.
Definition: PMLComponent.cpp:77
virtual ~PMLComponent()
destructor
Definition: PMLComponent.cpp:96
void selectMC(MultiComponent *mc, bool showAtomGlyph)
Select the given multi component in the 3D structure by highlighting all its structural components.
Definition: PMLComponent.cpp:500
void unselectItems()
Unselect all the SC, MC, Atoms and Cells previously selected on the 3D structure.
Definition: PMLComponent.cpp:551
A multi-component stores other components, hence providing a way to have an tree representation of co...
Definition: MultiComponent.h:44
void initDynamicProperties()
create and initialize dynamic properties
Definition: MeshComponent.cpp:331
void refreshDisplay()
Refresh the display of the component according to the selected 3D items by the user.
Definition: PMLComponent.cpp:349
vtkSmartPointer< vtkSelection > selectedAtomSelection
The vtkSelection for atom selection.
Definition: PMLComponent.h:262
@ POLY_LINE
the structure is a polyline, i.e it must be a cell and the order of the atom in the cell are arranged...
Definition: StructureProperties.h:163
void initRepresentation() override final
the concrete building of the 3D objects (Slice/Geometry): none in this case, everything is done by in...
Definition: MeshComponent.h:399
virtual void setEnhancedModes(const EnhancedModes)=0
set the enhanced mode
Definition: Action.cpp:35
virtual void setSelected(const bool b, const bool recursive=true)
Update the selection flag (this method is overridden in order to show the default modeling action whe...
Definition: PMLComponent.cpp:123