ctkVTKChartView.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 __ctkVTKChartView_h
  15. #define __ctkVTKChartView_h
  16. // CTK includes
  17. #include <ctkPimpl.h>
  18. #include "ctkVisualizationVTKWidgetsExport.h"
  19. class ctkVTKChartViewPrivate;
  20. // VTK includes
  21. #include <QVTKWidget.h>
  22. class vtkChartXY;
  23. class vtkPlot;
  24. class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKChartView : public QVTKWidget
  25. {
  26. Q_OBJECT
  27. Q_PROPERTY(QString title READ title WRITE setTitle)
  28. public:
  29. ctkVTKChartView(QWidget* parent = 0);
  30. virtual ~ctkVTKChartView();
  31. /// Generic function to add a custom plot. \a plot is added into the chart
  32. void addPlot(vtkPlot* plot);
  33. /// Utility function that returns the view chart. It can be used for customizing
  34. /// the chart display options (axes, legend...)
  35. vtkChartXY* chart()const;
  36. /// Title that appears inside the view
  37. QString title()const;
  38. void setTitle(const QString& title);
  39. void fitAxesToBounds();
  40. protected:
  41. QScopedPointer<ctkVTKChartViewPrivate> d_ptr;
  42. private:
  43. Q_DECLARE_PRIVATE(ctkVTKChartView);
  44. Q_DISABLE_COPY(ctkVTKChartView);
  45. };
  46. #endif