VTK  9.4.20251007
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
18
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
28
29VTK_ABI_NAMESPACE_BEGIN
31class vtkTextProperty;
32class vtkVariantArray;
33
34class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkCategoryLegend : public vtkChartLegend
35{
36public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
41
45 enum
46 {
49 };
50
54 bool Paint(vtkContext2D* painter) override;
55
61
63
71
73
79 vtkGetObjectMacro(Values, vtkVariantArray);
80 virtual void SetValues(vtkVariantArray*);
82
84
87 virtual void SetTitle(const vtkStdString& title);
90
92
98
99protected:
102
110
111private:
112 vtkCategoryLegend(const vtkCategoryLegend&) = delete;
113 void operator=(const vtkCategoryLegend&) = delete;
114};
115
116VTK_ABI_NAMESPACE_END
117#endif
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.
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:58
Superclass for mapping scalar values to colors.
Wrapper around std::string to keep symbols short.
represent text properties.
An array holding vtkVariants.
#define VTK_MARSHALAUTO