VTK  9.4.20250104
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 "vtkWrappingHints.h" // For VTK_MARSHALAUTO
24#include <vector> // For ivars
25
26VTK_ABI_NAMESPACE_BEGIN
27class vtkChartXYZ;
28class vtkDataArray;
29class vtkIdTypeArray;
30class vtkPoints;
31class vtkTable;
33class vtkPen;
34
35class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkPlot3D : public vtkContextItem
36{
37public:
38 vtkTypeMacro(vtkPlot3D, vtkContextItem);
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
42
45 void SetPen(vtkPen* pen);
48
50
56
58
61 virtual void SetInputData(vtkTable* input);
62 virtual void SetInputData(vtkTable* input, const vtkStdString& xName, const vtkStdString& yName,
63 const vtkStdString& zName);
64 virtual void SetInputData(vtkTable* input, const vtkStdString& xName, const vtkStdString& yName,
65 const vtkStdString& zName, const vtkStdString& colorName);
66 virtual void SetInputData(
67 vtkTable* input, vtkIdType xColumn, vtkIdType yColumn, vtkIdType zColumn);
69
75 virtual void SetColors(vtkDataArray* colorArr);
76
80 vtkPoints* GetVTKPoints() { return this->Points; }
81
86 std::vector<vtkVector3f> GetPoints();
87
89
92 vtkGetObjectMacro(Chart, vtkChartXYZ);
93 virtual void SetChart(vtkChartXYZ* chart);
95
99 std::string GetXAxisLabel();
100
104 std::string GetYAxisLabel();
105
109 std::string GetZAxisLabel();
110
114 std::vector<vtkVector3f> GetDataBounds() { return this->DataBounds; }
115
117
120 virtual void SetSelection(vtkIdTypeArray* id);
123
124protected:
126 ~vtkPlot3D() override;
127
131 virtual void ComputeDataBounds();
132
137
142
147
153
157 std::string XAxisLabel;
158
162 std::string YAxisLabel;
163
167 std::string ZAxisLabel;
168
173
178
183
187 std::vector<vtkVector3f> DataBounds;
188
193
194private:
195 vtkPlot3D(const vtkPlot3D&) = delete;
196 void operator=(const vtkPlot3D&) = delete;
197};
198
199VTK_ABI_NAMESPACE_END
200#endif // vtkPlot3D_h
Factory class for drawing 3D XYZ charts.
Definition vtkChartXYZ.h:70
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:108
Allocate and hold a VTK object.
Definition vtkNew.h:167
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition vtkPen.h:79
Abstract class for 3D plots.
Definition vtkPlot3D.h:36
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:182
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:187
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:157
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:136
virtual vtkIdTypeArray * GetSelection()
Set/get the selection array for the plot.
vtkNew< vtkPoints > Points
The data points read in during SetInputData().
Definition vtkPlot3D.h:172
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:167
vtkTimeStamp PointsBuildTime
When the points were last built.
Definition vtkPlot3D.h:177
int NumberOfComponents
Number of components in our color vectors.
Definition vtkPlot3D.h:152
vtkPoints * GetVTKPoints()
Get all the data points within this plot.
Definition vtkPlot3D.h:80
vtkSmartPointer< vtkIdTypeArray > Selection
Selected indices for the table the plot is rendering.
Definition vtkPlot3D.h:192
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:146
vtkSmartPointer< vtkPen > SelectionPen
This object stores the vtkPen that controls how the plot is drawn.
Definition vtkPlot3D.h:141
std::vector< vtkVector3f > GetDataBounds()
Get the bounding cube surrounding the currently rendered data points.
Definition vtkPlot3D.h:114
std::string YAxisLabel
The label for the Y Axis.
Definition vtkPlot3D.h:162
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:139
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:169
record modification and/or execution time
dynamic, self-adjusting array of unsigned char
int vtkIdType
Definition vtkType.h:315
#define VTK_MARSHALAUTO