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 
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);
47 
49 
52  void SetSelectionPen(vtkPen* pen);
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 
99 
104 
109 
113  std::vector<vtkVector3f> GetDataBounds() { return this->DataBounds; }
114 
116 
119  virtual void SetSelection(vtkIdTypeArray* id);
122 
123 protected:
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
Factory class for drawing 3D XYZ charts.
Definition: vtkChartXYZ.h:49
base class for items that are part of a vtkContextScene.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:38
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:38
Abstract class for 3D plots.
Definition: vtkPlot3D.h:35
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 > GetDataBounds()
Get the bounding cube surrounding the currently rendered data points.
Definition: vtkPlot3D.h:113
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
vtkPen * GetSelectionPen()
Set/get the vtkPen object that controls how this plot draws (out)lines.
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.
vtkSmartPointer< vtkPen > Pen
This object stores the vtkPen that controls how the plot is drawn.
Definition: vtkPlot3D.h:135
vtkPen * GetPen()
Set/get the vtkPen object that controls how this plot draws (out)lines.
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
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
vtkPoints * GetVTKPoints()
Get all the data points within this plot.
Definition: vtkPlot3D.h:79
std::string YAxisLabel
The label for the Y Axis.
Definition: vtkPlot3D.h:161
std::vector< vtkVector3f > GetPoints()
Get a copy of all the data points.
void SetSelectionPen(vtkPen *pen)
Set/get the vtkPen object that controls how this plot draws (out)lines.
virtual vtkIdTypeArray * GetSelection()
Set/get the selection array for the plot.
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:38
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
record modification and/or execution time
Definition: vtkTimeStamp.h:34
dynamic, self-adjusting array of unsigned char
@ string
Definition: vtkX3D.h:490
int vtkIdType
Definition: vtkType.h:315