VTK  9.3.20240424
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
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
47VTK_ABI_NAMESPACE_BEGIN
49class vtkTextProperty;
50class vtkVariantArray;
51
52class VTKCHARTSCORE_EXPORT vtkCategoryLegend : public vtkChartLegend
53{
54public:
56 void PrintSelf(ostream& os, vtkIndent indent) override;
57
59
63 enum
64 {
65 VERTICAL = 0,
66 HORIZONTAL
67 };
68
72 bool Paint(vtkContext2D* painter) override;
73
79
81
89
91
97 vtkGetObjectMacro(Values, vtkVariantArray);
98 virtual void SetValues(vtkVariantArray*);
100
102
105 virtual void SetTitle(const vtkStdString& title);
108
110
113 vtkGetMacro(OutlierLabel, vtkStdString);
114 vtkSetMacro(OutlierLabel, vtkStdString);
116
117protected:
120
128
129private:
130 vtkCategoryLegend(const vtkCategoryLegend&) = delete;
131 void operator=(const vtkCategoryLegend&) = delete;
132};
133
134VTK_ABI_NAMESPACE_END
135#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:108
Allocate and hold a VTK object.
Definition vtkNew.h:160
Superclass for mapping scalar values to colors.
Wrapper around std::string to keep symbols short.
represent text properties.
An array holding vtkVariants.