CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkVTKScalarBarWidget.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 __ctkVTKScalarBarWidget_h
22 #define __ctkVTKScalarBarWidget_h
23 
24 // Qt includes
25 #include <QWidget>
26 
27 // CTK includes
28 #include <ctkPimpl.h>
29 #include "ctkVisualizationVTKWidgetsExport.h"
30 #include "ctkVTKObject.h"
31 
32 class ctkVTKScalarBarWidgetPrivate;
33 class vtkScalarBarWidget;
34 
36 class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKScalarBarWidget : public QWidget
37 {
38  Q_OBJECT;
40 
41 public:
43  ctkVTKScalarBarWidget(QWidget* parentWidget = 0);
44  ctkVTKScalarBarWidget(vtkScalarBarWidget* scalarBar, QWidget* parentWidget = 0);
46 
47  vtkScalarBarWidget* scalarBarWidget()const;
48 
49  bool display()const;
51  int maxNumberOfColors()const;
52  int numberOfLabels()const;
53  QString title()const;
54  QString labelsFormat()const;
55 
56 public Q_SLOTS:
57  void setScalarBarWidget(vtkScalarBarWidget* scalarBar);
58 
59  void setDisplay(bool visible);
60  void setMaxNumberOfColors(int colorCount);
61  void setNumberOfLabels(int labelCount);
62  void setTitle(const QString& title);
63  void setLabelsFormat(const QString& format);
64 
65 Q_SIGNALS:
66  void modified();
67 
68 protected Q_SLOTS:
70 
71 protected:
72  QScopedPointer<ctkVTKScalarBarWidgetPrivate> d_ptr;
73 
74 private:
75  Q_DECLARE_PRIVATE(ctkVTKScalarBarWidget);
76  Q_DISABLE_COPY(ctkVTKScalarBarWidget);
77 };
78 
79 #endif
void setTitle(const QString &title)
virtual ~ctkVTKScalarBarWidget()
ctkVTKScalarBarWidget(vtkScalarBarWidget *scalarBar, QWidget *parentWidget=0)
ctkVTKScalarBarWidget(QWidget *parentWidget=0)
Constructors.
void setLabelsFormat(const QString &format)
QString labelsFormat() const
void setDisplay(bool visible)
int maxNumberOfColors() const
Returns -1 if not scalarbar is set.
void setNumberOfLabels(int labelCount)
void setScalarBarWidget(vtkScalarBarWidget *scalarBar)
int numberOfLabels() const
QString title() const
void setMaxNumberOfColors(int colorCount)
vtkScalarBarWidget * scalarBarWidget() const
bool display() const
QScopedPointer< ctkVTKScalarBarWidgetPrivate > d_ptr
#define QVTK_OBJECT
Define VTK/Qt event/slot connection utility methods. It is a convenient macro that declares and defin...
Definition: ctkVTKObject.h:222