VTK
dox/Charts/vtkPlot.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPlot.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 
00026 #ifndef __vtkPlot_h
00027 #define __vtkPlot_h
00028 
00029 #include "vtkContextItem.h"
00030 
00031 class vtkVariant;
00032 class vtkTable;
00033 class vtkIdTypeArray;
00034 class vtkContextMapper2D;
00035 class vtkPen;
00036 class vtkBrush;
00037 class vtkAxis;
00038 class vtkVector2f;
00039 
00040 class VTK_CHARTS_EXPORT vtkPlot : public vtkContextItem
00041 {
00042 public:
00043   vtkTypeMacro(vtkPlot, vtkContextItem);
00044   virtual void PrintSelf(ostream &os, vtkIndent indent);
00045 
00051   virtual bool PaintLegend(vtkContext2D *painter, float rect[4]);
00052 
00053 //BTX
00055 
00057   virtual bool GetNearestPoint(const vtkVector2f& point,
00058                                const vtkVector2f& tolerance,
00059                                vtkVector2f* location);
00061 
00062   virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
00063 //ETX
00064 
00066 
00067   virtual void SetColor(unsigned char r, unsigned char g, unsigned char b,
00068                         unsigned char a);
00069   virtual void SetColor(double r,  double g, double b);
00070   virtual void GetColor(double rgb[3]);
00072 
00074   virtual void SetWidth(float width);
00075 
00077   virtual float GetWidth();
00078 
00080 
00082   vtkGetObjectMacro(Pen, vtkPen);
00084 
00086 
00088   vtkGetObjectMacro(Brush, vtkBrush);
00090 
00092 
00093   vtkSetStringMacro(Label);
00095 
00097   const char* GetLabel();
00098 
00100 
00101   vtkGetObjectMacro(Data, vtkContextMapper2D);
00103 
00105 
00108   vtkGetMacro(UseIndexForXSeries, bool);
00110 
00112 
00115   vtkSetMacro(UseIndexForXSeries, bool);
00117 
00119 
00121   virtual void SetInput(vtkTable *table);
00122   virtual void SetInput(vtkTable *table, const char *xColumn,
00123                         const char *yColumn);
00124   void SetInput(vtkTable *table, vtkIdType xColumn, vtkIdType yColumn);
00126 
00128   virtual vtkTable* GetInput();
00129 
00133   virtual void SetInputArray(int index, const char *name);
00134 
00135   virtual void SetSelection(vtkIdTypeArray *id);
00136   vtkGetObjectMacro(Selection, vtkIdTypeArray);
00137 
00139 
00140   vtkGetObjectMacro(XAxis, vtkAxis);
00141   virtual void SetXAxis(vtkAxis* axis);
00143 
00145 
00146   vtkGetObjectMacro(YAxis, vtkAxis);
00147   virtual void SetYAxis(vtkAxis* axis);
00149 
00150   virtual void GetBounds(double bounds[4])
00151   { bounds[0] = bounds[1] = bounds[2] = bounds[3] = 0.0; }
00152 
00153 //BTX
00155 
00157   void SetProperty(const char *property, vtkVariant *var);
00158   vtkVariant GetProperty(const char *property);
00160 //ETX
00161 
00162 //BTX
00163 protected:
00164   vtkPlot();
00165   ~vtkPlot();
00166 
00168   vtkPen* Pen;
00169 
00171   vtkBrush* Brush;
00172 
00174   char *Label;
00175 
00179   bool UseIndexForXSeries;
00180 
00183   vtkContextMapper2D *Data;
00184 
00186   vtkIdTypeArray *Selection;
00187 
00189   vtkAxis* XAxis;
00190 
00192   vtkAxis* YAxis;
00193 
00194 private:
00195   vtkPlot(const vtkPlot &); // Not implemented.
00196   void operator=(const vtkPlot &); // Not implemented.
00197 
00198 //ETX
00199 };
00200 
00201 #endif //__vtkPlot_h