ctkVTKScalarBarWidget.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.apache.org/licenses/LICENSE-2.0.txt
  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 __ctkVTKScalarBarWidget_h
  15. #define __ctkVTKScalarBarWidget_h
  16. // Qt includes
  17. #include <QWidget>
  18. // CTK includes
  19. #include <ctkPimpl.h>
  20. #include "ctkVisualizationVTKWidgetsExport.h"
  21. #include "ctkVTKObject.h"
  22. class ctkVTKScalarBarWidgetPrivate;
  23. class vtkScalarBarWidget;
  24. /// \ingroup Visualization_VTK_Widgets
  25. class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKScalarBarWidget : public QWidget
  26. {
  27. Q_OBJECT;
  28. QVTK_OBJECT;
  29. public:
  30. /// Constructors
  31. ctkVTKScalarBarWidget(QWidget* parentWidget = 0);
  32. ctkVTKScalarBarWidget(vtkScalarBarWidget* scalarBar, QWidget* parentWidget = 0);
  33. virtual ~ctkVTKScalarBarWidget();
  34. vtkScalarBarWidget* scalarBarWidget()const;
  35. bool display()const;
  36. /// Returns -1 if not scalarbar is set
  37. int maxNumberOfColors()const;
  38. int numberOfLabels()const;
  39. QString title()const;
  40. QString labelsFormat()const;
  41. public Q_SLOTS:
  42. void setScalarBarWidget(vtkScalarBarWidget* scalarBar);
  43. void setDisplay(bool visible);
  44. void setMaxNumberOfColors(int colorCount);
  45. void setNumberOfLabels(int labelCount);
  46. void setTitle(const QString& title);
  47. void setLabelsFormat(const QString& format);
  48. Q_SIGNALS:
  49. void modified();
  50. protected Q_SLOTS:
  51. void onScalarBarModified();
  52. protected:
  53. QScopedPointer<ctkVTKScalarBarWidgetPrivate> d_ptr;
  54. private:
  55. Q_DECLARE_PRIVATE(ctkVTKScalarBarWidget);
  56. Q_DISABLE_COPY(ctkVTKScalarBarWidget);
  57. };
  58. #endif