VTK  9.0.1
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;
63  void SetInputData(
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 
90  void GenerateSurface();
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
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
float XMinimum
user-defined data ranges
map scalar values into colors via a lookup table
float XMaximum
user-defined data ranges
float YMaximum
user-defined data ranges
int vtkIdType
Definition: vtkType.h:338
3D surface plot.
vtkTable * InputTable
The input table used to generate the surface.
vtkIdType NumberOfVertices
The number of vertices in the surface.
float YMinimum
user-defined data ranges
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::vector< vtkVector3f > Surface
Surface to render.
vtkIdType NumberOfColumns
The number of columns in the input table.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
vtkNew< vtkLookupTable > LookupTable
The lookup table used to color the surface by height (Z dimension).
int ColorComponents
The number of components used to color the surface.
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkIdType NumberOfRows
The number of rows in the input table.
virtual void SetInputData(vtkTable *input)
Set the input to the plot.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
Abstract class for 3D plots.
Definition: vtkPlot3D.h:44
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
#define max(a, b)
bool DataHasBeenRescaled
true if user-defined data scaling has already been applied, false otherwise.