VTK  9.1.0
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
37#ifndef vtkCategoryLegend_h
38#define vtkCategoryLegend_h
39
40#include "vtkChartLegend.h"
41#include "vtkChartsCoreModule.h" // For export macro
42#include "vtkNew.h" // For vtkNew ivars
43#include "vtkStdString.h" // For vtkStdString ivars
44#include "vtkVector.h" // For vtkRectf
45
47class vtkTextProperty;
48class vtkVariantArray;
49
50class VTKCHARTSCORE_EXPORT vtkCategoryLegend : public vtkChartLegend
51{
52public:
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
57
61 enum
62 {
63 VERTICAL = 0,
64 HORIZONTAL
65 };
66
70 bool Paint(vtkContext2D* painter) override;
71
77
79
87
89
95 vtkGetMacro(Values, vtkVariantArray*);
96 vtkSetMacro(Values, vtkVariantArray*);
98
100
103 virtual void SetTitle(const vtkStdString& title);
106
108
111 vtkGetMacro(OutlierLabel, vtkStdString);
112 vtkSetMacro(OutlierLabel, vtkStdString);
114
115protected:
118
126
127private:
128 vtkCategoryLegend(const vtkCategoryLegend&) = delete;
129 void operator=(const vtkCategoryLegend&) = delete;
130};
131
132#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
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.
Definition: vtkContext2D.h:63
a simple class to control print indentation
Definition: vtkIndent.h:43
Superclass for mapping scalar values to colors.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:45
represent text properties.
An array holding vtkVariants.
@ title
Definition: vtkX3D.h:506