VTK
dox/Charts/Core/vtkColorLegend.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkColorLegend.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 __vtkColorLegend_h
00024 #define __vtkColorLegend_h
00025 
00026 #include "vtkChartsCoreModule.h" // For export macro
00027 #include "vtkChartLegend.h"
00028 #include "vtkSmartPointer.h" // For SP ivars
00029 #include "vtkVector.h"       // For vtkRectf
00030 
00031 class vtkAxis;
00032 class vtkImageData;
00033 class vtkScalarsToColors;
00034 class vtkCallbackCommand;
00035 
00036 class VTKCHARTSCORE_EXPORT vtkColorLegend: public vtkChartLegend
00037 {
00038 public:
00039   vtkTypeMacro(vtkColorLegend, vtkChartLegend);
00040   virtual void PrintSelf(ostream &os, vtkIndent indent);
00041   static vtkColorLegend* New();
00042 
00045   virtual void GetBounds(double bounds[4]);
00046 
00050   virtual void Update();
00051 
00055   virtual bool Paint(vtkContext2D *painter);
00056 
00057   virtual void SetTransferFunction(vtkScalarsToColors* transfer);
00058   virtual vtkScalarsToColors * GetTransferFunction();
00059 
00060   virtual void SetPosition(const vtkRectf& pos);
00061   virtual vtkRectf GetPosition();
00062 
00068   vtkRectf GetBoundingRect(vtkContext2D* painter);
00069 
00070 protected:
00071   vtkColorLegend();
00072   virtual ~vtkColorLegend();
00073 
00077   virtual void ComputeTexture();
00078 
00080 
00082   virtual void ScalarsToColorsModified(vtkObject* caller, unsigned long eid,
00083                                        void* calldata);
00084   static void OnScalarsToColorsModified(vtkObject* caller, unsigned long eid,
00085                                         void *clientdata, void* calldata);
00087 
00088   vtkScalarsToColors*                 TransferFunction;
00089   vtkSmartPointer<vtkImageData>       ImageData;
00090   vtkSmartPointer<vtkAxis>            Axis;
00091   vtkSmartPointer<vtkCallbackCommand> Callback;
00092   bool                                Interpolate;
00093   vtkRectf                            Position;
00094 
00095 private:
00096   vtkColorLegend(const vtkColorLegend &); // Not implemented.
00097   void operator=(const vtkColorLegend &);   // Not implemented.
00098 };
00099 
00100 #endif