Computer Assited Medical Intervention Tool Kit  version 5.0
MeshSelectionModel.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef MESH_SELECTION_MODEL_H
27 #define MESH_SELECTION_MODEL_H
28 
29 #include <QAbstractTableModel>
30 
31 #include<vtkSmartPointer.h>
32 
33 class vtkSelectionNode;
34 class vtkAbstractArray;
35 
36 namespace camitk {
37 
38 class MeshComponent;
39 
44 class MeshSelectionModel : public QAbstractTableModel {
45 
46  Q_OBJECT
47 
48 public :
49 
55  };
56 
60  MeshSelectionModel(MeshComponent* const meshComp);
61 
65  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
66 
70  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
71 
75  QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
76 
80  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
81 
85  int insertSelection(const QString& name, int fieldType, int contentType, vtkSmartPointer< vtkAbstractArray > array, InsertionPolicy policy = REPLACE);
86 
87  int removeSelection(const QString& name);
88 
92  bool setData(const QModelIndex& index, const QVariant& value, int role) override;
93 
94  Qt::ItemFlags flags(const QModelIndex& index) const override;
95 
96 
97 private :
98 
100  QMap< int, QString > fieldName;
101  QMap< int, QString > contentName;
102 
103 };
104 
105 }
106 
107 #endif
camitk::MeshSelectionModel::removeSelection
int removeSelection(const QString &name)
Definition: MeshSelectionModel.cpp:294
camitk::MeshSelectionModel::meshComponent
MeshComponent * meshComponent
Definition: MeshSelectionModel.h:99
camitk::MeshSelectionModel::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Number of selection columns.
Definition: MeshSelectionModel.cpp:85
MeshDataModel.h
camitk::MeshSelectionModel::InsertionPolicy
InsertionPolicy
Definition: MeshSelectionModel.h:50
camitk::MeshSelectionModel::DISCARD
@ DISCARD
Definition: MeshSelectionModel.h:54
camitk::MeshSelectionModel::insertSelection
int insertSelection(const QString &name, int fieldType, int contentType, vtkSmartPointer< vtkAbstractArray > array, InsertionPolicy policy=REPLACE)
Insert a selection.
Definition: MeshSelectionModel.cpp:183
camitk::MeshSelectionModel::fieldName
QMap< int, QString > fieldName
The component where the selection are stored.
Definition: MeshSelectionModel.h:100
camitk::MeshSelectionModel::REPLACE
@ REPLACE
Definition: MeshSelectionModel.h:51
camitk::MeshSelectionModel::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition: MeshSelectionModel.cpp:330
MeshComponent.h
camitk::MeshSelectionModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Number of selection.
Definition: MeshSelectionModel.cpp:77
camitk::MeshSelectionModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Data header.
Definition: MeshSelectionModel.cpp:157
camitk::MeshSelectionModel::SUBTRACT
@ SUBTRACT
Definition: MeshSelectionModel.h:53
camitk::policy
QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding)
camitk::MeshSelectionModel::MeshSelectionModel
MeshSelectionModel(MeshComponent *const meshComp)
Constructor.
Definition: MeshSelectionModel.cpp:68
camitk::MeshSelectionModel::MERGE
@ MERGE
Definition: MeshSelectionModel.h:52
camitk::MeshSelectionModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Model data.
Definition: MeshSelectionModel.cpp:90
camitk::MeshSelectionModel
Qt model for mesh selection This class use the Qt model/view design.
Definition: MeshSelectionModel.h:44
camitk::MeshComponent
Basic component to manage any kind of mesh.
Definition: MeshComponent.h:53
camitk::MeshSelectionModel::contentName
QMap< int, QString > contentName
Definition: MeshSelectionModel.h:101
camitk::MeshSelectionModel::setData
bool setData(const QModelIndex &index, const QVariant &value, int role) override
Edit selection data.
Definition: MeshSelectionModel.cpp:307
camitk
Definition: Action.cpp:35