VTK
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 
28 #ifndef vtkPlotSurface_h
29 #define vtkPlotSurface_h
30 
31 #include "vtkChartsCoreModule.h" // For export macro
32 #include "vtkNew.h" // For vtkNew ivar
33 #include "vtkPlot3D.h"
34 
35 class vtkContext2D;
36 class vtkLookupTable;
37 class vtkTable;
38 
39 class VTKCHARTSCORE_EXPORT vtkPlotSurface : public vtkPlot3D
40 {
41 public:
42  vtkTypeMacro(vtkPlotSurface, vtkPlot3D);
43  virtual void PrintSelf(ostream &os, vtkIndent indent);
44  static vtkPlotSurface * New();
45 
49  virtual bool Paint(vtkContext2D *painter);
50 
54  virtual void SetInputData(vtkTable *input);
55 
57 
62  virtual void SetInputData(vtkTable *input, const vtkStdString &xName,
63  const vtkStdString &yName,
64  const vtkStdString &zName);
65  virtual void SetInputData(vtkTable *input, const vtkStdString &xName,
66  const vtkStdString &yName,
67  const vtkStdString &zName,
68  const vtkStdString &colorName);
69  virtual void SetInputData(vtkTable *input, vtkIdType xColumn,
70  vtkIdType yColumn, vtkIdType zColumn);
72 
79  void SetXRange(float min, float max);
80 
87  void SetYRange(float min, float max);
88 
89 protected:
92 
97 
101  void InsertSurfaceVertex(float *data, float value, int i, int j, int &pos);
102 
106  void RescaleData();
107 
111  float ColumnToX(int columnIndex);
112 
116  float RowToY(int rowIndex);
117 
121  std::vector<vtkVector3f> Surface;
122 
127 
132 
137 
142 
147 
152 
157 
159 
162  float XMinimum;
163  float XMaximum;
164  float YMinimum;
165  float YMaximum;
167 
173 
174 private:
175  vtkPlotSurface(const vtkPlotSurface &) VTK_DELETE_FUNCTION;
176  void operator=(const vtkPlotSurface &) VTK_DELETE_FUNCTION;
177 
178 };
179 
180 #endif //vtkPlotSurface_h
vtkPlotSurface::SetInputData
virtual void SetInputData(vtkTable *input, const vtkStdString &xName, const vtkStdString &yName, const vtkStdString &zName, const vtkStdString &colorName)
vtkPlotSurface::XMaximum
float XMaximum
Definition: vtkPlotSurface.h:163
vtkPlotSurface::NumberOfVertices
vtkIdType NumberOfVertices
The number of vertices in the surface.
Definition: vtkPlotSurface.h:136
vtkPlotSurface::XMinimum
float XMinimum
user-defined data ranges
Definition: vtkPlotSurface.h:162
vtkPlotSurface::InputTable
vtkTable * InputTable
The input table used to generate the surface.
Definition: vtkPlotSurface.h:151
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
vtkPlotSurface::New
static vtkPlotSurface * New()
vtkPlotSurface::DataHasBeenRescaled
bool DataHasBeenRescaled
true if user-defined data scaling has already been applied, false otherwise.
Definition: vtkPlotSurface.h:172
vtkPlotSurface::YMinimum
float YMinimum
Definition: vtkPlotSurface.h:164
vtkPlotSurface::~vtkPlotSurface
~vtkPlotSurface()
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
vtkPlotSurface::InsertSurfaceVertex
void InsertSurfaceVertex(float *data, float value, int i, int j, int &pos)
Helper function used to setup a colored surface.
vtkPlotSurface::YMaximum
float YMaximum
Definition: vtkPlotSurface.h:165
vtkPlotSurface::GenerateSurface
void GenerateSurface()
Generate a surface (for OpenGL) from our list of points.
vtkPlotSurface::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkPlotSurface::LookupTable
vtkNew< vtkLookupTable > LookupTable
The lookup table used to color the surface by height (Z dimension).
Definition: vtkPlotSurface.h:156
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkPlotSurface::SetInputData
virtual void SetInputData(vtkTable *input, const vtkStdString &xName, const vtkStdString &yName, const vtkStdString &zName)
Set the input to the surface plot.
vtkPlotSurface::SetInputData
virtual void SetInputData(vtkTable *input, vtkIdType xColumn, vtkIdType yColumn, vtkIdType zColumn)
vtkPlotSurface::SetXRange
void SetXRange(float min, float max)
Set the range of the input data for the X dimension.
vtkPlotSurface::vtkPlotSurface
vtkPlotSurface()
vtkNew< vtkUnsignedCharArray >
vtkPlot3D.h
vtkPlot3D
Abstract class for 3D plots.
Definition: vtkPlot3D.h:45
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:75
vtkNew.h
vtkPlotSurface::ColumnToX
float ColumnToX(int columnIndex)
Map a column index to the user-specified range for the X-axis.
vtkPlotSurface
3D surface plot.
Definition: vtkPlotSurface.h:40
vtkPlotSurface::RowToY
float RowToY(int rowIndex)
Map a row index to the user-specified range for the Y-axis.
vtkPlotSurface::Colors
vtkNew< vtkUnsignedCharArray > Colors
This array indicates how the surface should be colored.
Definition: vtkPlotSurface.h:141
vtkPlotSurface::NumberOfRows
vtkIdType NumberOfRows
The number of rows in the input table.
Definition: vtkPlotSurface.h:126
vtkPlotSurface::SetYRange
void SetYRange(float min, float max)
Set the range of the input data for the Y dimension.
vtkPlotSurface::ColorComponents
int ColorComponents
The number of components used to color the surface.
Definition: vtkPlotSurface.h:146
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
vtkPlotSurface::RescaleData
void RescaleData()
Change data values if SetXRange() or SetYRange() were called.
vtkPlotSurface::Paint
virtual bool Paint(vtkContext2D *painter)
Paint event for the XY plot, called whenever the chart needs to be drawn.
vtkPlotSurface::SetInputData
virtual void SetInputData(vtkTable *input)
Set the input to the surface plot.
vtkPlotSurface::Surface
std::vector< vtkVector3f > Surface
Surface to render.
Definition: vtkPlotSurface.h:121
vtkPlotSurface::NumberOfColumns
vtkIdType NumberOfColumns
The number of columns in the input table.
Definition: vtkPlotSurface.h:131