VTK
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 "vtkChartsCoreModule.h" // For export macro
35 #include "vtkChartLegend.h"
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  static vtkCategoryLegend* New();
49 
53  enum {
54  VERTICAL = 0,
55  HORIZONTAL
56  };
57 
61  virtual bool Paint(vtkContext2D *painter);
62 
67  virtual vtkRectf GetBoundingRect(vtkContext2D* painter);
68 
70 
75  virtual void SetScalarsToColors(vtkScalarsToColors* stc);
76  virtual vtkScalarsToColors * GetScalarsToColors();
78 
80 
86  vtkGetMacro(Values, vtkVariantArray*);
87  vtkSetMacro(Values, vtkVariantArray*);
89 
91 
94  virtual void SetTitle(const vtkStdString &title);
95  virtual vtkStdString GetTitle();
97 
99 
102  vtkGetMacro(OutlierLabel, vtkStdString);
103  vtkSetMacro(OutlierLabel, vtkStdString);
105 
106 protected:
108  virtual ~vtkCategoryLegend();
109 
117 
118 private:
119  vtkCategoryLegend(const vtkCategoryLegend &) VTK_DELETE_FUNCTION;
120  void operator=(const vtkCategoryLegend &) VTK_DELETE_FUNCTION;
121 };
122 
123 #endif
vtkStdString OutlierLabel
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:47
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.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:57
vtkVariantArray * Values
static vtkChartLegend * New()
Creates a 2D Chart object.
represent text properties.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Legend item to display categorical data.
draw the chart legend
virtual bool Paint(vtkContext2D *painter)
Paint event for the axis, called whenever the axis needs to be drawn.
vtkNew< vtkTextProperty > TitleProperties