Computer Assited Medical Intervention Tool Kit
version 4.1
|
Qt model for mesh selection This class use the Qt model/view design. More...
#include <MeshSelectionModel.h>
Inherits QAbstractTableModel.
Public Types | |
enum | InsertionPolicy { REPLACE, MERGE, SUBSTRACT, DISCARD } |
Public Member Functions | |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
Number of selection columns. More... | |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
Model data. More... | |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
Data header. More... | |
int | insertSelection (const QString &name, int fieldType, int contentType, vtkSmartPointer< vtkAbstractArray > array, InsertionPolicy policy=REPLACE) |
Insert a selection. More... | |
MeshSelectionModel (MeshComponent *const meshComp) | |
Constructor. More... | |
int | removeSelection (const QString &name) |
int | rowCount (const QModelIndex &parent=QModelIndex()) const |
Number of selection. More... | |
bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
Edit selection data. More... | |
Private Attributes | |
QMap< int, QString > | contentName |
QMap< int, QString > | fieldName |
The component where the selection are stored. More... | |
MeshComponent * | meshComponent |
Get the selection list. More... | |
Qt model for mesh selection This class use the Qt model/view design.
camitk::MeshSelectionModel::MeshSelectionModel | ( | MeshComponent *const | meshComp | ) |
Constructor.
References contentName, and fieldName.
|
override |
Number of selection columns.
|
override |
Model data.
References contentName, fieldName, camitk::MeshComponent::getSelections(), and meshComponent.
|
override |
|
override |
Data header.
int camitk::MeshSelectionModel::insertSelection | ( | const QString & | name, |
int | fieldType, | ||
int | contentType, | ||
vtkSmartPointer< vtkAbstractArray > | array, | ||
InsertionPolicy | policy = REPLACE |
||
) |
Insert a selection.
References DISCARD, camitk::MeshComponent::getSelectionIndex(), camitk::MeshComponent::getSelections(), MERGE, meshComponent, REPLACE, and SUBSTRACT.
Referenced by camitk::MeshComponent::addSelection().
int camitk::MeshSelectionModel::removeSelection | ( | const QString & | name | ) |
References camitk::MeshComponent::getSelectionIndex(), camitk::MeshComponent::getSelections(), and meshComponent.
Referenced by camitk::MeshComponent::removeSelectedSelections().
int camitk::MeshSelectionModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Number of selection.
References camitk::MeshComponent::getSelections(), and meshComponent.
|
override |
Edit selection data.
References camitk::MeshComponent::getSelectionIndex(), camitk::MeshComponent::getSelections(), and meshComponent.
|
private |
Referenced by data(), and MeshSelectionModel().
|
private |
The component where the selection are stored.
Referenced by data(), and MeshSelectionModel().
|
private |
Get the selection list.
Update the selection Refresh the model
Referenced by data(), insertSelection(), removeSelection(), rowCount(), and setData().