ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vtkplot2dwidget.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #include "vtkplot2dwidget.h"
9 
10 #include <vtkChartXY.h>
11 #include <vtkContextScene.h>
12 #include <vtkContextView.h>
13 
14 #include "vtkutils.h"
15 
16 namespace VtkUtils {
17 class VtkPlot2DWidgetPrivate {
18 public:
20 };
21 
22 VtkPlot2DWidget::VtkPlot2DWidget(QWidget* parent) : VtkPlotWidget(parent) {
23  d_ptr = new VtkPlot2DWidgetPrivate;
24 }
25 
27 
28 vtkContextItem* VtkPlot2DWidget::chart() const {
29  vtkInitOnce(d_ptr->chart);
30  contextView()->GetScene()->AddItem(d_ptr->chart);
31  return d_ptr->chart;
32 }
33 
34 } // namespace VtkUtils
VtkPlot2DWidget(QWidget *parent=nullptr)
vtkContextItem * chart() const
vtkContextView * contextView() const
void vtkInitOnce(T **obj)
Definition: vtkutils.h:44