VTK
dox/Charts/Core/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 "vtkChartsCoreModule.h" // For export macro
00027 #include "vtkPlot.h"
00028 #include "vtkSmartPointer.h"  // Needed for SP ivars
00029 #include "vtkRect.h"          // Needed for vtkRectf
00030 
00031 class vtkImageData;
00032 class vtkScalarsToColors;
00033 
00034 class VTKCHARTSCORE_EXPORT vtkPlotHistogram2D : public vtkPlot
00035 {
00036 public:
00037   vtkTypeMacro(vtkPlotHistogram2D, vtkPlot);
00038   virtual void PrintSelf(ostream &os, vtkIndent indent);
00039 
00041   static vtkPlotHistogram2D *New();
00042 
00046   virtual void Update();
00047 
00049   virtual bool Paint(vtkContext2D *painter);
00050 
00052 
00055   virtual void SetInputData(vtkImageData *data, vtkIdType z = 0);
00056   virtual void SetInputData(vtkTable*) { }
00057   virtual void SetInputData(vtkTable*, const vtkStdString&, const vtkStdString&) { }
00059 
00061   vtkImageData * GetInputImageData();
00062 
00065   void SetTransferFunction(vtkScalarsToColors *transfer);
00066 
00069   vtkScalarsToColors * GetTransferFunction();
00070 
00071   virtual void GetBounds(double bounds[4]);
00072 
00073   virtual void SetPosition(const vtkRectf& pos);
00074   virtual vtkRectf GetPosition();
00075 
00076 //BTX
00078 
00091   virtual vtkStdString GetTooltipLabel(const vtkVector2d &plotPos,
00092                                        vtkIdType seriesIndex,
00093                                        vtkIdType segmentIndex);
00095 
00097 
00103   virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
00104                                     const vtkVector2f& tolerance,
00105                                     vtkVector2f* location);
00107 
00108 protected:
00109   vtkPlotHistogram2D();
00110   ~vtkPlotHistogram2D();
00111 
00113   void GenerateHistogram();
00114 
00115   vtkSmartPointer<vtkImageData> Input;
00116   vtkSmartPointer<vtkImageData> Output;
00117   vtkSmartPointer<vtkScalarsToColors> TransferFunction;
00118   vtkRectf Position;
00119 
00120 private:
00121   vtkPlotHistogram2D(const vtkPlotHistogram2D &); // Not implemented.
00122   void operator=(const vtkPlotHistogram2D &); // Not implemented.
00123 
00124 //ETX
00125 };
00126 
00127 #endif //__vtk2DHistogramItem_h