VTK
9.0.1
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 "
vtkChartLegend.h
"
28
#include "vtkChartsCoreModule.h"
// For export macro
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)
override
;
43
static
vtkColorLegend
*
New
();
44
48
enum
49
{
50
VERTICAL = 0,
51
HORIZONTAL
52
};
53
58
virtual
void
GetBounds(
double
bounds[4]);
59
65
void
Update
()
override
;
66
72
bool
Paint
(
vtkContext2D
* painter)
override
;
73
75
79
virtual
void
SetTransferFunction(
vtkScalarsToColors
* transfer);
80
virtual
vtkScalarsToColors
* GetTransferFunction();
82
86
void
SetPoint
(
float
x,
float
y)
override
;
87
91
virtual
void
SetTextureSize(
float
w,
float
h
);
92
99
virtual
void
SetPosition(
const
vtkRectf
& pos);
100
105
virtual
vtkRectf
GetPosition();
106
113
vtkRectf
GetBoundingRect
(
vtkContext2D
* painter)
override
;
114
116
120
virtual
void
SetOrientation(
int
orientation
);
121
vtkGetMacro(Orientation,
int
);
123
125
128
virtual
void
SetTitle(
const
vtkStdString
&
title
);
129
virtual
vtkStdString
GetTitle();
131
133
137
vtkSetMacro(DrawBorder,
bool
);
138
vtkGetMacro(DrawBorder,
bool
);
139
vtkBooleanMacro(DrawBorder,
bool
);
141
145
bool
MouseMoveEvent
(
const
vtkContextMouseEvent
& mouse)
override
;
146
147
protected
:
148
vtkColorLegend
();
149
~
vtkColorLegend
()
override
;
150
155
virtual
void
ComputeTexture();
156
158
162
virtual
void
ScalarsToColorsModified(
vtkObject
* caller,
unsigned
long
eid,
void
* calldata);
163
static
void
OnScalarsToColorsModified(
164
vtkObject
* caller,
unsigned
long
eid,
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
&) =
delete
;
184
void
operator=(
const
vtkColorLegend
&) =
delete
;
185
};
186
187
#endif
vtkContextMouseEvent
data structure to represent mouse events.
Definition:
vtkContextMouseEvent.h:34
vtkChartLegend::New
static vtkChartLegend * New()
Creates a 2D Chart object.
vtkColorLegend::Orientation
int Orientation
Definition:
vtkColorLegend.h:180
vtkChartLegend
draw the chart legend
Definition:
vtkChartLegend.h:39
vtkSmartPointer< vtkImageData >
vtkObject
abstract base class for most VTK objects
Definition:
vtkObject.h:62
vtkVector.h
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition:
vtkContext2D.h:52
vtkColorLegend::Callback
vtkSmartPointer< vtkCallbackCommand > Callback
Definition:
vtkColorLegend.h:175
vtkColorLegend::TransferFunction
vtkScalarsToColors * TransferFunction
Definition:
vtkColorLegend.h:172
vtkChartLegend::GetBoundingRect
virtual vtkRectf GetBoundingRect(vtkContext2D *painter)
Request the space the legend requires to be drawn.
vtkX3D::title
@ title
Definition:
vtkX3D.h:506
vtkChartLegend::MouseMoveEvent
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
vtkColorLegend::ImageData
vtkSmartPointer< vtkImageData > ImageData
Definition:
vtkColorLegend.h:173
vtkImageData
topologically and geometrically regular array of data
Definition:
vtkImageData.h:41
vtkIndent
a simple class to control print indentation
Definition:
vtkIndent.h:33
vtkSmartPointer.h
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition:
vtkScalarsToColors.h:59
vtkChartLegend::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkChartLegend::SetPoint
virtual void SetPoint(float, float)
Set point the legend box is anchored to.
vtkColorLegend
Legend item to display vtkScalarsToColors.
Definition:
vtkColorLegend.h:38
vtkChartLegend::Update
void Update() override
Update the geometry of the axis.
vtkX3D::orientation
@ orientation
Definition:
vtkX3D.h:268
vtkAxis
takes care of drawing 2D axes
Definition:
vtkAxis.h:68
vtkChartLegend.h
vtkCallbackCommand
supports function callbacks
Definition:
vtkCallbackCommand.h:44
vtkColorLegend::DrawBorder
bool DrawBorder
Definition:
vtkColorLegend.h:178
vtkStdString
Wrapper around std::string to keep symbols short.
Definition:
vtkStdString.h:34
vtkColorLegend::Axis
vtkSmartPointer< vtkAxis > Axis
Definition:
vtkColorLegend.h:174
vtkChartLegend::Paint
bool Paint(vtkContext2D *painter) override
Paint event for the axis, called whenever the axis needs to be drawn.
vtkRectf
Definition:
vtkRect.h:326
h
vtkColorLegend::Position
vtkRectf Position
Definition:
vtkColorLegend.h:179
vtkColorLegend::CustomPositionSet
bool CustomPositionSet
Definition:
vtkColorLegend.h:177
vtkColorLegend::Interpolate
bool Interpolate
Definition:
vtkColorLegend.h:176
Generated on Thu Jun 24 2021 15:17:26 for VTK by
1.8.17