CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkVTKScalarsToColorsComboBox.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 __ctkVTKScalarsToColorsComboBox_h
22 #define __ctkVTKScalarsToColorsComboBox_h
23 
24 // CTK includes
25 #include "ctkComboBox.h"
26 #include "ctkVisualizationVTKWidgetsExport.h"
27 
28 // VTK includes
29 #include <vtkSmartPointer.h>
30 
31 class ctkVTKScalarsToColorsComboBoxPrivate;
32 class vtkScalarsToColors;
33 
37 class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKScalarsToColorsComboBox
38  : public ctkComboBox
39 {
40  Q_OBJECT
43 
46  Q_PROPERTY(vtkScalarsToColors* currentScalarsToColors
47  READ currentScalarsToColors WRITE setCurrentScalarsToColors
48  NOTIFY currentScalarsToColorsChanged);
49 public:
50 
52  explicit ctkVTKScalarsToColorsComboBox(QWidget* parent = 0);
54 
58  int addScalarsToColors(vtkScalarsToColors* function, const QString& text =
59  QString());
60  vtkScalarsToColors* getScalarsToColors(int index) const;
61 
64  int findScalarsToColors(vtkScalarsToColors* scalarsToColors) const;
65 
66  void removeScalarsToColors(vtkScalarsToColors* scalarsToColors);
67 
70  vtkScalarsToColors* currentScalarsToColors() const;
71 
72 public slots:
74  void setCurrentScalarsToColors(vtkScalarsToColors* scalarsToColors);
75 
76 signals:
78  void currentScalarsToColorsChanged(vtkScalarsToColors*);
79 
80 protected slots:
82  void onRowsAboutToBeRemoved(const QModelIndex& parent, int first, int last);
83 
84 protected:
85  QScopedPointer<ctkVTKScalarsToColorsComboBoxPrivate> d_ptr;
86 
87 private:
88  Q_DECLARE_PRIVATE(ctkVTKScalarsToColorsComboBox);
89  Q_DISABLE_COPY(ctkVTKScalarsToColorsComboBox);
90 };
91 
92 #endif
ctkVTKScalarsToColorsComboBox
Definition: ctkVTKScalarsToColorsComboBox.h:39
ctkVTKScalarsToColorsComboBox::addScalarsToColors
int addScalarsToColors(vtkScalarsToColors *function, const QString &text=QString())
ctkVTKScalarsToColorsComboBox::removeScalarsToColors
void removeScalarsToColors(vtkScalarsToColors *scalarsToColors)
ctkVTKScalarsToColorsComboBox::currentScalarsToColors
vtkScalarsToColors * currentScalarsToColors() const
ctkVTKScalarsToColorsComboBox::findScalarsToColors
int findScalarsToColors(vtkScalarsToColors *scalarsToColors) const
ctkVTKScalarsToColorsComboBox::~ctkVTKScalarsToColorsComboBox
virtual ~ctkVTKScalarsToColorsComboBox()
ctkVTKScalarsToColorsComboBox::currentScalarsToColorsChanged
void currentScalarsToColorsChanged(vtkScalarsToColors *)
Signal triggered when the current scalars to colors function changes.
ctkComboBox.h
ctkVTKScalarsToColorsComboBox::ctkVTKScalarsToColorsComboBox
ctkVTKScalarsToColorsComboBox(QWidget *parent=0)
Constructors.
ctkVTKScalarsToColorsComboBox::getScalarsToColors
vtkScalarsToColors * getScalarsToColors(int index) const
ctkVTKScalarsToColorsComboBox::onCurrentIndexChanged
void onCurrentIndexChanged(int)
ctkVTKScalarsToColorsComboBox::d_ptr
QScopedPointer< ctkVTKScalarsToColorsComboBoxPrivate > d_ptr
Definition: ctkVTKScalarsToColorsComboBox.h:85
ctkComboBox
ctkComboBox is an advanced QComboBox. It adds multiple features:
Definition: ctkComboBox.h:45
ctkVTKScalarsToColorsComboBox::setCurrentScalarsToColors
void setCurrentScalarsToColors(vtkScalarsToColors *scalarsToColors)
ctkVTKScalarsToColorsComboBox::onRowsAboutToBeRemoved
void onRowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)