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);
54 
55  vtkVolumeProperty* volumeProperty()const;
56 
57  bool isThresholdEnabled()const;
58 
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);
93 
94 protected Q_SLOTS:
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 
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::chartsBounds
Q_INVOKABLE QList< double > chartsBounds() const
ctkVTKVolumePropertyWidget::setShade
void setShade(bool)
ctkVTKVolumePropertyWidget::spreadAllPoints
void spreadAllPoints(double factor=1., bool dontSpreadFirstAndLast=false)
ctkVTKVolumePropertyWidget::d_ptr
QScopedPointer< ctkVTKVolumePropertyWidgetPrivate > d_ptr
Definition: ctkVTKVolumePropertyWidget.h:111
ctkVTKVolumePropertyWidget::setThresholdEnabled
void setThresholdEnabled(bool enable)
ctkVTKVolumePropertyWidget::setAmbient
void setAmbient(double value)
ctkVTKVolumePropertyWidget::updateRange
void updateRange()
ctkVTKVolumePropertyWidget::isThresholdEnabled
bool isThresholdEnabled() const
ctkVTKVolumePropertyWidget::setChartsExtent
void setChartsExtent(double min, double max)
QList
Definition: ctkCmdLineModuleBackend.h:30
ctkVTKVolumePropertyWidget::chartsExtent
void chartsExtent(double extent[4]) const
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::onThresholdOpacityToggled
void onThresholdOpacityToggled(bool)
ctkVTKVolumePropertyWidget::~ctkVTKVolumePropertyWidget
virtual ~ctkVTKVolumePropertyWidget()
ctkVTKVolumePropertyWidget::setThresholdToggleVisible
void setThresholdToggleVisible(bool showToggle)
ctkVTKVolumePropertyWidget::ctkVTKVolumePropertyWidget
ctkVTKVolumePropertyWidget(QWidget *parent=0)
ctkVTKVolumePropertyWidget::updateFromVolumeProperty
void updateFromVolumeProperty()
ctkVTKVolumePropertyWidget::setInterpolationMode
void setInterpolationMode(int mode)
ctkVTKVolumePropertyWidget::thresholdEnabledChanged
void thresholdEnabledChanged(bool enable)
ctkVTKVolumePropertyWidget::setSpecular
void setSpecular(double value)
ctkVTKVolumePropertyWidget::chartsExtent
Q_INVOKABLE QList< double > chartsExtent() const
ctkVTKVolumePropertyWidget
Definition: ctkVTKVolumePropertyWidget.h:38
ctkVTKVolumePropertyWidget::setDiffuse
void setDiffuse(double value)
ctkVTKVolumePropertyWidget::volumeProperty
vtkVolumeProperty * volumeProperty() const
ctkVTKVolumePropertyWidget::onAxesModified
void onAxesModified()
ctkVTKVolumePropertyWidget::setSpecularPower
void setSpecularPower(double value)
ctkVTKVolumePropertyWidget::setChartsExtent
void setChartsExtent(double extent[2])
Set chart extent.
ctkVTKVolumePropertyWidget::moveAllPoints
void moveAllPoints(double xOffset, double yOffset=0., bool dontSpreadFirstAndLast=false)
ctkVTKVolumePropertyWidget::chartsExtentChanged
void chartsExtentChanged()
ctkVTKVolumePropertyWidget::isThresholdToggleVisible
bool isThresholdToggleVisible() const
ctkVTKVolumePropertyWidget::chartsBounds
void chartsBounds(double bounds[4]) const
ctkVTKVolumePropertyWidget::setVolumeProperty
void setVolumeProperty(vtkVolumeProperty *volumeProperty)