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 "vtkChartsCoreModule.h" // For export macro
31 #include "vtkPlot.h"
32 #include "vtkSmartPointer.h" // Needed to hold ColorSeries
33 
34 class vtkContext2D;
35 class vtkTable;
36 class vtkPoints2D;
37 class vtkStdString;
38 class vtkColorSeries;
40 class vtkScalarsToColors;
41 
42 class vtkPlotBarPrivate;
43 
45 {
46 public:
47  vtkTypeMacro(vtkPlotBar, vtkPlot);
48  virtual void PrintSelf(ostream &os, vtkIndent indent);
49 
51 
52  enum {
53  VERTICAL = 0,
54  HORIZONTAL
55  };
57 
59  static vtkPlotBar *New();
60 
63  virtual void Update();
64 
67  virtual bool Paint(vtkContext2D *painter);
68 
70 
75  virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
76  int legendIndex);
78 
80 
81  virtual void SetColor(unsigned char r, unsigned char g, unsigned char b,
82  unsigned char a);
83  virtual void SetColor(double r, double g, double b);
84  virtual void GetColor(double rgb[3]);
86 
88 
89  vtkSetMacro(Width, float);
91 
93 
94  vtkGetMacro(Width, float);
96 
98 
101  vtkSetMacro(Offset, float);
102  vtkGetMacro(Offset, float);
104 
106 
108  virtual void SetOrientation(int orientation);
109  vtkGetMacro(Orientation, int);
111 
113  virtual void GetBounds(double bounds[4], bool unscaled);
114 
116  virtual void GetBounds(double bounds[4]);
117 
119  virtual void GetUnscaledInputBounds(double bounds[4]);
120 
122  virtual void SetInputArray(int index, const vtkStdString &name);
123 
125  void SetColorSeries(vtkColorSeries *colorSeries);
126 
128  vtkColorSeries *GetColorSeries();
129 
131 
132  virtual void SetLookupTable(vtkScalarsToColors *lut);
133  virtual vtkScalarsToColors *GetLookupTable();
135 
138  virtual void CreateDefaultLookupTable();
139 
141 
143  vtkSetMacro(ScalarVisibility, bool);
144  vtkGetMacro(ScalarVisibility, bool);
145  vtkBooleanMacro(ScalarVisibility, bool);
147 
149 
152  void SelectColorArray(vtkIdType arrayNum);
153  void SelectColorArray(const vtkStdString& arrayName);
155 
157  vtkStdString GetColorArrayName();
158 
160  virtual vtkStringArray *GetLabels();
161 
163  virtual void SetGroupName(const vtkStdString& name);
164 
166  virtual vtkStdString GetGroupName();
167 
169 
171  virtual vtkStdString GetTooltipLabel(const vtkVector2d &plotPos,
172  vtkIdType seriesIndex,
173  vtkIdType segmentIndex);
175 
177  virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
178 
179 //BTX
181 
185  const vtkVector2f& tolerance,
188 
190 
196  const vtkVector2f&,
198  vtkIdType* segmentIndex);
200 
202  int GetBarsCount();
203 
205  void GetDataBounds(double bounds[2]);
206 
207 protected:
208  vtkPlotBar();
209  ~vtkPlotBar();
210 
212  bool UpdateTableCache(vtkTable *table);
213 
216 
217  float Width;
218  float Offset;
219 
221 
224 
227 
229 
235 
236  bool LogX;
237  bool LogY;
238 
239 private:
240  vtkPlotBar(const vtkPlotBar &); // Not implemented.
241  void operator=(const vtkPlotBar &); // Not implemented.
242 
243  vtkPlotBarPrivate *Private;
244 
245 //ETX
246 };
247 
248 #endif //vtkPlotBar_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
vtkSmartPointer< vtkUnsignedCharArray > Colors
Definition: vtkPlotBar.h:231
virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex)
float Width
Definition: vtkPlotBar.h:217
virtual bool Paint(vtkContext2D *painter)
record modification and/or execution time
Definition: vtkTimeStamp.h:34
virtual void GetBounds(double bounds[4])
Definition: vtkPlot.h:276
a vtkAbstractArray subclass for strings
int vtkIdType
Definition: vtkType.h:275
virtual void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
int Orientation
Definition: vtkPlotBar.h:220
Superclass for mapping scalar values to colors.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:56
virtual bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
bool ScalarVisibility
Definition: vtkPlotBar.h:232
a simple class to control print indentation
Definition: vtkIndent.h:38
represent and manipulate 2D points
Definition: vtkPoints2D.h:35
virtual vtkStringArray * GetLabels()
Abstract class for 2D plots.
Definition: vtkPlot.h:51
Class for drawing an XY plot given two columns from a vtkTable.
Definition: vtkPlotBar.h:44
float Offset
Definition: vtkPlotBar.h:218
dynamic, self-adjusting array of unsigned char
virtual vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location)
virtual void SetInputArray(int index, const vtkStdString &name)
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:67
stores a list of colors.
virtual void GetUnscaledInputBounds(double bounds[4])
Definition: vtkPlot.h:295
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual void GetColor(double rgb[3])
vtkSmartPointer< vtkScalarsToColors > LookupTable
Definition: vtkPlotBar.h:230
vtkPoints2D * Points
Definition: vtkPlotBar.h:215
vtkSmartPointer< vtkColorSeries > ColorSeries
Definition: vtkPlotBar.h:226
vtkStdString ColorArrayName
Definition: vtkPlotBar.h:233
static vtkObject * New()
virtual void Update()
vtkTimeStamp BuildTime
Definition: vtkPlotBar.h:223
#define max(a, b)
#define VTKCHARTSCORE_EXPORT
virtual vtkStdString GetTooltipLabel(const vtkVector2d &plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex)