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);
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);
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:
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 
141 
151 
152 private:
153  vtkColorLegend(const vtkColorLegend &); // Not implemented.
154  void operator=(const vtkColorLegend &); // Not implemented.
155 };
156 
157 #endif
vtkChartsCoreModule.h
vtkColorLegend::GetTransferFunction
virtual vtkScalarsToColors * GetTransferFunction()
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:40
vtkgl::h
GLfloat GLfloat GLfloat GLfloat h
Definition: vtkgl.h:14364
vtkColorLegend::MouseMoveEvent
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
vtkColorLegend::ComputeTexture
virtual void ComputeTexture()
vtkColorLegend::SetPoint
virtual void SetPoint(float x, float y)
vtkColorLegend::Orientation
int Orientation
Definition: vtkColorLegend.h:150
vtkChartLegend
draw the chart legend
Definition: vtkChartLegend.h:42
vtkColorLegend::GetPosition
virtual vtkRectf GetPosition()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkSmartPointer< vtkImageData >
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkVector.h
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:57
vtkColorLegend::GetBounds
virtual void GetBounds(double bounds[4])
vtkColorLegend::Callback
vtkSmartPointer< vtkCallbackCommand > Callback
Definition: vtkColorLegend.h:145
vtkColorLegend::TransferFunction
vtkScalarsToColors * TransferFunction
Definition: vtkColorLegend.h:142
vtkColorLegend::GetTitle
virtual vtkStdString GetTitle()
vtkX3D::title
@ title
Definition: vtkX3D.h:500
vtkColorLegend::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkColorLegend::ImageData
vtkSmartPointer< vtkImageData > ImageData
Definition: vtkColorLegend.h:143
vtkColorLegend::SetTitle
virtual void SetTitle(const vtkStdString &title)
vtkColorLegend::Update
virtual void Update()
vtkColorLegend::Paint
virtual bool Paint(vtkContext2D *painter)
vtkColorLegend::OnScalarsToColorsModified
static void OnScalarsToColorsModified(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSmartPointer.h
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition: vtkScalarsToColors.h:63
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkColorLegend::UpdateAxisPosition
void UpdateAxisPosition()
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkColorLegend::~vtkColorLegend
virtual ~vtkColorLegend()
vtkColorLegend::vtkColorLegend
vtkColorLegend()
vtkColorLegend
Legend item to display vtkScalarsToColors.
Definition: vtkColorLegend.h:38
vtkX3D::orientation
@ orientation
Definition: vtkX3D.h:262
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkAxis
takes care of drawing 2D axes
Definition: vtkAxis.h:71
vtkChartLegend.h
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:50
vtkColorLegend::DrawBorder
bool DrawBorder
Definition: vtkColorLegend.h:148
vtkColorLegend::ScalarsToColorsModified
virtual void ScalarsToColorsModified(vtkObject *caller, unsigned long eid, void *calldata)
vtkColorLegend::New
static vtkColorLegend * New()
vtkgl::w
GLubyte GLubyte GLubyte GLubyte w
Definition: vtkgl.h:12054
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:48
VTKCHARTSCORE_EXPORT
#define VTKCHARTSCORE_EXPORT
Definition: vtkChartsCoreModule.h:15
vtkColorLegend::Axis
vtkSmartPointer< vtkAxis > Axis
Definition: vtkColorLegend.h:144
vtkColorLegend::SetTransferFunction
virtual void SetTransferFunction(vtkScalarsToColors *transfer)
vtkColorLegend::SetPosition
virtual void SetPosition(const vtkRectf &pos)
vtkRectf
Definition: vtkRect.h:97
vtkColorLegend::SetTextureSize
virtual void SetTextureSize(float w, float h)
vtkColorLegend::GetBoundingRect
vtkRectf GetBoundingRect(vtkContext2D *painter)
vtkColorLegend::SetOrientation
virtual void SetOrientation(int orientation)
vtkColorLegend::Position
vtkRectf Position
Definition: vtkColorLegend.h:149
vtkColorLegend::CustomPositionSet
bool CustomPositionSet
Definition: vtkColorLegend.h:147
vtkColorLegend::Interpolate
bool Interpolate
Definition: vtkColorLegend.h:146