VTK
dox
Charts
Core
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
24
#ifndef vtkColorLegend_h
25
#define vtkColorLegend_h
26
27
#include "vtkChartsCoreModule.h"
// For export macro
28
#include "
vtkChartLegend.h
"
29
#include "
vtkSmartPointer.h
"
// For SP ivars
30
#include "
vtkVector.h
"
// For vtkRectf
31
32
class
vtkAxis
;
33
class
vtkContextMouseEvent
;
34
class
vtkImageData
;
35
class
vtkScalarsToColors
;
36
class
vtkCallbackCommand
;
37
38
class
VTKCHARTSCORE_EXPORT
vtkColorLegend
:
public
vtkChartLegend
39
{
40
public
:
41
vtkTypeMacro(
vtkColorLegend
,
vtkChartLegend
);
42
void
PrintSelf
(ostream &os,
vtkIndent
indent) VTK_OVERRIDE;
43
static
vtkColorLegend
*
New
();
44
48
enum
{
49
VERTICAL = 0,
50
HORIZONTAL
51
};
52
57
virtual
void
GetBounds(
double
bounds[4]);
58
64
void
Update
() VTK_OVERRIDE;
65
71
bool
Paint(
vtkContext2D
*painter) VTK_OVERRIDE;
72
74
78
virtual
void
SetTransferFunction(
vtkScalarsToColors
* transfer);
79
virtual
vtkScalarsToColors
* GetTransferFunction();
81
85
void
SetPoint(
float
x,
float
y) VTK_OVERRIDE;
86
90
virtual
void
SetTextureSize(
float
w,
float
h);
91
98
virtual
void
SetPosition(const
vtkRectf
& pos);
99
104
virtual
vtkRectf
GetPosition();
105
112
vtkRectf
GetBoundingRect(
vtkContext2D
* painter) VTK_OVERRIDE;
113
115
119
virtual
void
SetOrientation(
int
orientation
);
120
vtkGetMacro(Orientation,
int
);
122
124
127
virtual
void
SetTitle(const
vtkStdString
&
title
);
128
virtual
vtkStdString
GetTitle();
130
132
136
vtkSetMacro
(DrawBorder,
bool
);
137
vtkGetMacro(DrawBorder,
bool
);
138
vtkBooleanMacro
(DrawBorder,
bool
);
140
144
bool
MouseMoveEvent(const
vtkContextMouseEvent
&mouse) VTK_OVERRIDE;
145
146
protected:
147
vtkColorLegend
();
148
~
vtkColorLegend
() VTK_OVERRIDE;
149
154
virtual
void
ComputeTexture();
155
157
161
virtual
void
ScalarsToColorsModified(
vtkObject
* caller,
unsigned
long
eid,
162
void
* calldata);
163
static
void
OnScalarsToColorsModified(
vtkObject
* caller,
unsigned
long
eid,
164
void
*clientdata,
void
* calldata);
166
170
void
UpdateAxisPosition();
171
172
vtkScalarsToColors
* TransferFunction;
173
vtkSmartPointer
<
vtkImageData
> ImageData;
174
vtkSmartPointer
<
vtkAxis
> Axis;
175
vtkSmartPointer
<
vtkCallbackCommand
> Callback;
176
bool
Interpolate;
177
bool
CustomPositionSet;
178
bool
DrawBorder;
179
vtkRectf
Position;
180
int
Orientation;
181
182
private:
183
vtkColorLegend
(const
vtkColorLegend
&) VTK_DELETE_FUNCTION;
184
void
operator=(const
vtkColorLegend
&) VTK_DELETE_FUNCTION;
185
};
186
187
#endif
vtkStdString
Wrapper around std::string to keep symbols short.
Definition:
vtkStdString.h:41
vtkObject
abstract base class for most VTK objects
Definition:
vtkObject.h:53
vtkChartLegend::Update
void Update() override
Update the geometry of the axis.
vtkColorLegend
Legend item to display vtkScalarsToColors.
Definition:
vtkColorLegend.h:38
vtkSmartPointer
Hold a reference to a vtkObjectBase instance.
Definition:
vtkSmartPointer.h:29
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition:
vtkScalarsToColors.h:60
vtkChartLegend::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition:
vtkContext2D.h:52
vtkCallbackCommand
supports function callbacks
Definition:
vtkCallbackCommand.h:44
vtkRectf
Definition:
vtkRect.h:293
vtkAxis
takes care of drawing 2D axes
Definition:
vtkAxis.h:68
vtkContextMouseEvent
data structure to represent mouse events.
Definition:
vtkContextMouseEvent.h:34
vtkIndent
a simple class to control print indentation
Definition:
vtkIndent.h:33
vtkChartLegend::New
static vtkChartLegend * New()
Creates a 2D Chart object.
vtkImageData
topologically and geometrically regular array of data
Definition:
vtkImageData.h:39
vtkChartLegend.h
vtkVector.h
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkSmartPointer.h
vtkChartLegend
draw the chart legend
Definition:
vtkChartLegend.h:39
vtkX3D::orientation
Definition:
vtkX3D.h:262
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkX3D::title
Definition:
vtkX3D.h:500
Generated by
1.8.14