26 #ifndef MESHCOMPONENT_H
27 #define MESHCOMPONENT_H
29 #include "Component.h"
36 class vtkSelectionNode;
45 class MeshSelectionView;
106 MeshComponent(vtkSmartPointer<vtkPointSet> aPointSet,
const QString& name);
122 void pointPicked(vtkIdType pointId,
bool)
override;
125 void cellPicked(vtkIdType cellId,
bool)
override;
128 vtkIdType getPickedPointId();
131 vtkIdType getPickedCellId();
137 unsigned int getNumberOfPropertyWidget()
override;
140 QWidget* getPropertyWidgetAt(
unsigned int i = 0)
override;
143 QPixmap getIcon()
override;
177 unsigned int getNumberOfSelections()
const;
184 vtkSmartPointer<vtkSelection> getActiveSelection()
const;
194 vtkSmartPointer<vtkSelectionNode> getSelection(
const QString& name)
const;
204 vtkSmartPointer<vtkSelectionNode> getSelectionAt(
unsigned int index)
const;
212 int getSelectionIndex(
const QString& name)
const;
260 int getNumberOfDataArray(
int fieldFlag = POINTS | CELLS);
270 vtkSmartPointer<vtkDataArray> getDataArray(FieldType fieldType,
const QString& arrayName);
280 vtkSmartPointer<vtkDataArray> getDataArray(FieldType fieldType,
int index);
289 void addDataArray(FieldType fieldType,
const QString& name, vtkSmartPointer<vtkDataArray> data);
297 void removeDataArray(FieldType fieldType,
const QString& name);
305 void addPointData(
const QString& name, vtkSmartPointer<vtkDataArray> data);
313 void addCellData(
const QString& name, vtkSmartPointer<vtkDataArray> data);
319 vtkSmartPointer<vtkFieldData> getFieldData(FieldType);
322 bool getDataRepresentationVisibility(FieldType,
const QString&) ;
325 void setDataRepresentationVisibility(FieldType,
const QString&,
bool);
328 void setDataRepresentationOff(
int dataType = SCALARS | VECTORS | TENSORS);
338 static const QMap< int, QString >& getFieldNames();
341 static const QString getFieldName(
const FieldType);
344 static const QMap< int, QString >& getDataTypeNames();
347 static const QString getDataTypeName(
const DataType);
350 static const DataType getDataType(vtkSmartPointer<vtkDataArray>);
356 static const QString getDataTypeName(vtkSmartPointer<vtkDataArray>);
372 virtual QVariant toVariant()
const override;
375 virtual void fromVariant(
const QVariant&)
override;
382 void initRepresentation(vtkSmartPointer<vtkPointSet>);
385 void initSelection();
391 void initDynamicProperties();
396 void changeSelectedSelection(
const QItemSelection& selected,
const QItemSelection& deselected);
399 void removeSelectedSelections();
402 void removeSelectedData();
405 void displayTypePolicyChanged(
int);
408 void vectorRepresentationPolicyChanged(
int);
413 void initRepresentation() override final {}
419 vtkIdType pickedPointId;
422 vtkIdType pickedCellId;
425 vtkSmartPointer<vtkSelection> currentSelection;
437 QWidget* selectionWidget;
440 QAction* removeSelections;
443 QAction* mergeSelection;
446 QAction* inspectSelection;
449 QComboBox* insertionPolicyBox;
461 QComboBox* displayTypePolicyBox;
464 QComboBox* vectorRepresentationPolicyBox;
469 QMap<QString, vtkSmartPointer<vtkDataArray> > specific3DDataRepresentation;
472 unsigned int numberOfCellDataSpecificRepresentation;
475 QMap<vtkSmartPointer<vtkDataArray>,
bool> dataRepresentationVisibility;
478 QStringList vectorActors;
481 void createDataRepresentation(FieldType,
const QString&, SpecificRepresentation representation = VECTOR_3D) ;
484 const QString getDataPropName(FieldType,
const QString&);
487 void setScalarDataRepresentationOn(vtkSmartPointer<vtkDataArray>);
490 static QMap< int, QString > initFieldNames();
493 static QMap< int, QString > initDataNames();
499 QAction* inspectData;
#define CAMITK_API
Definition: CamiTKAPI.h:49
Definition: PersistenceManager.h:34
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:303
Basic component to manage any kind of mesh.
Definition: MeshComponent.h:53
void setVectorRepresentation(VectorRepresentation)
set the current mode of visualisation of 3D data vector (default is ARROW)
SpecificRepresentation
3D data can be represented by 1 value in different ways
Definition: MeshComponent.h:73
@ SECOND_COMPONENT
Use only the value of the second component.
Definition: MeshComponent.h:77
@ VECTOR_3D
3D data are represented with 3D arrows or hedge hog (simple lines starting from the point or center o...
Definition: MeshComponent.h:74
@ FIRST_COMPONENT
Use only the value of the first component.
Definition: MeshComponent.h:76
@ NORM
3D data are represented in 1D using the norm of the three components
Definition: MeshComponent.h:75
@ THIRD_COMPONENT
Use only the value of the third component.
Definition: MeshComponent.h:78
void updateProperty(QString, QVariant) override
update property: no specific properties to manage, this is needed to avoid console warnings.
Definition: MeshComponent.h:134
FieldType
Data fields can be applied to one of this.
Definition: MeshComponent.h:66
DataType
Data fields can have different dimensions.
Definition: MeshComponent.h:58
VectorRepresentation
how are vector data represented in 3D
Definition: MeshComponent.h:83
@ HEDGE_HOG
3D data are represented with hedge hog (simple lines starting from the point or center of the cell)
Definition: MeshComponent.h:84
@ ARROW
3D data are represented with 3D arrows (nicer hedge hog)
Definition: MeshComponent.h:85
Qt model for mesh data.
Definition: MeshDataModel.h:45
Qt view for mesh data.
Definition: MeshDataView.h:40
Qt model for mesh selection This class use the Qt model/view design.
Definition: MeshSelectionModel.h:44
InsertionPolicy
Definition: MeshSelectionModel.h:50
@ REPLACE
Definition: MeshSelectionModel.h:51
Qt view for mesh selection.
Definition: MeshSelectionView.h:40
Definition: Action.cpp:36
QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding)