ctkVTKScalarsToColorsWidget.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 __ctkVTKScalarsToColorsWidget_h
  15. #define __ctkVTKScalarsToColorsWidget_h
  16. //Qt includes
  17. #include <QWidget>
  18. // CTK includes
  19. #include <ctkVTKObject.h>
  20. #include "ctkVisualizationVTKWidgetsExport.h"
  21. class ctkVTKScalarsToColorsView;
  22. class ctkVTKScalarsToColorsWidgetPrivate;
  23. // VTK includes
  24. class vtkControlPointsItem;
  25. class vtkPlot;
  26. class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKScalarsToColorsWidget : public QWidget
  27. {
  28. Q_OBJECT
  29. QVTK_OBJECT
  30. Q_PROPERTY(bool horizontalSliderVisible READ isHorizontalSliderVisible WRITE setHorizontalSliderVisible)
  31. Q_PROPERTY(bool verticalSliderVisible READ isVerticalSliderVisible WRITE setVerticalSliderVisible)
  32. public:
  33. ctkVTKScalarsToColorsWidget(QWidget* parent = 0);
  34. virtual ~ctkVTKScalarsToColorsWidget();
  35. ctkVTKScalarsToColorsView* view()const;
  36. vtkControlPointsItem* currentControlPointsItem()const;
  37. bool isHorizontalSliderVisible()const;
  38. void setHorizontalSliderVisible(bool visible);
  39. bool isVerticalSliderVisible()const;
  40. void setVerticalSliderVisible(bool visible);
  41. public slots:
  42. void setCurrentControlPointsItem(vtkControlPointsItem* item);
  43. void setCurrentPoint(int pointId);
  44. protected slots:
  45. void onPlotAdded(vtkPlot*);
  46. void onBoundsChanged();
  47. void setCurrentPoint(vtkObject* controlPointsItem, void* pointId);
  48. void updateCurrentPoint();
  49. void onCurrentPointChanged(int pointId);
  50. void onColorChanged(const QColor& color);
  51. void onOpacityChanged(double opacity);
  52. void onMidPointChanged(double midPoint);
  53. void onSharpnessChanged(double sharpness);
  54. void onXRangeChanged(double min, double max);
  55. void onYRangeChanged(double min, double max);
  56. void onAxesModified();
  57. protected:
  58. QScopedPointer<ctkVTKScalarsToColorsWidgetPrivate> d_ptr;
  59. private:
  60. Q_DECLARE_PRIVATE(ctkVTKScalarsToColorsWidget);
  61. Q_DISABLE_COPY(ctkVTKScalarsToColorsWidget);
  62. };
  63. #endif