VTK  9.4.20241016
vtkPlotSurface.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
35#ifndef vtkPlotSurface_h
36#define vtkPlotSurface_h
37
38#include "vtkChartsCoreModule.h" // For export macro
39#include "vtkNew.h" // For vtkNew ivar
40#include "vtkPlot3D.h"
41#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
42
43VTK_ABI_NAMESPACE_BEGIN
44class vtkContext2D;
45class vtkLookupTable;
46class vtkTable;
47
48class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkPlotSurface : public vtkPlot3D
49{
50public:
51 vtkTypeMacro(vtkPlotSurface, vtkPlot3D);
52 void PrintSelf(ostream& os, vtkIndent indent) override;
54
58 bool Paint(vtkContext2D* painter) override;
59
63 void SetInputData(vtkTable* input) override;
64
66
71 void SetInputData(vtkTable* input, const vtkStdString& xName, const vtkStdString& yName,
72 const vtkStdString& zName) override;
73 void SetInputData(vtkTable* input, const vtkStdString& xName, const vtkStdString& yName,
74 const vtkStdString& zName, const vtkStdString& colorName) override;
76 vtkTable* input, vtkIdType xColumn, vtkIdType yColumn, vtkIdType zColumn) override;
78
85 void SetXRange(float min, float max);
86
93 void SetYRange(float min, float max);
94
95protected:
97 ~vtkPlotSurface() override;
98
103
107 void InsertSurfaceVertex(float* data, float value, int i, int j, int& pos);
108
113
117 float ColumnToX(int columnIndex);
118
122 float RowToY(int rowIndex);
123
128
133
138
143
148
153
158
160
163 float XMinimum;
164 float XMaximum;
165 float YMinimum;
166 float YMaximum;
168
174
175private:
176 vtkPlotSurface(const vtkPlotSurface&) = delete;
177 void operator=(const vtkPlotSurface&) = delete;
178};
179
180VTK_ABI_NAMESPACE_END
181#endif // vtkPlotSurface_h
Class for drawing 2D primitives to a graphical context.
a simple class to control print indentation
Definition vtkIndent.h:108
map scalar values into colors via a lookup table
Allocate and hold a VTK object.
Definition vtkNew.h:167
Abstract class for 3D plots.
Definition vtkPlot3D.h:36
3D surface plot.
void SetInputData(vtkTable *input) override
Set the input to the surface plot.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkNew< vtkPoints > Surface
Surface to render.
bool DataHasBeenRescaled
true if user-defined data scaling has already been applied, false otherwise.
void SetXRange(float min, float max)
Set the range of the input data for the X dimension.
vtkNew< vtkLookupTable > LookupTable
The lookup table used to color the surface by height (Z dimension).
float XMaximum
user-defined data ranges
~vtkPlotSurface() override
float XMinimum
user-defined data ranges
bool Paint(vtkContext2D *painter) override
Paint event for the XY plot, called whenever the chart needs to be drawn.
vtkIdType NumberOfRows
The number of rows in the input table.
void SetInputData(vtkTable *input, const vtkStdString &xName, const vtkStdString &yName, const vtkStdString &zName, const vtkStdString &colorName) override
Set the input to the surface plot.
static vtkPlotSurface * New()
float YMinimum
user-defined data ranges
vtkTable * InputTable
The input table used to generate the surface.
void RescaleData()
Change data values if SetXRange() or SetYRange() were called.
void SetInputData(vtkTable *input, vtkIdType xColumn, vtkIdType yColumn, vtkIdType zColumn) override
Set the input to the surface plot.
float ColumnToX(int columnIndex)
Map a column index to the user-specified range for the X-axis.
void GenerateSurface()
Generate a surface (for OpenGL) from our list of points.
void InsertSurfaceVertex(float *data, float value, int i, int j, int &pos)
Helper function used to setup a colored surface.
float RowToY(int rowIndex)
Map a row index to the user-specified range for the Y-axis.
void SetInputData(vtkTable *input, const vtkStdString &xName, const vtkStdString &yName, const vtkStdString &zName) override
Set the input to the surface plot.
float YMaximum
user-defined data ranges
vtkIdType NumberOfVertices
The number of vertices in the surface.
void SetYRange(float min, float max)
Set the range of the input data for the Y dimension.
vtkIdType NumberOfColumns
The number of columns in the input table.
int ColorComponents
The number of components used to color the surface.
Wrapper around std::string to keep symbols short.
A table, which contains similar-typed columns of data.
Definition vtkTable.h:169
int vtkIdType
Definition vtkType.h:315
#define VTK_MARSHALAUTO
#define max(a, b)