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 
47 #ifndef vtkCategoryLegend_h
48 #define vtkCategoryLegend_h
49 
50 #include "vtkChartLegend.h"
51 #include "vtkChartsCoreModule.h" // For export macro
52 #include "vtkNew.h" // For vtkNew ivars
53 #include "vtkStdString.h" // For vtkStdString ivars
54 #include "vtkVector.h" // For vtkRectf
55 
56 class vtkScalarsToColors;
57 class vtkTextProperty;
58 class vtkVariantArray;
59 
60 class VTKCHARTSCORE_EXPORT vtkCategoryLegend : public vtkChartLegend
61 {
62 public:
64  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
67 
71  enum
72  {
73  VERTICAL = 0,
74  HORIZONTAL
75  };
76 
80  bool Paint(vtkContext2D* painter) override;
81 
87 
89 
97 
99 
105  vtkGetMacro(Values, vtkVariantArray*);
106  vtkSetMacro(Values, vtkVariantArray*);
108 
110 
113  virtual void SetTitle(const vtkStdString& title);
116 
118 
121  vtkGetMacro(OutlierLabel, vtkStdString);
122  vtkSetMacro(OutlierLabel, vtkStdString);
124 
125 protected:
127  ~vtkCategoryLegend() override;
128 
136 
137 private:
138  vtkCategoryLegend(const vtkCategoryLegend&) = delete;
139  void operator=(const vtkCategoryLegend&) = delete;
140 };
141 
142 #endif
vtkStdString.h
vtkCategoryLegend::SetTitle
virtual void SetTitle(const vtkStdString &title)
Get/set the title text of the legend.
vtkCategoryLegend::HasOutliers
bool HasOutliers
Definition: vtkCategoryLegend.h:129
vtkChartLegend
draw the chart legend
Definition: vtkChartLegend.h:69
vtkVector.h
vtkCategoryLegend::GetTitle
virtual vtkStdString GetTitle()
Get/set the title text of the legend.
vtkVariantArray
An array holding vtkVariants.
Definition: vtkVariantArray.h:119
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:73
vtkCategoryLegend::SetScalarsToColors
virtual void SetScalarsToColors(vtkScalarsToColors *stc)
Get/Set the vtkScalarsToColors used to draw this legend.
vtkCategoryLegend::Values
vtkVariantArray * Values
Definition: vtkCategoryLegend.h:135
vtkCategoryLegend::GetBoundingRect
vtkRectf GetBoundingRect(vtkContext2D *painter) override
Compute and return the lower left corner of this legend, along with its width and height.
vtkCategoryLegend::New
static vtkCategoryLegend * New()
vtkCategoryLegend::ScalarsToColors
vtkScalarsToColors * ScalarsToColors
Definition: vtkCategoryLegend.h:131
vtkX3D::title
@ title
Definition: vtkX3D.h:506
vtkCategoryLegend::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCategoryLegend::TitleWidthOffset
float TitleWidthOffset
Definition: vtkCategoryLegend.h:130
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkNew< vtkTextProperty >
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition: vtkScalarsToColors.h:109
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:143
vtkCategoryLegend::GetScalarsToColors
virtual vtkScalarsToColors * GetScalarsToColors()
Get/Set the vtkScalarsToColors used to draw this legend.
vtkCategoryLegend::Paint
bool Paint(vtkContext2D *painter) override
Paint the legend into a rectangle defined by the bounds.
vtkNew.h
vtkCategoryLegend::TitleProperties
vtkNew< vtkTextProperty > TitleProperties
Definition: vtkCategoryLegend.h:134
vtkChartLegend.h
vtkCategoryLegend
Legend item to display categorical data.
Definition: vtkCategoryLegend.h:61
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
vtkCategoryLegend::~vtkCategoryLegend
~vtkCategoryLegend() override
vtkRectf
Definition: vtkRect.h:336
vtkCategoryLegend::Title
vtkStdString Title
Definition: vtkCategoryLegend.h:133
vtkCategoryLegend::vtkCategoryLegend
vtkCategoryLegend()
vtkCategoryLegend::OutlierLabel
vtkStdString OutlierLabel
Definition: vtkCategoryLegend.h:132