VTK  9.0.3
vtkPlotSurface.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlotSurface.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 
25 #ifndef vtkPlotSurface_h
26 #define vtkPlotSurface_h
27 
28 #include "vtkChartsCoreModule.h" // For export macro
29 #include "vtkNew.h" // For vtkNew ivar
30 #include "vtkPlot3D.h"
31 
32 class vtkContext2D;
33 class vtkLookupTable;
34 class vtkTable;
35 
36 class VTKCHARTSCORE_EXPORT vtkPlotSurface : public vtkPlot3D
37 {
38 public:
39  vtkTypeMacro(vtkPlotSurface, vtkPlot3D);
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41  static vtkPlotSurface* New();
42 
46  bool Paint(vtkContext2D* painter) override;
47 
51  void SetInputData(vtkTable* input) override;
52 
54 
59  void SetInputData(vtkTable* input, const vtkStdString& xName, const vtkStdString& yName,
60  const vtkStdString& zName) override;
61  void SetInputData(vtkTable* input, const vtkStdString& xName, const vtkStdString& yName,
62  const vtkStdString& zName, const vtkStdString& colorName) override;
64  vtkTable* input, vtkIdType xColumn, vtkIdType yColumn, vtkIdType zColumn) override;
66 
73  void SetXRange(float min, float max);
74 
81  void SetYRange(float min, float max);
82 
83 protected:
85  ~vtkPlotSurface() override;
86 
91 
95  void InsertSurfaceVertex(float* data, float value, int i, int j, int& pos);
96 
100  void RescaleData();
101 
105  float ColumnToX(int columnIndex);
106 
110  float RowToY(int rowIndex);
111 
115  std::vector<vtkVector3f> Surface;
116 
121 
126 
131 
136 
141 
146 
148 
151  float XMinimum;
152  float XMaximum;
153  float YMinimum;
154  float YMaximum;
156 
162 
163 private:
164  vtkPlotSurface(const vtkPlotSurface&) = delete;
165  void operator=(const vtkPlotSurface&) = delete;
166 };
167 
168 #endif // vtkPlotSurface_h
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:53
a simple class to control print indentation
Definition: vtkIndent.h:34
map scalar values into colors via a lookup table
Abstract class for 3D plots.
Definition: vtkPlot3D.h:45
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.
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).
~vtkPlotSurface() override
static vtkPlotSurface * New()
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
vtkTable * InputTable
The input table used to generate the surface.
std::vector< vtkVector3f > Surface
Surface to render.
void RescaleData()
Change data values if SetXRange() or SetYRange() were called.
void SetInputData(vtkTable *input, vtkIdType xColumn, vtkIdType yColumn, vtkIdType zColumn) override
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.
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.
Definition: vtkStdString.h:35
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:63
@ value
Definition: vtkX3D.h:226
@ data
Definition: vtkX3D.h:321
int vtkIdType
Definition: vtkType.h:338
#define max(a, b)