VTK  9.7.1
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 
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 
29 VTK_ABI_NAMESPACE_BEGIN
30 class vtkScalarsToColors;
31 class vtkTextProperty;
32 class vtkVariantArray;
33 
34 class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkCategoryLegend : public vtkChartLegend
35 {
36 public:
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
40  static vtkCategoryLegend* New();
41 
45  enum
46  {
47  VERTICAL = 0,
48  HORIZONTAL
49  };
50 
54  bool Paint(vtkContext2D* painter) override;
55 
60  vtkRectf GetBoundingRect(vtkContext2D* painter) override;
61 
63 
68  vtkGetObjectMacro(ScalarsToColors, vtkScalarsToColors);
69  virtual void SetScalarsToColors(vtkScalarsToColors*);
71 
73 
79  vtkGetObjectMacro(Values, vtkVariantArray);
80  virtual void SetValues(vtkVariantArray*);
82 
84 
87  virtual void SetTitle(const vtkStdString& title);
88  virtual vtkStdString GetTitle();
90 
92 
95  vtkGetMacro(OutlierLabel, vtkStdString);
96  vtkSetMacro(OutlierLabel, vtkStdString);
98 
99 protected:
101  ~vtkCategoryLegend() override;
102 
110 
111 private:
112  vtkCategoryLegend(const vtkCategoryLegend&) = delete;
113  void operator=(const vtkCategoryLegend&) = delete;
114 };
115 
116 VTK_ABI_NAMESPACE_END
117 #endif
vtkStdString OutlierLabel
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:27
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:49
vtkVariantArray * Values
a simple class to control print indentation
Definition: vtkIndent.h:28
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
#define VTK_MARSHALAUTO