CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkVTKVolumePropertyWidget.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 __ctkVTKVolumePropertyWidget_h
22 #define __ctkVTKVolumePropertyWidget_h
23 
24 //Qt includes
25 #include <QWidget>
26 
27 // CTK includes
28 #include <ctkVTKObject.h>
29 #include "ctkVisualizationVTKWidgetsExport.h"
30 class ctkVTKVolumePropertyWidgetPrivate;
31 
32 // VTK includes
33 class vtkVolumeProperty;
34 
36 class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKVolumePropertyWidget
37  : public QWidget
38 {
39  Q_OBJECT
44  Q_PROPERTY(bool thresholdEnabled READ isThresholdEnabled WRITE setThresholdEnabled NOTIFY thresholdEnabledChanged)
45 
46 
47  Q_PROPERTY(bool thresholdToggleVisibility READ isThresholdToggleVisible WRITE setThresholdToggleVisible)
50 
51 public:
52  ctkVTKVolumePropertyWidget(QWidget* parent = 0);
53  virtual ~ctkVTKVolumePropertyWidget();
54 
55  vtkVolumeProperty* volumeProperty()const;
56 
57  bool isThresholdEnabled()const;
58 
59  bool isThresholdToggleVisible()const;
60  void setThresholdToggleVisible(bool showToggle);
61 
62  void chartsBounds(double bounds[4])const;
63  Q_INVOKABLE QList<double> chartsBounds()const;
64  void chartsExtent(double extent[4])const;
65  Q_INVOKABLE QList<double> chartsExtent()const;
66 
67 public Q_SLOTS:
68  void setVolumeProperty(vtkVolumeProperty* volumeProperty);
69 
73  void moveAllPoints(double xOffset, double yOffset = 0.,
74  bool dontSpreadFirstAndLast = false);
75 
81  void spreadAllPoints(double factor = 1.,
82  bool dontSpreadFirstAndLast = false);
83 
84  void setThresholdEnabled(bool enable);
85 
87  void setChartsExtent(double extent[2]);
88  void setChartsExtent(double min, double max);
89 
90 Q_SIGNALS:
91  void thresholdEnabledChanged(bool enable);
92  void chartsExtentChanged();
93 
94 protected Q_SLOTS:
95  void updateFromVolumeProperty();
96  void updateRange();
97 
98  void setInterpolationMode(int mode);
99  void setShade(bool);
100  void setAmbient(double value);
101  void setDiffuse(double value);
102  void setSpecular(double value);
103  void setSpecularPower(double value);
104 
105  void onThresholdOpacityToggled(bool);
108  void onAxesModified();
109 
110 protected:
111  QScopedPointer<ctkVTKVolumePropertyWidgetPrivate> d_ptr;
112 
113 private:
114  Q_DECLARE_PRIVATE(ctkVTKVolumePropertyWidget);
115  Q_DISABLE_COPY(ctkVTKVolumePropertyWidget);
116 };
117 
118 #endif
ctkVTKObject.h
ctkVTKVolumePropertyWidget::d_ptr
QScopedPointer< ctkVTKVolumePropertyWidgetPrivate > d_ptr
Definition: ctkVTKVolumePropertyWidget.h:111
QList
Definition: ctkCmdLineModuleBackend.h:30
QVTK_OBJECT
#define QVTK_OBJECT
Define VTK/Qt event/slot connection utility methods. It is a convenient macro that declares and defin...
Definition: ctkVTKObject.h:222
ctkVTKVolumePropertyWidget
Definition: ctkVTKVolumePropertyWidget.h:36