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);
51  virtual ~ctkVTKDataSetArrayComboBox();
52 
53  vtkAbstractArray* currentArray()const;
54  QString currentArrayName()const;
55  vtkDataSet* dataSet()const;
56 
60  int currentArrayLocation()const;
61 
62  ctkVTKDataSetModel::AttributeTypes attributeTypes()const;
63  void setAttributeTypes(const ctkVTKDataSetModel::AttributeTypes& attributeTypes);
64 
71  void setNoneEnabled(bool enable);
72  bool noneEnabled()const;
73 
76  ctkVTKDataSetModel* dataSetModel()const;
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:
92  void onCurrentIndexChanged(int);
93 protected:
94  QScopedPointer<ctkVTKDataSetArrayComboBoxPrivate> d_ptr;
95 
96 private:
97  Q_DECLARE_PRIVATE(ctkVTKDataSetArrayComboBox);
98  Q_DISABLE_COPY(ctkVTKDataSetArrayComboBox);
99 };
100 
101 #endif
ctkVTKDataSetModel
Definition: ctkVTKDataSetModel.h:49
ctkVTKDataSetArrayComboBox
Definition: ctkVTKDataSetArrayComboBox.h:38
ctkVTKDataSetArrayComboBox::Superclass
QComboBox Superclass
Superclass typedef.
Definition: ctkVTKDataSetArrayComboBox.h:47
ctkVTKDataSetModel.h