VTK  9.1.0
vtkPlot3D.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPlot3D.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15
27#ifndef vtkPlot3D_h
28#define vtkPlot3D_h
29
30#include "vtkChartsCoreModule.h" // For export macro
31#include "vtkContextItem.h"
32#include "vtkNew.h" // Needed to hold vtkNew ivars
33#include "vtkSmartPointer.h" // Needed to hold SP ivars
34#include "vtkVector.h" // For Points ivar
35#include <vector> // For ivars
36
37class vtkChartXYZ;
38class vtkDataArray;
39class vtkIdTypeArray;
40class vtkTable;
42class vtkPen;
43
44class VTKCHARTSCORE_EXPORT vtkPlot3D : public vtkContextItem
45{
46public:
47 vtkTypeMacro(vtkPlot3D, vtkContextItem);
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
51
54 void SetPen(vtkPen* pen);
57
59
65
67
70 virtual void SetInputData(vtkTable* input);
71 virtual void SetInputData(vtkTable* input, const vtkStdString& xName, const vtkStdString& yName,
72 const vtkStdString& zName);
73 virtual void SetInputData(vtkTable* input, const vtkStdString& xName, const vtkStdString& yName,
74 const vtkStdString& zName, const vtkStdString& colorName);
75 virtual void SetInputData(
76 vtkTable* input, vtkIdType xColumn, vtkIdType yColumn, vtkIdType zColumn);
78
84 virtual void SetColors(vtkDataArray* colorArr);
85
89 std::vector<vtkVector3f> GetPoints();
90
92
95 vtkGetObjectMacro(Chart, vtkChartXYZ);
96 virtual void SetChart(vtkChartXYZ* chart);
98
103
108
113
117 std::vector<vtkVector3f> GetDataBounds() { return this->DataBounds; }
118
120
123 virtual void SetSelection(vtkIdTypeArray* id);
126
127protected:
129 ~vtkPlot3D() override;
130
134 virtual void ComputeDataBounds();
135
140
145
150
156
161
166
171
175 std::vector<vtkVector3f> Points;
176
181
186
190 std::vector<vtkVector3f> DataBounds;
191
196
197private:
198 vtkPlot3D(const vtkPlot3D&) = delete;
199 void operator=(const vtkPlot3D&) = delete;
200};
201
202#endif // vtkPlot3D_h
Factory class for drawing 3D XYZ charts.
Definition: vtkChartXYZ.h:77
base class for items that are part of a vtkContextScene.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:113
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:136
Abstract class for 3D plots.
Definition: vtkPlot3D.h:45
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:185
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:190
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:160
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:139
virtual vtkIdTypeArray * GetSelection()
Set/get the selection array for the plot.
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:170
vtkTimeStamp PointsBuildTime
When the points were last built.
Definition: vtkPlot3D.h:180
int NumberOfComponents
Number of components in our color vectors.
Definition: vtkPlot3D.h:155
vtkSmartPointer< vtkIdTypeArray > Selection
Selected indices for the table the plot is rendering.
Definition: vtkPlot3D.h:195
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:149
vtkSmartPointer< vtkPen > SelectionPen
This object stores the vtkPen that controls how the plot is drawn.
Definition: vtkPlot3D.h:144
std::vector< vtkVector3f > GetDataBounds()
Get the bounding cube surrounding the currently rendered data points.
Definition: vtkPlot3D.h:117
std::string YAxisLabel
The label for the Y Axis.
Definition: vtkPlot3D.h:165
void SetSelectionPen(vtkPen *pen)
Set/get the vtkPen object that controls how this plot draws (out)lines.
std::vector< vtkVector3f > Points
The data points read in during SetInputData().
Definition: vtkPlot3D.h:175
std::vector< vtkVector3f > GetPoints()
Get all the data points within this 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.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:172
record modification and/or execution time
Definition: vtkTimeStamp.h:52
dynamic, self-adjusting array of unsigned char
@ string
Definition: vtkX3D.h:496
int vtkIdType
Definition: vtkType.h:332