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
19#ifndef vtkCategoryLegend_h
20#define vtkCategoryLegend_h
21
22#include "vtkChartLegend.h"
23#include "vtkChartsCoreModule.h" // For export macro
24#include "vtkNew.h" // For vtkNew ivars
25#include "vtkStdString.h" // For vtkStdString ivars
26#include "vtkVector.h" // For vtkRectf
27
28VTK_ABI_NAMESPACE_BEGIN
30class vtkTextProperty;
31class vtkVariantArray;
32
33class VTKCHARTSCORE_EXPORT vtkCategoryLegend : public vtkChartLegend
34{
35public:
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
40
44 enum
45 {
46 VERTICAL = 0,
47 HORIZONTAL
48 };
49
53 bool Paint(vtkContext2D* painter) override;
54
60
62
70
72
79 virtual void SetValues(vtkVariantArray*);
81
83
86 virtual void SetTitle(const vtkStdString& title);
89
91
94 vtkGetMacro(OutlierLabel, vtkStdString);
95 vtkSetMacro(OutlierLabel, vtkStdString);
97
98protected:
101
109
110private:
111 vtkCategoryLegend(const vtkCategoryLegend&) = delete;
112 void operator=(const vtkCategoryLegend&) = delete;
113};
114
115VTK_ABI_NAMESPACE_END
116#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:29
Allocate and hold a VTK object.
Definition vtkNew.h:51
Superclass for mapping scalar values to colors.
Wrapper around std::string to keep symbols short.
represent text properties.
An array holding vtkVariants.