VTK
9.5.20251207
Charts
Core
vtkCategoryLegend.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2
// SPDX-License-Identifier: BSD-3-Clause
3
37
38
#ifndef vtkCategoryLegend_h
39
#define vtkCategoryLegend_h
40
41
#include "
vtkChartLegend.h
"
42
#include "vtkChartsCoreModule.h"
// For export macro
43
#include "
vtkNew.h
"
// For vtkNew ivars
44
#include "
vtkStdString.h
"
// For vtkStdString ivars
45
#include "
vtkVector.h
"
// For vtkRectf
46
#include "
vtkWrappingHints.h
"
// For VTK_MARSHALAUTO
47
48
VTK_ABI_NAMESPACE_BEGIN
49
class
vtkScalarsToColors
;
50
class
vtkTextProperty
;
51
class
vtkVariantArray
;
52
53
class
VTKCHARTSCORE_EXPORT
VTK_MARSHALAUTO
vtkCategoryLegend
:
public
vtkChartLegend
54
{
55
public
:
56
vtkTypeMacro(
vtkCategoryLegend
,
vtkChartLegend
);
57
void
PrintSelf
(ostream& os,
vtkIndent
indent)
override
;
58
59
static
vtkCategoryLegend
*
New
();
60
64
enum
65
{
66
VERTICAL
= 0,
67
HORIZONTAL
68
};
69
73
bool
Paint
(
vtkContext2D
* painter)
override
;
74
79
vtkRectf
GetBoundingRect
(
vtkContext2D
* painter)
override
;
80
82
87
vtkGetObjectMacro(
ScalarsToColors
,
vtkScalarsToColors
);
88
virtual
void
SetScalarsToColors
(
vtkScalarsToColors
*);
90
92
98
vtkGetObjectMacro(
Values
,
vtkVariantArray
);
99
virtual
void
SetValues
(
vtkVariantArray
*);
101
103
106
virtual
void
SetTitle
(
const
vtkStdString
& title);
107
virtual
vtkStdString
GetTitle
();
109
111
114
vtkGetMacro(
OutlierLabel
,
vtkStdString
);
115
vtkSetMacro(
OutlierLabel
,
vtkStdString
);
117
118
protected
:
119
vtkCategoryLegend
();
120
~vtkCategoryLegend
()
override
;
121
122
bool
HasOutliers
;
123
float
TitleWidthOffset
;
124
vtkScalarsToColors
*
ScalarsToColors
;
125
vtkStdString
OutlierLabel
;
126
vtkStdString
Title
;
127
vtkNew<vtkTextProperty>
TitleProperties
;
128
vtkVariantArray
*
Values
;
129
130
private
:
131
vtkCategoryLegend
(
const
vtkCategoryLegend
&) =
delete
;
132
void
operator=(
const
vtkCategoryLegend
&) =
delete
;
133
};
134
135
VTK_ABI_NAMESPACE_END
136
#endif
vtkCategoryLegend::SetScalarsToColors
virtual void SetScalarsToColors(vtkScalarsToColors *)
Get/Set the vtkScalarsToColors used to draw this legend.
vtkCategoryLegend::ScalarsToColors
vtkScalarsToColors * ScalarsToColors
Definition
vtkCategoryLegend.h:124
vtkCategoryLegend::TitleWidthOffset
float TitleWidthOffset
Definition
vtkCategoryLegend.h:123
vtkCategoryLegend::VERTICAL
@ VERTICAL
Definition
vtkCategoryLegend.h:66
vtkCategoryLegend::HORIZONTAL
@ HORIZONTAL
Definition
vtkCategoryLegend.h:67
vtkCategoryLegend::vtkCategoryLegend
vtkCategoryLegend()
vtkCategoryLegend::GetTitle
virtual vtkStdString GetTitle()
Get/set the title text of the legend.
vtkCategoryLegend::TitleProperties
vtkNew< vtkTextProperty > TitleProperties
Definition
vtkCategoryLegend.h:127
vtkCategoryLegend::~vtkCategoryLegend
~vtkCategoryLegend() override
vtkCategoryLegend::Title
vtkStdString Title
Definition
vtkCategoryLegend.h:126
vtkCategoryLegend::New
static vtkCategoryLegend * New()
vtkCategoryLegend::Values
vtkVariantArray * Values
Definition
vtkCategoryLegend.h:128
vtkCategoryLegend::SetValues
virtual void SetValues(vtkVariantArray *)
Get/Set the array of values that will be represented by this legend.
vtkCategoryLegend::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCategoryLegend::Paint
bool Paint(vtkContext2D *painter) override
Paint the legend into a rectangle defined by the bounds.
vtkCategoryLegend::HasOutliers
bool HasOutliers
Definition
vtkCategoryLegend.h:122
vtkCategoryLegend::OutlierLabel
vtkStdString OutlierLabel
Definition
vtkCategoryLegend.h:125
vtkCategoryLegend::GetBoundingRect
vtkRectf GetBoundingRect(vtkContext2D *painter) override
Compute and return the lower left corner of this legend, along with its width and height.
vtkCategoryLegend::SetTitle
virtual void SetTitle(const vtkStdString &title)
Get/set the title text of the legend.
vtkChartLegend::vtkChartLegend
vtkChartLegend()
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition
vtkContext2D.h:69
vtkIndent
a simple class to control print indentation
Definition
vtkIndent.h:108
vtkNew
Allocate and hold a VTK object.
Definition
vtkNew.h:167
vtkRectf
Definition
vtkRect.h:328
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition
vtkScalarsToColors.h:77
vtkStdString
Wrapper around std::string to keep symbols short.
Definition
vtkStdString.h:77
vtkTextProperty
represent text properties.
Definition
vtkTextProperty.h:136
vtkVariantArray
An array holding vtkVariants.
Definition
vtkVariantArray.h:108
vtkChartLegend.h
vtkNew.h
vtkStdString.h
vtkVector.h
vtkWrappingHints.h
VTK_MARSHALAUTO
#define VTK_MARSHALAUTO
Definition
vtkWrappingHints.h:60
Generated on Sun Dec 7 2025 09:08:21 for VTK by
1.13.2