VTK
vtkPlot.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlot.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 
32 #ifndef __vtkPlot_h
33 #define __vtkPlot_h
34 
35 #include "vtkContextItem.h"
36 #include "vtkStdString.h" // Needed to hold TooltipLabelFormat ivar
37 #include "vtkSmartPointer.h" // Needed to hold SP ivars
38 
39 class vtkVariant;
40 class vtkTable;
41 class vtkIdTypeArray;
42 class vtkContextMapper2D;
43 class vtkPen;
44 class vtkBrush;
45 class vtkAxis;
46 class vtkVector2f;
47 class vtkRectf;
48 class vtkStringArray;
49 
51 {
52 public:
53  vtkTypeMacro(vtkPlot, vtkContextItem);
54  virtual void PrintSelf(ostream &os, vtkIndent indent);
55 
57 
62  virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
63  int legendIndex);
65 
67 
75  virtual void SetTooltipLabelFormat(const vtkStdString &label);
76  virtual vtkStdString GetTooltipLabelFormat();
78 
80 
81  virtual void SetTooltipNotation(int notation);
82  virtual int GetTooltipNotation();
84 
86 
87  virtual void SetTooltipPrecision(int precision);
88  virtual int GetTooltipPrecision();
90 
91 //BTX
93 
95  virtual vtkStdString GetTooltipLabel(const vtkVector2f &plotPos,
96  vtkIdType seriesIndex,
97  vtkIdType segmentIndex);
99 
101 
104  virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
105  const vtkVector2f& tolerance,
108 
110 
111  virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
112 //ETX
114 
116 
117  virtual void SetColor(unsigned char r, unsigned char g, unsigned char b,
118  unsigned char a);
119  virtual void SetColor(double r, double g, double b);
120  virtual void GetColor(double rgb[3]);
121  void GetColor(unsigned char rgb[3]);
123 
125  virtual void SetWidth(float width);
126 
128  virtual float GetWidth();
129 
131 
133  void SetPen(vtkPen *pen);
134  vtkPen* GetPen();
136 
138 
139  void SetBrush(vtkBrush *brush);
140  vtkBrush* GetBrush();
142 
144  virtual void SetLabel(const vtkStdString &label);
145 
147  virtual vtkStdString GetLabel();
148 
151  virtual void SetLabels(vtkStringArray *labels);
152 
156  virtual vtkStringArray *GetLabels();
157 
159  virtual int GetNumberOfLabels();
160 
162  vtkStdString GetLabel(vtkIdType index);
163 
168  void SetIndexedLabels(vtkStringArray *labels);
169 
171  virtual vtkStringArray *GetIndexedLabels();
172 
174  vtkContextMapper2D* GetData();
175 
177 
180  vtkGetMacro(UseIndexForXSeries, bool);
182 
184 
187  vtkSetMacro(UseIndexForXSeries, bool);
189 
191 
193  virtual void SetInput(vtkTable *table);
194  virtual void SetInput(vtkTable *table, const vtkStdString &xColumn,
195  const vtkStdString &yColumn);
196  void SetInput(vtkTable *table, vtkIdType xColumn, vtkIdType yColumn);
198 
200  virtual vtkTable* GetInput();
201 
205  virtual void SetInputArray(int index, const vtkStdString &name);
206 
207  virtual void SetSelection(vtkIdTypeArray *id);
208  vtkGetObjectMacro(Selection, vtkIdTypeArray);
209 
211 
212  vtkGetObjectMacro(XAxis, vtkAxis);
213  virtual void SetXAxis(vtkAxis* axis);
215 
217 
218  vtkGetObjectMacro(YAxis, vtkAxis);
219  virtual void SetYAxis(vtkAxis* axis);
221 
223 
224  virtual void GetBounds(double bounds[4])
225  { bounds[0] = bounds[1] = bounds[2] = bounds[3] = 0.0; }
227 
228 //BTX
230 
232  virtual void SetProperty(const vtkStdString &property, const vtkVariant &var);
233  virtual vtkVariant GetProperty(const vtkStdString &property);
234 //ETX
236 
237 //BTX
238 protected:
239  vtkPlot();
240  ~vtkPlot();
241 
243  vtkStdString GetNumber(double position, vtkAxis *axis);
244 
247 
250 
253 
256 
259 
264 
268 
271 
274 
277 
281 
285 
288 
289 private:
290  vtkPlot(const vtkPlot &); // Not implemented.
291  void operator=(const vtkPlot &); // Not implemented.
292 
293 //ETX
294 };
295 
296 #endif //__vtkPlot_h