CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkVTKDataSetArrayComboBox.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __ctkVTKDataSetArrayComboBox_h
22 #define __ctkVTKDataSetArrayComboBox_h
23 
24 // Qt includes
25 #include <QComboBox>
26 
27 // CTK includes
28 #include "ctkVisualizationVTKWidgetsExport.h"
29 #include "ctkVTKDataSetModel.h"
30 class ctkVTKDataSetArrayComboBoxPrivate;
31 
32 class vtkAbstractArray;
33 class vtkDataSet;
34 
38 class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKDataSetArrayComboBox
39  : public QComboBox
40 {
41  Q_OBJECT
42  Q_PROPERTY(ctkVTKDataSetModel::AttributeTypes attributeTypes READ attributeTypes WRITE setAttributeTypes)
43  Q_PROPERTY(bool noneEnabled READ noneEnabled WRITE setNoneEnabled)
44 
45 public:
47  typedef QComboBox Superclass;
48 
50  explicit ctkVTKDataSetArrayComboBox(QWidget* parent = 0);
52 
53  vtkAbstractArray* currentArray()const;
54  QString currentArrayName()const;
55  vtkDataSet* dataSet()const;
56 
61 
62  ctkVTKDataSetModel::AttributeTypes attributeTypes()const;
63  void setAttributeTypes(const ctkVTKDataSetModel::AttributeTypes& attributeTypes);
64 
71  void setNoneEnabled(bool enable);
72  bool noneEnabled()const;
73 
77 
78 public Q_SLOTS:
81  void setDataSet(vtkDataSet* dataSet);
83  void setCurrentArray(vtkAbstractArray* dataArray);
85  void setCurrentArray(const QString& name);
86 
87 Q_SIGNALS:
88  void currentArrayChanged(vtkAbstractArray*);
89  void currentArrayChanged(const QString& name);
90 
91 protected Q_SLOTS:
93 protected:
94  QScopedPointer<ctkVTKDataSetArrayComboBoxPrivate> d_ptr;
95 
96 private:
97  Q_DECLARE_PRIVATE(ctkVTKDataSetArrayComboBox);
98  Q_DISABLE_COPY(ctkVTKDataSetArrayComboBox);
99 };
100 
101 #endif
int currentArrayLocation() const
ctkVTKDataSetArrayComboBox(QWidget *parent=0)
Constructors.
QComboBox Superclass
Superclass typedef.
void setDataSet(vtkDataSet *dataSet)
void setNoneEnabled(bool enable)
vtkDataSet * dataSet() const
virtual ~ctkVTKDataSetArrayComboBox()
ctkVTKDataSetModel::AttributeTypes attributeTypes() const
vtkAbstractArray * currentArray() const
void currentArrayChanged(vtkAbstractArray *)
void setCurrentArray(vtkAbstractArray *dataArray)
The array must exist in the dataset.
void setCurrentArray(const QString &name)
the array must exist in the dataset
void currentArrayChanged(const QString &name)
QString currentArrayName() const
void setAttributeTypes(const ctkVTKDataSetModel::AttributeTypes &attributeTypes)
QScopedPointer< ctkVTKDataSetArrayComboBoxPrivate > d_ptr
ctkVTKDataSetModel * dataSetModel() const