VTK  9.3.1
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 
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkChartXYZ;
27 class vtkDataArray;
28 class vtkIdTypeArray;
29 class vtkPoints;
30 class vtkTable;
32 class vtkPen;
33 
34 class VTKCHARTSCORE_EXPORT vtkPlot3D : public vtkContextItem
35 {
36 public:
37  vtkTypeMacro(vtkPlot3D, vtkContextItem);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
41 
44  void SetPen(vtkPen* pen);
45  vtkPen* GetPen();
47 
49 
52  void SetSelectionPen(vtkPen* pen);
53  vtkPen* GetSelectionPen();
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);
120  virtual vtkIdTypeArray* GetSelection();
122 
123 protected:
124  vtkPlot3D();
125  ~vtkPlot3D() override;
126 
130  virtual void ComputeDataBounds();
131 
136 
141 
146 
152 
157 
162 
167 
172 
177 
182 
186  std::vector<vtkVector3f> DataBounds;
187 
192 
193 private:
194  vtkPlot3D(const vtkPlot3D&) = delete;
195  void operator=(const vtkPlot3D&) = delete;
196 };
197 
198 VTK_ABI_NAMESPACE_END
199 #endif // vtkPlot3D_h
std::string XAxisLabel
The label for the X Axis.
Definition: vtkPlot3D.h:156
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:28
base class for items that are part of a vtkContextScene.
record modification and/or execution time
Definition: vtkTimeStamp.h:24
std::vector< vtkVector3f > DataBounds
A bounding cube surrounding the currently rendered data points.
Definition: vtkPlot3D.h:186
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:315
vtkSmartPointer< vtkPen > Pen
This object stores the vtkPen that controls how the plot is drawn.
Definition: vtkPlot3D.h:135
vtkNew< vtkPoints > Points
The data points read in during SetInputData().
Definition: vtkPlot3D.h:171
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
int NumberOfComponents
Number of components in our color vectors.
Definition: vtkPlot3D.h:151
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:28
dynamic, self-adjusting array of unsigned char
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:58
std::string ZAxisLabel
The label for the Z Axis.
Definition: vtkPlot3D.h:166
std::string YAxisLabel
The label for the Y Axis.
Definition: vtkPlot3D.h:161
vtkChartXYZ * Chart
The chart containing this plot.
Definition: vtkPlot3D.h:181
Abstract class for 3D plots.
Definition: vtkPlot3D.h:34
vtkNew< vtkUnsignedCharArray > Colors
This array assigns a color to each datum in the plot.
Definition: vtkPlot3D.h:145
Factory class for drawing 3D XYZ charts.
Definition: vtkChartXYZ.h:39
vtkSmartPointer< vtkIdTypeArray > Selection
Selected indices for the table the plot is rendering.
Definition: vtkPlot3D.h:191
represent and manipulate 3D points
Definition: vtkPoints.h:28
vtkTimeStamp PointsBuildTime
When the points were last built.
Definition: vtkPlot3D.h:176
vtkPoints * GetVTKPoints()
Get all the data points within this plot.
Definition: vtkPlot3D.h:79