VTK
dox/Charts/Core/vtkPlotSurface.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPlotSurface.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 
00027 #ifndef __vtkPlotSurface_h
00028 #define __vtkPlotSurface_h
00029 
00030 #include "vtkChartsCoreModule.h" // For export macro
00031 #include "vtkNew.h"              //  For vtkNew ivar
00032 #include "vtkPlot3D.h"
00033 
00034 class vtkContext2D;
00035 class vtkLookupTable;
00036 class vtkTable;
00037 
00038 class VTKCHARTSCORE_EXPORT vtkPlotSurface : public vtkPlot3D
00039 {
00040 public:
00041   vtkTypeMacro(vtkPlotSurface, vtkPlot3D);
00042   virtual void PrintSelf(ostream &os, vtkIndent indent);
00043   static vtkPlotSurface * New();
00044 
00047   virtual bool Paint(vtkContext2D *painter);
00048 
00050   virtual void SetInputData(vtkTable *input);
00051 
00053 
00055   virtual void SetInputData(vtkTable *input, const vtkStdString &xName,
00056                             const vtkStdString &yName,
00057                             const vtkStdString &zName);
00058   virtual void SetInputData(vtkTable *input, const vtkStdString &xName,
00059                             const vtkStdString &yName,
00060                             const vtkStdString &zName,
00061                             const vtkStdString &colorName);
00062   virtual void SetInputData(vtkTable *input, vtkIdType xColumn,
00063                             vtkIdType yColumn, vtkIdType zColumn);
00065 
00070   void SetXRange(float min, float max);
00071 
00076   void SetYRange(float min, float max);
00077 
00078 //BTX
00079 protected:
00080   vtkPlotSurface();
00081   ~vtkPlotSurface();
00082 
00084   void GenerateSurface();
00085 
00087   void InsertSurfaceVertex(float *data, float value, int i, int j, int &pos);
00088 
00090   void RescaleData();
00091 
00093   float ColumnToX(int columnIndex);
00094 
00096   float RowToY(int rowIndex);
00097 
00099   std::vector<vtkVector3f> Surface;
00100 
00102   vtkIdType NumberOfRows;
00103 
00105   vtkIdType NumberOfColumns;
00106 
00108   vtkIdType NumberOfVertices;
00109 
00111   vtkNew<vtkUnsignedCharArray> Colors;
00112 
00114   int ColorComponents;
00115 
00117   vtkTable *InputTable;
00118 
00120   vtkNew<vtkLookupTable> LookupTable;
00121 
00123 
00124   float XMinimum;
00125   float XMaximum;
00126   float YMinimum;
00127   float YMaximum;
00129 
00132   bool DataHasBeenRescaled;
00133 
00134 private:
00135   vtkPlotSurface(const vtkPlotSurface &); // Not implemented.
00136   void operator=(const vtkPlotSurface &); // Not implemented.
00137 
00138 //ETX
00139 };
00140 
00141 #endif //__vtkPlotSurface_h