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 
31 #ifndef vtkCategoryLegend_h
32 #define vtkCategoryLegend_h
33 
34 #include "vtkChartLegend.h"
35 #include "vtkChartsCoreModule.h" // For export macro
36 #include "vtkNew.h" // For vtkNew ivars
37 #include "vtkStdString.h" // For vtkStdString ivars
38 #include "vtkVector.h" // For vtkRectf
39 
40 class vtkScalarsToColors;
41 class vtkTextProperty;
42 class vtkVariantArray;
43 
44 class VTKCHARTSCORE_EXPORT vtkCategoryLegend : public vtkChartLegend
45 {
46 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
50  static vtkCategoryLegend* New();
51 
55  enum
56  {
57  VERTICAL = 0,
58  HORIZONTAL
59  };
60 
64  bool Paint(vtkContext2D* painter) override;
65 
70  vtkRectf GetBoundingRect(vtkContext2D* painter) override;
71 
73 
78  virtual void SetScalarsToColors(vtkScalarsToColors* stc);
79  virtual vtkScalarsToColors* GetScalarsToColors();
81 
83 
89  vtkGetObjectMacro(Values, vtkVariantArray);
90  virtual void SetValues(vtkVariantArray*);
92 
94 
97  virtual void SetTitle(const vtkStdString& title);
98  virtual vtkStdString GetTitle();
100 
102 
105  vtkGetMacro(OutlierLabel, vtkStdString);
106  vtkSetMacro(OutlierLabel, vtkStdString);
108 
109 protected:
111  ~vtkCategoryLegend() override;
112 
120 
121 private:
122  vtkCategoryLegend(const vtkCategoryLegend&) = delete;
123  void operator=(const vtkCategoryLegend&) = delete;
124 };
125 
126 #endif
vtkStdString OutlierLabel
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
An array holding vtkVariants.
virtual vtkRectf GetBoundingRect(vtkContext2D *painter)
Request the space the legend requires to be drawn.
vtkScalarsToColors * ScalarsToColors
Superclass for mapping scalar values to colors.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:57
vtkVariantArray * Values
a simple class to control print indentation
Definition: vtkIndent.h:39
static vtkChartLegend * New()
Creates a 2D Chart object.
represent text properties.
Legend item to display categorical data.
draw the chart legend
bool Paint(vtkContext2D *painter) override
Paint event for the axis, called whenever the axis needs to be drawn.
vtkNew< vtkTextProperty > TitleProperties