00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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 vtkTypeRevisionMacro(vtkPlot, vtkContextItem);
00044 virtual void PrintSelf(ostream &os, vtkIndent indent);
00045
00051 virtual bool PaintLegend(vtkContext2D *painter, float rect[4]);
00052
00053
00055
00057 virtual bool GetNearestPoint(const vtkVector2f& point,
00058 const vtkVector2f& tolerance,
00059 vtkVector2f* location);
00061
00062
00064
00065 virtual void SetColor(unsigned char r, unsigned char g, unsigned char b,
00066 unsigned char a);
00067 virtual void SetColor(double r, double g, double b);
00068 virtual void GetColor(double rgb[3]);
00070
00072 virtual void SetWidth(float width);
00073
00075 virtual float GetWidth();
00076
00078
00080 vtkGetObjectMacro(Pen, vtkPen);
00082
00084
00086 vtkGetObjectMacro(Brush, vtkBrush);
00088
00090
00091 vtkSetStringMacro(Label);
00093
00095 const char* GetLabel();
00096
00098
00099 vtkGetObjectMacro(Data, vtkContextMapper2D);
00101
00103
00106 vtkGetMacro(UseIndexForXSeries, bool);
00108
00110
00113 vtkSetMacro(UseIndexForXSeries, bool);
00115
00117
00119 virtual void SetInput(vtkTable *table);
00120 virtual void SetInput(vtkTable *table, const char *xColumn,
00121 const char *yColumn);
00122 void SetInput(vtkTable *table, vtkIdType xColumn, vtkIdType yColumn);
00124
00128 virtual void SetInputArray(int index, const char *name);
00129
00130 virtual void SetSelection(vtkIdTypeArray *id);
00131
00133
00134 vtkGetObjectMacro(XAxis, vtkAxis);
00135 virtual void SetXAxis(vtkAxis* axis);
00137
00139
00140 vtkGetObjectMacro(YAxis, vtkAxis);
00141 virtual void SetYAxis(vtkAxis* axis);
00143
00144 virtual void GetBounds(double bounds[4])
00145 { bounds[0] = bounds[1] = bounds[2] = bounds[3] = 0.0; }
00146
00147
00149
00151 void SetProperty(const char *property, vtkVariant *var);
00152 vtkVariant GetProperty(const char *property);
00154
00155
00156
00157 protected:
00158 vtkPlot();
00159 ~vtkPlot();
00160
00162 vtkPen* Pen;
00163
00165 vtkBrush* Brush;
00166
00168 char *Label;
00169
00173 bool UseIndexForXSeries;
00174
00177 vtkContextMapper2D *Data;
00178
00180 vtkIdTypeArray *Selection;
00181
00183 vtkAxis* XAxis;
00184
00186 vtkAxis* YAxis;
00187
00188 private:
00189 vtkPlot(const vtkPlot &);
00190 void operator=(const vtkPlot &);
00191
00192
00193 };
00194
00195 #endif //__vtkPlot_h