VTK  9.2.6
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 
40 #ifndef vtkCategoryLegend_h
41 #define vtkCategoryLegend_h
42 
43 #include "vtkChartLegend.h"
44 #include "vtkChartsCoreModule.h" // For export macro
45 #include "vtkNew.h" // For vtkNew ivars
46 #include "vtkStdString.h" // For vtkStdString ivars
47 #include "vtkVector.h" // For vtkRectf
48 
49 class vtkScalarsToColors;
50 class vtkTextProperty;
51 class vtkVariantArray;
52 
53 class VTKCHARTSCORE_EXPORT vtkCategoryLegend : public vtkChartLegend
54 {
55 public:
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
60 
64  enum
65  {
66  VERTICAL = 0,
67  HORIZONTAL
68  };
69 
73  bool Paint(vtkContext2D* painter) override;
74 
80 
82 
90 
92 
98  vtkGetObjectMacro(Values, vtkVariantArray);
99  virtual void SetValues(vtkVariantArray*);
101 
103 
106  virtual void SetTitle(const vtkStdString& title);
109 
111 
114  vtkGetMacro(OutlierLabel, vtkStdString);
115  vtkSetMacro(OutlierLabel, vtkStdString);
117 
118 protected:
120  ~vtkCategoryLegend() override;
121 
129 
130 private:
131  vtkCategoryLegend(const vtkCategoryLegend&) = delete;
132  void operator=(const vtkCategoryLegend&) = delete;
133 };
134 
135 #endif
Legend item to display categorical data.
vtkScalarsToColors * ScalarsToColors
virtual vtkScalarsToColors * GetScalarsToColors()
Get/Set the vtkScalarsToColors used to draw this legend.
virtual vtkStdString GetTitle()
Get/set the title text of the legend.
vtkNew< vtkTextProperty > TitleProperties
~vtkCategoryLegend() override
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.
static vtkCategoryLegend * New()
draw the chart legend
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:67
a simple class to control print indentation
Definition: vtkIndent.h:49
Superclass for mapping scalar values to colors.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:48
represent text properties.
An array holding vtkVariants.
@ title
Definition: vtkX3D.h:506