CTK 0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkVTKScalarsToColorsWidget.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 __ctkVTKScalarsToColorsWidget_h
22#define __ctkVTKScalarsToColorsWidget_h
23
24//Qt includes
25#include <QWidget>
26
27// CTK includes
28#include <ctkVTKObject.h>
29#include "ctkVisualizationVTKWidgetsExport.h"
31class ctkVTKScalarsToColorsWidgetPrivate;
32
33// VTK includes
34class vtkControlPointsItem;
35class vtkPlot;
36
38class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKScalarsToColorsWidget : public QWidget
39{
40 Q_OBJECT
42 Q_PROPERTY(bool horizontalSliderVisible READ isHorizontalSliderVisible WRITE setHorizontalSliderVisible)
43 Q_PROPERTY(bool verticalSliderVisible READ isVerticalSliderVisible WRITE setVerticalSliderVisible)
44 Q_PROPERTY(bool editColors READ editColors WRITE setEditColors)
45public:
46 ctkVTKScalarsToColorsWidget(QWidget* parent = 0);
48
50 vtkControlPointsItem* currentControlPointsItem()const;
51
53 void setHorizontalSliderVisible(bool visible);
54
56 void setVerticalSliderVisible(bool visible);
57
58 bool editColors()const;
59 void setEditColors(bool edit);
60
61 void xRange(double* range)const;
62 void yRange(double* range)const;
63
66 QWidgetList extraWidgets()const;
67
71 void addExtraWidget(QWidget* extraWidget);
72
73public Q_SLOTS:
74 void setCurrentControlPointsItem(vtkControlPointsItem* item);
75 void setCurrentPoint(int pointId);
76 void setXRange(double min, double max);
77 void setYRange(double min, double max);
78 void resetRange();
79
80Q_SIGNALS:
84
85protected Q_SLOTS:
86 void onPlotAdded(vtkPlot*);
88 void setCurrentPoint(vtkObject* controlPointsItem, void* pointId);
91 void onCurrentPointChanged(int pointId);
92 void onColorChanged(const QColor& color);
93 void onXChanged(double x);
94 void onOpacityChanged(double opacity);
95 void onMidPointChanged(double midPoint);
96 void onSharpnessChanged(double sharpness);
99 void onExpandButton(bool state);
100protected:
101 QScopedPointer<ctkVTKScalarsToColorsWidgetPrivate> d_ptr;
102
103private:
104 Q_DECLARE_PRIVATE(ctkVTKScalarsToColorsWidget);
105 Q_DISABLE_COPY(ctkVTKScalarsToColorsWidget);
106};
107
108#endif
void setCurrentPoint(int pointId)
void addExtraWidget(QWidget *extraWidget)
void xRange(double *range) const
void onOpacityChanged(double opacity)
void setVerticalSliderVisible(bool visible)
void onExpandButton(bool state)
void onSharpnessChanged(double sharpness)
void onPlotAdded(vtkPlot *)
ctkVTKScalarsToColorsView * view() const
ctkVTKScalarsToColorsWidget(QWidget *parent=0)
void setHorizontalSliderVisible(bool visible)
void onMidPointChanged(double midPoint)
void onColorChanged(const QColor &color)
bool isVerticalSliderVisible() const
void setYRange(double min, double max)
void onCurrentPointChanged(int pointId)
QScopedPointer< ctkVTKScalarsToColorsWidgetPrivate > d_ptr
void setXRange(double min, double max)
vtkControlPointsItem * currentControlPointsItem() const
void setEditColors(bool edit)
void setCurrentPoint(vtkObject *controlPointsItem, void *pointId)
void yRange(double *range) const
virtual ~ctkVTKScalarsToColorsWidget()
void setCurrentControlPointsItem(vtkControlPointsItem *item)
QWidgetList extraWidgets() const
Return the top-left corner widget if any.
bool isHorizontalSliderVisible() const
#define QVTK_OBJECT
Define VTK/Qt event/slot connection utility methods. It is a convenient macro that declares and defin...
Definition: ctkVTKObject.h:222