 |
Computer Assited Medical Intervention Tool Kit
version 4.1
|
Go to the documentation of this file.
25 #ifndef PML_COMPONENT_H
26 #define PML_COMPONENT_H
45 class vtkUnstructuredGrid;
60 #include <vtkSelectionNode.h>
61 #include <vtkExtractSelection.h>
131 virtual void setSelected(
const bool b,
const bool recursive =
true);
141 vtkIdType getPointId(
const Atom*
a);
151 void selectCell(
Cell* cell,
bool showAtomGlyph);
155 void selectAtom(
const Atom* atom);
166 void unselectItems();
170 void updateSelection();
180 void refreshDisplay();
227 void create3DStructure();
237 vtkSmartPointer<vtkCell> cellToVTK(
Cell* cell);
276 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:465
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:283
vtkSmartPointer< vtkPointSet > vtkSmartPointer< vtkAlgorithmOutput > vtkSmartPointer< vtkActor >
Definition: sdk/libraries/core/component/Component.h:553
virtual void updateProperty(QString name, QVariant value)
update top-level properties and synchronize the physical model values
Definition: PMLComponent.cpp:161
bool removeProp(const QString &name)
remove a given additional prop.
Definition: sdk/libraries/core/component/Component.h:598
vtkSmartPointer< vtkUnstructuredGrid > mainGrid
The 3D grid containing all the cells of the PML.
Definition: PMLComponent.h:221
@ 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:77
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
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:324
QAction * getQAction()
Get the corresponding QAction.
Definition: Action.cpp:183
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:69
void selectAtom(const Atom *atom)
Select the given pml::Atom in the 3D structure.
Definition: PMLComponent.cpp:433
void create3DStructure()
Create the 3D VTK structure representing the mesh.
Definition: PMLComponent.cpp:176
void init()
initialisation of the mesh component members
Definition: MeshComponent.cpp:123
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:489
static QPixmap * myPixmap
the PMLComponent icon
Definition: PMLComponent.h:210
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:131
bool neverSelected
the first selection should trigger the pml exporer action (default action)
Definition: PMLComponent.h:213
void createAtomSelectionVTKPipeline()
Create the VTK selection pipeline (selection, extractor, mapper, actor) needed to represent the selec...
Definition: PMLComponent.cpp:352
@ 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:505
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:314
vtkSmartPointer< vtkPointSet > getDataPort
Definition: sdk/libraries/core/component/Component.h:549
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:230
void init()
initialize information (properties) and geometric representation from the physical model
Definition: PMLComponent.cpp:101
int getSelectionIndex(const QString &name) const
Get the selection index in the list from its name.
Definition: MeshComponent.cpp:489
vtkSmartPointer< vtkPoints > thePoints
Definition: PMLComponent.h:218
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
bool addProp(const QString &name, vtkSmartPointer< vtkProp > prop)
insert an additional prop, defining it by its name (default visibility = false)
Definition: sdk/libraries/core/component/Component.h:587
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:556
void parseMultiComponent(MultiComponent *mc)
Create the 3D structure of the given MultiComponent and its children (recursively).
Definition: PMLComponent.cpp:231
PhysicalModel * physicalModel
The library pml object that uses pmlschema to read the pml information for the xml file.
Definition: PMLComponent.h:207
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:273
@ 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 setVisibility(Viewer *, bool)
set the visibility for a viewer
Definition: sdk/libraries/core/component/Component.cpp:276
virtual void setSelected(const bool b, const bool recursive=true)
Update the selection flag.
Definition: sdk/libraries/core/component/Component.cpp:558
InterfaceGeometry * myGeometry
myGeometry is the 3d representation of this Component, the Component delegates all InterfaceGeometry ...
Definition: sdk/libraries/core/component/Component.h:764
This class manages a physical model (PML) CamiTK component.
Definition: PMLComponent.h:99
const char * what() const noexcept
get the detailed reason from the exception
Definition: PMLAbortException.h:72
const StructuralComponent * getParentSC()
Get the direct parent structural that own this cell.
Definition: Cell.h:139
double * getColor() const
Get the color.
Definition: StructuralComponent.cpp:116
QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding)
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)
Definition: PMLComponent.cpp:439
@ TRIANGLE
the structure is a triangle, i.e it must be a cell composed of 3 atoms
Definition: StructureProperties.h:157
void updateProperty(QString, QVariant)
update property: no specific properties to manage, this is needed to avoid console warnings.
Definition: MeshComponent.h:134
@ 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:265
vtkSmartPointer< vtkIdTypeArray > selectedAtomIdArray
The vtkIdTypeArray for atom selection (contains all the id array that corresponds to a selected atom)
Definition: PMLComponent.h:252
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:390
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:224
virtual QPixmap getIcon()
get the pixmap for physical model component
Definition: PMLComponent.cpp:576
PhysicalModel * getPhysicalModel()
Definition: PMLComponent.h:136
void initRepresentation()
the concrete building of the 3D objects (Slice/Geometry): none in this case, everything is done by in...
Definition: MeshComponent.h:399
std::map< const Atom *, const vtkIdType > AtomPointIdMap
definition of the association set (=map in STL) AtomPointIdMap.
Definition: PMLComponent.h:75
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:260
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:83
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:874
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:1123
bool addProperty(Property *) override
Add a new CamiTK property to the component.
Definition: sdk/libraries/core/component/Component.cpp:221
QMap< QString, vtkSmartPointer< vtkIdTypeArray > > scCellIdArrayMap
The association structural component <-> vtkIdTypeArray for Cells selection.
Definition: PMLComponent.h:260
virtual int addSelection(const QString &name, int fieldType, int contentType, vtkSmartPointer< vtkAbstractArray > array, MeshSelectionModel::InsertionPolicy policy=MeshSelectionModel::REPLACE)
Add a selection.
Definition: MeshComponent.cpp:513
@ 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:74
virtual ~PMLComponent()
destructor
Definition: PMLComponent.cpp:93
void selectMC(MultiComponent *mc, bool showAtomGlyph)
Select the given multi component in the 3D structure by highlighting all its structural components.
Definition: PMLComponent.cpp:492
void unselectItems()
Unselect all the SC, MC, Atoms and Cells previously selected on the 3D structure.
Definition: PMLComponent.cpp:543
A multi-component stores other components, hence providing a way to have an tree representation of co...
Definition: MultiComponent.h:44
virtual void initDynamicProperties()
create and initialize dynamic properties
Definition: MeshComponent.cpp:325
void refreshDisplay()
Refresh the display of the component according to the selected 3D items by the user.
Definition: PMLComponent.cpp:341
vtkSmartPointer< vtkSelection > selectedAtomSelection
The vtkSelection for atom selection.
Definition: PMLComponent.h:255
@ 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
virtual void setEnhancedModes(const EnhancedModes)=0
set the enhanced mode
Definition: Action.cpp:36
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:115