26#ifndef MESH_DATA_MODEL_H
27#define MESH_DATA_MODEL_H
29#include <QAbstractTableModel>
30#include <QSortFilterProxyModel>
59 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
64 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
69 QVariant
data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const override;
74 QVariant
headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
79 bool setData(
const QModelIndex& index,
const QVariant& value,
int role)
override;
83 Qt::ItemFlags
flags(
const QModelIndex& index)
const override;
116 QObject* parent =
nullptr);
124 bool filterAcceptsRow(
int sourceRow,
const QModelIndex& sourceParent)
const override;
#define CAMITK_API
Definition CamiTKAPI.h:66
Basic component to manage any kind of mesh.
Definition MeshComponent.h:53
FieldType
Data fields can be applied to one of this.
Definition MeshComponent.h:66
@ POINTS
data are attached to point
Definition MeshComponent.h:67
@ MESH
data are attached to the whole mesh (generic field data of Vtk)
Definition MeshComponent.h:69
@ CELLS
data are attached to cells
Definition MeshComponent.h:68
DataType
Data fields can have different dimensions.
Definition MeshComponent.h:58
@ SCALARS
1D (scalar value)
Definition MeshComponent.h:59
@ OTHERS
other dimensions (warning: nothing special are managed by this class, no specific interaction)
Definition MeshComponent.h:62
@ TENSORS
9D (3x3 matrix)
Definition MeshComponent.h:61
@ VECTORS
3D (3D vector)
Definition MeshComponent.h:60
void setFieldTypeFilter(int fieldFilter)
Definition MeshDataModel.cpp:270
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
Definition MeshDataModel.cpp:280
MeshDataFilterModel(int fieldFilter=MeshComponent::POINTS|MeshComponent::CELLS|MeshComponent::MESH, int dataFilter=MeshComponent::SCALARS|MeshComponent::VECTORS|MeshComponent::TENSORS|MeshComponent::OTHERS, QObject *parent=nullptr)
Definition MeshDataModel.cpp:263
void setDataTypeFilter(int dataFilter)
Definition MeshDataModel.cpp:275
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Model data, called when the view is refreshing visualization.
Definition MeshDataModel.cpp:90
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Number of data arrays.
Definition MeshDataModel.cpp:44
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns if a given model index is editable, checkable....
Definition MeshDataModel.cpp:213
MeshDataModel(MeshComponent *meshComp)
Constructor.
Definition MeshDataModel.cpp:37
bool setData(const QModelIndex &index, const QVariant &value, int role) override
Edit data, called when the data are modified by the user (view).
Definition MeshDataModel.cpp:185
void refresh()
Refresh the model.
Definition MeshDataModel.cpp:251
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Number of data arrays columns.
Definition MeshDataModel.cpp:54
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Header data.
Definition MeshDataModel.cpp:224