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();
134 void updateProperty(QString, QVariant) {}
137 unsigned int getNumberOfPropertyWidget()
override;
140 QWidget* getPropertyWidgetAt(
unsigned int i = 0)
override;
143 QPixmap getIcon()
override;
170 QList< vtkSmartPointer<vtkSelectionNode> >& getSelections();
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);
316 MeshDataModel* getDataModel();
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);
331 void setVectorRepresentation(VectorRepresentation);
337 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>);
359 static const QString getSpecificRepresentationName(
const SpecificRepresentation);
368 virtual void initRepresentation(vtkSmartPointer<vtkPointSet>);
371 virtual void initSelection();
374 virtual void initData();
377 virtual void initDynamicProperties();
382 void changeSelectedSelection(
const QItemSelection& selected,
const QItemSelection& deselected);
385 void removeSelectedSelections();
388 void removeSelectedData();
391 void displayTypePolicyChanged(
int);
394 void vectorRepresentationPolicyChanged(
int);
399 void initRepresentation() {}
405 vtkIdType pickedPointId;
408 vtkIdType pickedCellId;
411 vtkSmartPointer<vtkSelection> currentSelection;
414 QList< vtkSmartPointer<vtkSelectionNode> > selectionList;
417 MeshSelectionModel* selectionModel;
420 MeshSelectionView* selectionView;
423 QWidget* selectionWidget;
426 QAction* removeSelections;
429 QAction* mergeSelection;
432 QAction* inspectSelection;
435 QComboBox* insertionPolicyBox;
438 MeshDataModel* dataModel;
441 MeshDataView* dataView;
447 QComboBox* displayTypePolicyBox;
450 QComboBox* vectorRepresentationPolicyBox;
455 QMap<QString, vtkSmartPointer<vtkDataArray> > specific3DDataRepresentation;
458 unsigned int numberOfCellDataSpecificRepresentation;
461 QMap<vtkSmartPointer<vtkDataArray>,
bool> dataRepresentationVisibility;
464 QStringList vectorActors;
467 void createDataRepresentation(FieldType,
const QString&, SpecificRepresentation representation = VECTOR_3D) ;
470 const QString getDataPropName(FieldType,
const QString&);
473 void setScalarDataRepresentationOn(vtkSmartPointer<vtkDataArray>);
476 static QMap< int, QString > initFieldNames();
479 static QMap< int, QString > initDataNames();
485 QAction* inspectData;
491 #endif // MESHCOMPONENT_H