VTK
9.0.1
Charts
Core
vtkCategoryLegend.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkCategoryLegend.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
28
#ifndef vtkCategoryLegend_h
29
#define vtkCategoryLegend_h
30
31
#include "
vtkChartLegend.h
"
32
#include "vtkChartsCoreModule.h"
// For export macro
33
#include "
vtkNew.h
"
// For vtkNew ivars
34
#include "
vtkStdString.h
"
// For vtkStdString ivars
35
#include "
vtkVector.h
"
// For vtkRectf
36
37
class
vtkScalarsToColors
;
38
class
vtkTextProperty
;
39
class
vtkVariantArray
;
40
41
class
VTKCHARTSCORE_EXPORT
vtkCategoryLegend
:
public
vtkChartLegend
42
{
43
public
:
44
vtkTypeMacro(
vtkCategoryLegend
,
vtkChartLegend
);
45
static
vtkCategoryLegend
*
New
();
46
50
enum
51
{
52
VERTICAL = 0,
53
HORIZONTAL
54
};
55
59
bool
Paint
(
vtkContext2D
* painter)
override
;
60
65
vtkRectf
GetBoundingRect
(
vtkContext2D
* painter)
override
;
66
68
73
virtual
void
SetScalarsToColors
(
vtkScalarsToColors
* stc);
74
virtual
vtkScalarsToColors
*
GetScalarsToColors
();
76
78
84
vtkGetMacro(Values,
vtkVariantArray
*);
85
vtkSetMacro(Values,
vtkVariantArray
*);
87
89
92
virtual
void
SetTitle
(
const
vtkStdString
&
title
);
93
virtual
vtkStdString
GetTitle
();
95
97
100
vtkGetMacro(OutlierLabel,
vtkStdString
);
101
vtkSetMacro(OutlierLabel,
vtkStdString
);
103
104
protected
:
105
vtkCategoryLegend
();
106
~vtkCategoryLegend
()
override
;
107
108
bool
HasOutliers
;
109
float
TitleWidthOffset
;
110
vtkScalarsToColors
*
ScalarsToColors
;
111
vtkStdString
OutlierLabel
;
112
vtkStdString
Title
;
113
vtkNew<vtkTextProperty>
TitleProperties
;
114
vtkVariantArray
*
Values
;
115
116
private
:
117
vtkCategoryLegend
(
const
vtkCategoryLegend
&) =
delete
;
118
void
operator=(
const
vtkCategoryLegend
&) =
delete
;
119
};
120
121
#endif
vtkCategoryLegend
Legend item to display categorical data.
Definition:
vtkCategoryLegend.h:42
vtkCategoryLegend::ScalarsToColors
vtkScalarsToColors * ScalarsToColors
Definition:
vtkCategoryLegend.h:110
vtkCategoryLegend::TitleWidthOffset
float TitleWidthOffset
Definition:
vtkCategoryLegend.h:109
vtkCategoryLegend::GetScalarsToColors
virtual vtkScalarsToColors * GetScalarsToColors()
vtkCategoryLegend::vtkCategoryLegend
vtkCategoryLegend()
vtkCategoryLegend::GetTitle
virtual vtkStdString GetTitle()
vtkCategoryLegend::TitleProperties
vtkNew< vtkTextProperty > TitleProperties
Definition:
vtkCategoryLegend.h:113
vtkCategoryLegend::~vtkCategoryLegend
~vtkCategoryLegend() override
vtkCategoryLegend::Title
vtkStdString Title
Definition:
vtkCategoryLegend.h:112
vtkCategoryLegend::Values
vtkVariantArray * Values
Definition:
vtkCategoryLegend.h:114
vtkCategoryLegend::Paint
bool Paint(vtkContext2D *painter) override
Paint the legend into a rectangle defined by the bounds.
vtkCategoryLegend::HasOutliers
bool HasOutliers
Definition:
vtkCategoryLegend.h:108
vtkCategoryLegend::OutlierLabel
vtkStdString OutlierLabel
Definition:
vtkCategoryLegend.h:111
vtkCategoryLegend::SetScalarsToColors
virtual void SetScalarsToColors(vtkScalarsToColors *stc)
Get/Set the vtkScalarsToColors used to draw this legend.
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.
vtkCategoryLegend::New
static vtkCategoryLegend * New()
vtkChartLegend
draw the chart legend
Definition:
vtkChartLegend.h:40
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition:
vtkContext2D.h:53
vtkNew< vtkTextProperty >
vtkRectf
Definition:
vtkRect.h:327
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition:
vtkScalarsToColors.h:60
vtkStdString
Wrapper around std::string to keep symbols short.
Definition:
vtkStdString.h:35
vtkTextProperty
represent text properties.
Definition:
vtkTextProperty.h:34
vtkVariantArray
An array holding vtkVariants.
Definition:
vtkVariantArray.h:50
vtkX3D::title
@ title
Definition:
vtkX3D.h:506
vtkChartLegend.h
vtkNew.h
vtkStdString.h
vtkVector.h
Generated on Mon Feb 15 2021 00:00:00 for VTK by
1.9.1