VTK  9.7.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 "vtkWrappingHints.h" // For VTK_MARSHALAUTO
24 #include <vector> // For ivars
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkChartXYZ;
28 class vtkDataArray;
29 class vtkIdTypeArray;
30 class vtkPoints;
31 class vtkTable;
33 class vtkPen;
34 
35 class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkPlot3D : public vtkContextItem
36 {
37 public:
38  vtkTypeMacro(vtkPlot3D, vtkContextItem);
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
45  void SetPen(vtkPen* pen);
46  vtkPen* GetPen();
48 
50 
53  void SetSelectionPen(vtkPen* pen);
54  vtkPen* GetSelectionPen();
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);
121  virtual vtkIdTypeArray* GetSelection();
123 
124 protected:
125  vtkPlot3D();
126  ~vtkPlot3D() override;
127 
131  virtual void ComputeDataBounds();
132 
137 
142 
147 
153 
158 
163 
168 
173 
178 
183 
187  std::vector<vtkVector3f> DataBounds;
188 
193 
194 private:
195  vtkPlot3D(const vtkPlot3D&) = delete;
196  void operator=(const vtkPlot3D&) = delete;
197 };
198 
199 VTK_ABI_NAMESPACE_END
200 #endif // vtkPlot3D_h
std::string XAxisLabel
The label for the X Axis.
Definition: vtkPlot3D.h:157
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:27
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:187
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:363
vtkSmartPointer< vtkPen > Pen
This object stores the vtkPen that controls how the plot is drawn.
Definition: vtkPlot3D.h:136
vtkNew< vtkPoints > Points
The data points read in during SetInputData().
Definition: vtkPlot3D.h:172
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
int NumberOfComponents
Number of components in our color vectors.
Definition: vtkPlot3D.h:152
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:29
dynamic, self-adjusting array of unsigned char
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:59
std::string ZAxisLabel
The label for the Z Axis.
Definition: vtkPlot3D.h:167
std::string YAxisLabel
The label for the Y Axis.
Definition: vtkPlot3D.h:162
vtkChartXYZ * Chart
The chart containing this plot.
Definition: vtkPlot3D.h:182
#define VTK_MARSHALAUTO
Abstract class for 3D plots.
Definition: vtkPlot3D.h:35
vtkNew< vtkUnsignedCharArray > Colors
This array assigns a color to each datum in the plot.
Definition: vtkPlot3D.h:146
Factory class for drawing 3D XYZ charts.
Definition: vtkChartXYZ.h:40
vtkSmartPointer< vtkIdTypeArray > Selection
Selected indices for the table the plot is rendering.
Definition: vtkPlot3D.h:192
represent and manipulate 3D points
Definition: vtkPoints.h:30
vtkTimeStamp PointsBuildTime
When the points were last built.
Definition: vtkPlot3D.h:177
vtkPoints * GetVTKPoints()
Get all the data points within this plot.
Definition: vtkPlot3D.h:80