VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkColorLegend.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkColorLegend.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 
23 #ifndef __vtkColorLegend_h
24 #define __vtkColorLegend_h
25 
26 #include "vtkChartsCoreModule.h" // For export macro
27 #include "vtkChartLegend.h"
28 #include "vtkSmartPointer.h" // For SP ivars
29 #include "vtkVector.h" // For vtkRectf
30 
31 class vtkAxis;
32 class vtkImageData;
33 class vtkScalarsToColors;
34 class vtkCallbackCommand;
35 
36 class VTKCHARTSCORE_EXPORT vtkColorLegend: public vtkChartLegend
37 {
38 public:
40  virtual void PrintSelf(ostream &os, vtkIndent indent);
41  static vtkColorLegend* New();
42 
45  virtual void GetBounds(double bounds[4]);
46 
50  virtual void Update();
51 
55  virtual bool Paint(vtkContext2D *painter);
56 
57  virtual void SetTransferFunction(vtkScalarsToColors* transfer);
58  virtual vtkScalarsToColors * GetTransferFunction();
59 
60  virtual void SetPosition(const vtkRectf& pos);
61  virtual vtkRectf GetPosition();
62 
68  vtkRectf GetBoundingRect(vtkContext2D* painter);
69 
70 protected:
72  virtual ~vtkColorLegend();
73 
77  virtual void ComputeTexture();
78 
80 
82  virtual void ScalarsToColorsModified(vtkObject* caller, unsigned long eid,
83  void* calldata);
84  static void OnScalarsToColorsModified(vtkObject* caller, unsigned long eid,
85  void *clientdata, void* calldata);
87 
93  vtkRectf Position;
94 
95 private:
96  vtkColorLegend(const vtkColorLegend &); // Not implemented.
97  void operator=(const vtkColorLegend &); // Not implemented.
98 };
99 
100 #endif
vtkRectf Position
abstract base class for most VTK objects
Definition: vtkObject.h:61
virtual vtkRectf GetBoundingRect(vtkContext2D *painter)
Legend item to display vtkScalarsToColors.
virtual void Update()
vtkSmartPointer< vtkCallbackCommand > Callback
Superclass for mapping scalar values to colors.
supports function callbacks
takes care of drawing 2D axes
Definition: vtkAxis.h:70
a simple class to control print indentation
Definition: vtkIndent.h:38
static vtkChartLegend * New()
vtkScalarsToColors * TransferFunction
vtkSmartPointer< vtkImageData > ImageData
draw the chart legend
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual bool Paint(vtkContext2D *painter)
vtkSmartPointer< vtkAxis > Axis