VTK
vtkPlotBar.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlotBar.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 
27 #ifndef __vtkPlotBar_h
28 #define __vtkPlotBar_h
29 
30 #include "vtkPlot.h"
31 #include "vtkSmartPointer.h" // Needed to hold ColorSeries
32 
33 class vtkContext2D;
34 class vtkTable;
35 class vtkPoints2D;
36 class vtkStdString;
37 class vtkColorSeries;
38 
39 class vtkPlotBarPrivate;
40 
42 {
43 public:
44  vtkTypeMacro(vtkPlotBar, vtkPlot);
45  virtual void PrintSelf(ostream &os, vtkIndent indent);
46 
48 
49  enum {
50  VERTICAL = 0,
51  HORIZONTAL
52  };
54 
56  static vtkPlotBar *New();
57 
60  virtual bool Paint(vtkContext2D *painter);
61 
63 
68  virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
69  int legendIndex);
71 
73 
74  virtual void SetColor(unsigned char r, unsigned char g, unsigned char b,
75  unsigned char a);
76  virtual void SetColor(double r, double g, double b);
77  virtual void GetColor(double rgb[3]);
79 
81 
82  vtkSetMacro(Width, float);
84 
86 
87  vtkGetMacro(Width, float);
89 
91 
94  vtkSetMacro(Offset, float);
95  vtkGetMacro(Offset, float);
97 
99 
101  virtual void SetOrientation(int orientation);
102  vtkGetMacro(Orientation, int);
104 
106  virtual void GetBounds(double bounds[4]);
107 
109  virtual void SetInputArray(int index, const vtkStdString &name);
110 
112  void SetColorSeries(vtkColorSeries *colorSeries);
113 
115  vtkColorSeries *GetColorSeries();
116 
118  virtual vtkStringArray *GetLabels();
119 
121  virtual void SetGroupName(const vtkStdString& name);
122 
124  virtual vtkStdString GetGroupName();
125 
127 
129  virtual vtkStdString GetTooltipLabel(const vtkVector2f &plotPos,
130  vtkIdType seriesIndex,
131  vtkIdType segmentIndex);
133 
135  virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
136 
137 //BTX
139 
142  virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
143  const vtkVector2f& tolerance,
144  vtkVector2f* location);
146 
148 
153  virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
154  const vtkVector2f&,
155  vtkVector2f* location,
156  vtkIdType* segmentIndex);
158 
159 protected:
160  vtkPlotBar();
161  ~vtkPlotBar();
162 
164  bool UpdateTableCache(vtkTable *table);
165 
168 
169  float Width;
170  float Offset;
171 
173 
176 
179 
180 private:
181  vtkPlotBar(const vtkPlotBar &); // Not implemented.
182  void operator=(const vtkPlotBar &); // Not implemented.
183 
184  vtkPlotBarPrivate *Private;
185 
186 //ETX
187 };
188 
189 #endif //__vtkPlotBar_h
#define VTK_CHARTS_EXPORT
Wrapper around vtkstd::string to keep symbols short.
Definition: vtkStdString.h:45
virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex)
float Width
Definition: vtkPlotBar.h:169
virtual bool Paint(vtkContext2D *painter)
record modification and/or execution time
Definition: vtkTimeStamp.h:33
virtual void GetBounds(double bounds[4])
Definition: vtkPlot.h:213
virtual vtkStdString GetTooltipLabel(const vtkVector2f &plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex)
a vtkAbstractArray subclass for strings
int vtkIdType
Definition: vtkType.h:255
virtual void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
int Orientation
Definition: vtkPlotBar.h:172
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:54
virtual bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
a simple class to control print indentation
Definition: vtkIndent.h:37
represent and manipulate 2D points
Definition: vtkPoints2D.h:34
virtual vtkStringArray * GetLabels()
Abstract class for 2D plots.
Definition: vtkPlot.h:50
Class for drawing an XY plot given two columns from a vtkTable.
Definition: vtkPlotBar.h:41
float Offset
Definition: vtkPlotBar.h:170
virtual vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location)
virtual void SetInputArray(int index, const vtkStdString &name)
stores a list of colors.
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual void GetColor(double rgb[3])
vtkPoints2D * Points
Definition: vtkPlotBar.h:167
vtkSmartPointer< vtkColorSeries > ColorSeries
Definition: vtkPlotBar.h:178
static vtkObject * New()
vtkTimeStamp BuildTime
Definition: vtkPlotBar.h:175