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 "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;
33 class vtkImageData;
34 class vtkScalarsToColors;
35 class vtkCallbackCommand;
36 
38 {
39 public:
41  virtual void PrintSelf(ostream &os, vtkIndent indent);
42  static vtkColorLegend* New();
43 
45 
46  enum {
47  VERTICAL = 0,
48  HORIZONTAL
49  };
51 
54  virtual void GetBounds(double bounds[4]);
55 
59  virtual void Update();
60 
64  virtual bool Paint(vtkContext2D *painter);
65 
67 
69  virtual void SetTransferFunction(vtkScalarsToColors* transfer);
70  virtual vtkScalarsToColors * GetTransferFunction();
72 
74  virtual void SetPoint(float x, float y);
75 
77  virtual void SetTextureSize(float w, float h);
78 
84  virtual void SetPosition(const vtkRectf& pos);
85 
88  virtual vtkRectf GetPosition();
89 
96 
98 
100  virtual void SetOrientation(int orientation);
101  vtkGetMacro(Orientation, int);
103 
105 
106  virtual void SetTitle(const vtkStdString &title);
107  virtual vtkStdString GetTitle();
109 
111 
113  vtkSetMacro(DrawBorder, bool);
114  vtkGetMacro(DrawBorder, bool);
115  vtkBooleanMacro(DrawBorder, bool);
117 
119  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
120 
121 protected:
122  vtkColorLegend();
123  virtual ~vtkColorLegend();
124 
128  virtual void ComputeTexture();
129 
131 
133  virtual void ScalarsToColorsModified(vtkObject* caller, unsigned long eid,
134  void* calldata);
135  static void OnScalarsToColorsModified(vtkObject* caller, unsigned long eid,
136  void *clientdata, void* calldata);
138 
140  void UpdateAxisPosition();
141 
151 
152 private:
153  vtkColorLegend(const vtkColorLegend &); // Not implemented.
154  void operator=(const vtkColorLegend &); // Not implemented.
155 };
156 
157 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
abstract base class for most VTK objects
Definition: vtkObject.h:61
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
virtual vtkRectf GetBoundingRect(vtkContext2D *painter)
Legend item to display vtkScalarsToColors.
virtual void Update()
vtkSmartPointer< vtkCallbackCommand > Callback
Superclass for mapping scalar values to colors.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:56
supports function callbacks
takes care of drawing 2D axes
Definition: vtkAxis.h:70
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:38
static vtkChartLegend * New()
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
virtual void SetPoint(float, float)
vtkScalarsToColors * TransferFunction
vtkSmartPointer< vtkImageData > ImageData
draw the chart legend
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual bool Paint(vtkContext2D *painter)
vtkSmartPointer< vtkAxis > Axis
#define VTKCHARTSCORE_EXPORT