VTK
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 "vtkChartLegend.h"
27 #include "vtkSmartPointer.h" // For SP ivars
28 #include "vtkVector.h" // For vtkRectf
29 
30 class vtkAxis;
31 class vtkImageData;
32 class vtkScalarsToColors;
33 class vtkCallbackCommand;
34 
36 {
37 public:
39  virtual void PrintSelf(ostream &os, vtkIndent indent);
40  static vtkColorLegend* New();
41 
44  virtual void GetBounds(double bounds[4]);
45 
49  virtual void Update();
50 
54  virtual bool Paint(vtkContext2D *painter);
55 
56  virtual void SetTransferFunction(vtkScalarsToColors* transfer);
57  virtual vtkScalarsToColors * GetTransferFunction();
58 
59  virtual void SetPosition(const vtkRectf& pos);
60  virtual vtkRectf GetPosition();
61 
68 
69 protected:
71  virtual ~vtkColorLegend();
72 
76  virtual void ComputeTexture();
77 
79 
81  virtual void ScalarsToColorsModified(vtkObject* caller, unsigned long eid,
82  void* calldata);
83  static void OnScalarsToColorsModified(vtkObject* caller, unsigned long eid,
84  void *clientdata, void* calldata);
86 
93 
94 private:
95  vtkColorLegend(const vtkColorLegend &); // Not implemented.
96  void operator=(const vtkColorLegend &); // Not implemented.
97 };
98 
99 #endif
#define VTK_CHARTS_EXPORT
vtkRectf Position
abstract base class for most VTK objects
Definition: vtkObject.h:60
virtual vtkRectf GetBoundingRect(vtkContext2D *painter)
Legend item to display vtkScalarsToColors.
virtual void Update()
vtkSmartPointer< vtkCallbackCommand > Callback
Superclass for mapping scalar values into colors.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:54
supports function callbacks
takes care of drawing 2D axes
Definition: vtkAxis.h:44
a simple class to control print indentation
Definition: vtkIndent.h:37
static vtkChartLegend * New()
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
vtkScalarsToColors * TransferFunction
vtkSmartPointer< vtkImageData > ImageData
draw the chart legend
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual bool Paint(vtkContext2D *painter)
vtkSmartPointer< vtkAxis > Axis