VTK  9.3.0
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
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
37VTK_ABI_NAMESPACE_BEGIN
39class vtkTextProperty;
40class vtkVariantArray;
41
42class VTKCHARTSCORE_EXPORT vtkCategoryLegend : public vtkChartLegend
43{
44public:
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
49
53 enum
54 {
55 VERTICAL = 0,
56 HORIZONTAL
57 };
58
62 bool Paint(vtkContext2D* painter) override;
63
69
71
79
81
88 virtual void SetValues(vtkVariantArray*);
90
92
95 virtual void SetTitle(const vtkStdString& title);
98
100
103 vtkGetMacro(OutlierLabel, vtkStdString);
104 vtkSetMacro(OutlierLabel, vtkStdString);
106
107protected:
110
118
119private:
120 vtkCategoryLegend(const vtkCategoryLegend&) = delete;
121 void operator=(const vtkCategoryLegend&) = delete;
122};
123
124VTK_ABI_NAMESPACE_END
125#endif
Legend item to display categorical data.
vtkScalarsToColors * ScalarsToColors
virtual vtkStdString GetTitle()
Get/set the title text of the legend.
vtkNew< vtkTextProperty > TitleProperties
~vtkCategoryLegend() override
virtual vtkScalarsToColors * GetScalarsToColors()
Get/Set the vtkScalarsToColors used to draw this legend.
static vtkCategoryLegend * New()
vtkVariantArray * Values
virtual void SetValues(vtkVariantArray *)
Get/Set the array of values that will be represented by this legend.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool Paint(vtkContext2D *painter) override
Paint the legend into a rectangle defined by the bounds.
vtkStdString OutlierLabel
virtual void SetScalarsToColors(vtkScalarsToColors *stc)
Get/Set the vtkScalarsToColors used to draw this legend.
vtkRectf GetBoundingRect(vtkContext2D *painter) override
Compute and return the lower left corner of this legend, along with its width and height.
virtual void SetTitle(const vtkStdString &title)
Get/set the title text of the legend.
draw the chart legend
Class for drawing 2D primitives to a graphical context.
a simple class to control print indentation
Definition vtkIndent.h:38
Allocate and hold a VTK object.
Definition vtkNew.h:60
Superclass for mapping scalar values to colors.
Wrapper around std::string to keep symbols short.
represent text properties.
An array holding vtkVariants.