00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00027 #ifndef __vtkPlotBar_h
00028 #define __vtkPlotBar_h
00029
00030 #include "vtkPlot.h"
00031 #include "vtkSmartPointer.h"
00032
00033 class vtkContext2D;
00034 class vtkTable;
00035 class vtkPoints2D;
00036 class vtkStdString;
00037 class vtkColorSeries;
00038
00039 class vtkPlotBarPrivate;
00040
00041 class VTK_CHARTS_EXPORT vtkPlotBar : public vtkPlot
00042 {
00043 public:
00044 vtkTypeMacro(vtkPlotBar, vtkPlot);
00045 virtual void PrintSelf(ostream &os, vtkIndent indent);
00046
00048
00049 enum {
00050 VERTICAL = 0,
00051 HORIZONTAL
00052 };
00054
00056 static vtkPlotBar *New();
00057
00060 virtual bool Paint(vtkContext2D *painter);
00061
00063
00068 virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
00069 int legendIndex);
00071
00073
00074 virtual void SetColor(unsigned char r, unsigned char g, unsigned char b,
00075 unsigned char a);
00076 virtual void SetColor(double r, double g, double b);
00077 virtual void GetColor(double rgb[3]);
00079
00081
00082 vtkSetMacro(Width, float);
00084
00086
00087 vtkGetMacro(Width, float);
00089
00091
00094 vtkSetMacro(Offset, float);
00095 vtkGetMacro(Offset, float);
00097
00099
00101 virtual void SetOrientation(int orientation);
00102 vtkGetMacro(Orientation, int);
00104
00106 virtual void GetBounds(double bounds[4]);
00107
00109 virtual void SetInputArray(int index, const vtkStdString &name);
00110
00112 void SetColorSeries(vtkColorSeries *colorSeries);
00113
00115 vtkColorSeries *GetColorSeries();
00116
00118 virtual vtkStringArray *GetLabels();
00119
00121 virtual void SetGroupName(const vtkStdString& name);
00122
00124 virtual vtkStdString GetGroupName();
00125
00127
00129 virtual vtkStdString GetTooltipLabel(const vtkVector2f &plotPos,
00130 vtkIdType seriesIndex,
00131 vtkIdType segmentIndex);
00133
00135 virtual bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max);
00136
00137
00139
00142 virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
00143 const vtkVector2f& tolerance,
00144 vtkVector2f* location);
00146
00148
00153 virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
00154 const vtkVector2f&,
00155 vtkVector2f* location,
00156 vtkIdType* segmentIndex);
00158
00159 protected:
00160 vtkPlotBar();
00161 ~vtkPlotBar();
00162
00164 bool UpdateTableCache(vtkTable *table);
00165
00167 vtkPoints2D *Points;
00168
00169 float Width;
00170 float Offset;
00171
00172 int Orientation;
00173
00175 vtkTimeStamp BuildTime;
00176
00178 vtkSmartPointer<vtkColorSeries> ColorSeries;
00179
00180 private:
00181 vtkPlotBar(const vtkPlotBar &);
00182 void operator=(const vtkPlotBar &);
00183
00184 vtkPlotBarPrivate *Private;
00185
00186
00187 };
00188
00189 #endif //__vtkPlotBar_h