ctkVTKVolumePropertyWidget.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.commontk.org/LICENSE
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkVTKVolumePropertyWidget_h
  15. #define __ctkVTKVolumePropertyWidget_h
  16. //Qt includes
  17. #include <QWidget>
  18. // CTK includes
  19. #include <ctkVTKObject.h>
  20. #include "ctkVisualizationVTKWidgetsExport.h"
  21. class ctkVTKVolumePropertyWidgetPrivate;
  22. // VTK includes
  23. class vtkVolumeProperty;
  24. class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKVolumePropertyWidget
  25. : public QWidget
  26. {
  27. Q_OBJECT
  28. QVTK_OBJECT
  29. ///
  30. /// Control wether a range slider widget is used to edit the opacity
  31. /// function instead of a chart editor. False by default
  32. Q_PROPERTY(bool useThresholdSlider READ useThresholdSlider WRITE setUseThresholdSlider)
  33. public:
  34. ctkVTKVolumePropertyWidget(QWidget* parent = 0);
  35. virtual ~ctkVTKVolumePropertyWidget();
  36. vtkVolumeProperty* volumeProperty()const;
  37. bool useThresholdSlider()const;
  38. void setUseThresholdSlider(bool enable);
  39. public slots:
  40. void setVolumeProperty(vtkVolumeProperty* volumeProperty);
  41. protected slots:
  42. void updateFromVolumeProperty();
  43. void setInterpolationMode(int mode);
  44. void setShade(bool);
  45. void setAmbient(double value);
  46. void setDiffuse(double value);
  47. void setSpecular(double value);
  48. void setSpecularPower(double value);
  49. protected:
  50. QScopedPointer<ctkVTKVolumePropertyWidgetPrivate> d_ptr;
  51. private:
  52. Q_DECLARE_PRIVATE(ctkVTKVolumePropertyWidget);
  53. Q_DISABLE_COPY(ctkVTKVolumePropertyWidget);
  54. };
  55. #endif