VTK
dox/Charts/vtkPlotHistogram2D.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtk2DHistogramItem.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 
00023 #ifndef __vtk2DHistogramItem_h
00024 #define __vtk2DHistogramItem_h
00025 
00026 #include "vtkPlot.h"
00027 #include "vtkSmartPointer.h"  // Needed for SP ivars
00028 #include "vtkRect.h"          // Needed for vtkRectf
00029 
00030 class vtkImageData;
00031 class vtkScalarsToColors;
00032 
00033 class VTK_CHARTS_EXPORT vtkPlotHistogram2D : public vtkPlot
00034 {
00035 public:
00036   vtkTypeMacro(vtkPlotHistogram2D, vtkPlot);
00037   virtual void PrintSelf(ostream &os, vtkIndent indent);
00038 
00040   static vtkPlotHistogram2D *New();
00041 
00045   virtual void Update();
00046 
00048   virtual bool Paint(vtkContext2D *painter);
00049 
00051 
00054   virtual void SetInput(vtkImageData *data, vtkIdType z = 0);
00055   virtual void SetInput(vtkTable*) { }
00056   virtual void SetInput(vtkTable*, const vtkStdString&, const vtkStdString&) { }
00058 
00060   vtkImageData * GetInputImageData();
00061 
00064   void SetTransferFunction(vtkScalarsToColors *transfer);
00065 
00068   vtkScalarsToColors * GetTransferFunction();
00069 
00070   virtual void GetBounds(double bounds[4]);
00071 
00072   virtual void SetPosition(const vtkRectf& pos);
00073   virtual vtkRectf GetPosition();
00074 
00075 //BTX
00076 protected:
00077   vtkPlotHistogram2D();
00078   ~vtkPlotHistogram2D();
00079 
00081   void GenerateHistogram();
00082 
00083   vtkSmartPointer<vtkImageData> Input;
00084   vtkSmartPointer<vtkImageData> Output;
00085   vtkSmartPointer<vtkScalarsToColors> TransferFunction;
00086   vtkRectf Position;
00087 
00088 private:
00089   vtkPlotHistogram2D(const vtkPlotHistogram2D &); // Not implemented.
00090   void operator=(const vtkPlotHistogram2D &); // Not implemented.
00091 
00092 //ETX
00093 };
00094 
00095 #endif //__vtk2DHistogramItem_h