VTK  9.3.0
vtkPlot3D.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
15#ifndef vtkPlot3D_h
16#define vtkPlot3D_h
17
18#include "vtkChartsCoreModule.h" // For export macro
19#include "vtkContextItem.h"
20#include "vtkNew.h" // Needed to hold vtkNew ivars
21#include "vtkSmartPointer.h" // Needed to hold SP ivars
22#include "vtkVector.h" // For Points ivar
23#include <vector> // For ivars
24
25VTK_ABI_NAMESPACE_BEGIN
26class vtkChartXYZ;
27class vtkDataArray;
28class vtkIdTypeArray;
29class vtkPoints;
30class vtkTable;
32class vtkPen;
33
34class VTKCHARTSCORE_EXPORT vtkPlot3D : public vtkContextItem
35{
36public:
37 vtkTypeMacro(vtkPlot3D, vtkContextItem);
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
41
44 void SetPen(vtkPen* pen);
47
49
55
57
60 virtual void SetInputData(vtkTable* input);
61 virtual void SetInputData(vtkTable* input, const vtkStdString& xName, const vtkStdString& yName,
62 const vtkStdString& zName);
63 virtual void SetInputData(vtkTable* input, const vtkStdString& xName, const vtkStdString& yName,
64 const vtkStdString& zName, const vtkStdString& colorName);
65 virtual void SetInputData(
66 vtkTable* input, vtkIdType xColumn, vtkIdType yColumn, vtkIdType zColumn);
68
74 virtual void SetColors(vtkDataArray* colorArr);
75
79 vtkPoints* GetVTKPoints() { return this->Points; }
80
85 std::vector<vtkVector3f> GetPoints();
86
88
91 vtkGetObjectMacro(Chart, vtkChartXYZ);
92 virtual void SetChart(vtkChartXYZ* chart);
94
98 std::string GetXAxisLabel();
99
103 std::string GetYAxisLabel();
104
108 std::string GetZAxisLabel();
109
113 std::vector<vtkVector3f> GetDataBounds() { return this->DataBounds; }
114
116
119 virtual void SetSelection(vtkIdTypeArray* id);
122
123protected:
125 ~vtkPlot3D() override;
126
130 virtual void ComputeDataBounds();
131
136
141
146
152
156 std::string XAxisLabel;
157
161 std::string YAxisLabel;
162
166 std::string ZAxisLabel;
167
172
177
182
186 std::vector<vtkVector3f> DataBounds;
187
192
193private:
194 vtkPlot3D(const vtkPlot3D&) = delete;
195 void operator=(const vtkPlot3D&) = delete;
196};
197
198VTK_ABI_NAMESPACE_END
199#endif // vtkPlot3D_h
Factory class for drawing 3D XYZ charts.
Definition vtkChartXYZ.h:40
base class for items that are part of a vtkContextScene.
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:29
Allocate and hold a VTK object.
Definition vtkNew.h:51
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition vtkPen.h:29
Abstract class for 3D plots.
Definition vtkPlot3D.h:35
vtkPen * GetPen()
Set/get the vtkPen object that controls how this plot draws (out)lines.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void ComputeDataBounds()
Generate a bounding cube for our data.
std::string GetZAxisLabel()
Get the label for the Z axis.
std::string GetXAxisLabel()
Get the label for the X axis.
vtkChartXYZ * Chart
The chart containing this plot.
Definition vtkPlot3D.h:181
void SetPen(vtkPen *pen)
Set/get the vtkPen object that controls how this plot draws (out)lines.
std::vector< vtkVector3f > DataBounds
A bounding cube surrounding the currently rendered data points.
Definition vtkPlot3D.h:186
virtual void SetInputData(vtkTable *input, const vtkStdString &xName, const vtkStdString &yName, const vtkStdString &zName)
Set the input to the plot.
virtual void SetChart(vtkChartXYZ *chart)
Get/set the chart for this plot.
~vtkPlot3D() override
virtual void SetSelection(vtkIdTypeArray *id)
Set/get the selection array for the plot.
std::string XAxisLabel
The label for the X Axis.
Definition vtkPlot3D.h:156
virtual void SetInputData(vtkTable *input)
Set the input to the plot.
vtkPen * GetSelectionPen()
Set/get the vtkPen object that controls how this plot draws (out)lines.
vtkSmartPointer< vtkPen > Pen
This object stores the vtkPen that controls how the plot is drawn.
Definition vtkPlot3D.h:135
virtual vtkIdTypeArray * GetSelection()
Set/get the selection array for the plot.
vtkNew< vtkPoints > Points
The data points read in during SetInputData().
Definition vtkPlot3D.h:171
virtual void SetInputData(vtkTable *input, const vtkStdString &xName, const vtkStdString &yName, const vtkStdString &zName, const vtkStdString &colorName)
Set the input to the plot.
std::string ZAxisLabel
The label for the Z Axis.
Definition vtkPlot3D.h:166
vtkTimeStamp PointsBuildTime
When the points were last built.
Definition vtkPlot3D.h:176
int NumberOfComponents
Number of components in our color vectors.
Definition vtkPlot3D.h:151
vtkPoints * GetVTKPoints()
Get all the data points within this plot.
Definition vtkPlot3D.h:79
vtkSmartPointer< vtkIdTypeArray > Selection
Selected indices for the table the plot is rendering.
Definition vtkPlot3D.h:191
virtual void SetColors(vtkDataArray *colorArr)
Set the color of each point in the plot.
vtkNew< vtkUnsignedCharArray > Colors
This array assigns a color to each datum in the plot.
Definition vtkPlot3D.h:145
vtkSmartPointer< vtkPen > SelectionPen
This object stores the vtkPen that controls how the plot is drawn.
Definition vtkPlot3D.h:140
std::vector< vtkVector3f > GetDataBounds()
Get the bounding cube surrounding the currently rendered data points.
Definition vtkPlot3D.h:113
std::string YAxisLabel
The label for the Y Axis.
Definition vtkPlot3D.h:161
void SetSelectionPen(vtkPen *pen)
Set/get the vtkPen object that controls how this plot draws (out)lines.
std::vector< vtkVector3f > GetPoints()
Get a copy of all the data points.
std::string GetYAxisLabel()
Get the label for the Y axis.
virtual void SetInputData(vtkTable *input, vtkIdType xColumn, vtkIdType yColumn, vtkIdType zColumn)
Set the input to the plot.
represent and manipulate 3D points
Definition vtkPoints.h:29
Hold a reference to a vtkObjectBase instance.
Wrapper around std::string to keep symbols short.
A table, which contains similar-typed columns of data.
Definition vtkTable.h:59
record modification and/or execution time
dynamic, self-adjusting array of unsigned char
int vtkIdType
Definition vtkType.h:315