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  void chartsExtent(double extent[4])const;
64 
65 public Q_SLOTS:
66  void setVolumeProperty(vtkVolumeProperty* volumeProperty);
67 
71  void moveAllPoints(double xOffset, double yOffset = 0.,
72  bool dontSpreadFirstAndLast = false);
73 
79  void spreadAllPoints(double factor = 1.,
80  bool dontSpreadFirstAndLast = false);
81 
82  void setThresholdEnabled(bool enable);
83 
84 Q_SIGNALS:
85  void thresholdEnabledChanged(bool enable);
86  void chartsExtentChanged();
87 
88 protected Q_SLOTS:
89  void updateFromVolumeProperty();
90  void updateRange();
91 
92  void setInterpolationMode(int mode);
93  void setShade(bool);
94  void setAmbient(double value);
95  void setDiffuse(double value);
96  void setSpecular(double value);
97  void setSpecularPower(double value);
98 
99  void onThresholdOpacityToggled(bool);
102  void onAxesModified();
103 
104 protected:
105  QScopedPointer<ctkVTKVolumePropertyWidgetPrivate> d_ptr;
106 
107 private:
108  Q_DECLARE_PRIVATE(ctkVTKVolumePropertyWidget);
109  Q_DISABLE_COPY(ctkVTKVolumePropertyWidget);
110 };
111 
112 #endif
QScopedPointer< ctkVTKVolumePropertyWidgetPrivate > 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