00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00025 #ifndef __vtkContextDevice2D_h
00026 #define __vtkContextDevice2D_h
00027
00028 #include "vtkObject.h"
00029
00030 class vtkWindow;
00031 class vtkViewport;
00032 class vtkStdString;
00033 class vtkUnicodeString;
00034 class vtkTextProperty;
00035 class vtkPoints2D;
00036 class vtkImageData;
00037 class vtkMatrix3x3;
00038 class vtkAbstractContextBufferId;
00039 class vtkPen;
00040 class vtkBrush;
00041 class vtkRectf;
00042
00043 class VTK_CHARTS_EXPORT vtkContextDevice2D : public vtkObject
00044 {
00045 public:
00046 vtkTypeMacro(vtkContextDevice2D, vtkObject);
00047 virtual void PrintSelf(ostream &os, vtkIndent indent);
00048
00050
00054 virtual void DrawPoly(float *points, int n,
00055 unsigned char *colors = 0, int nc_comps = 0) = 0;
00057
00059
00061 virtual void DrawPoints(float *points, int n, unsigned char* colors = 0,
00062 int nc_comps = 0) = 0;
00064
00066
00071 virtual void DrawPointSprites(vtkImageData *sprite, float *points, int n,
00072 unsigned char *colors = 0, int nc_comps = 0) = 0;
00074
00076 virtual void DrawQuad(float *, int) { ; }
00077
00079 virtual void DrawQuadStrip(float *, int) { ; }
00080
00082 virtual void DrawPolygon(float *, int) { ; }
00083
00085
00091 virtual void DrawEllipseWedge(float x, float y, float outRx, float outRy,
00092 float inRx, float inRy, float startAngle,
00093 float stopAngle)=0;
00095
00097
00100 virtual void DrawEllipticArc(float x, float y, float rX, float rY,
00101 float startAngle, float stopAngle)=0;
00103
00105 virtual void DrawString(float *point, const vtkStdString &string) = 0;
00106
00108
00113 virtual void ComputeStringBounds(const vtkStdString &string,
00114 float bounds[4]) = 0;
00116
00118 virtual void DrawString(float *point, const vtkUnicodeString &string) = 0;
00119
00121
00126 virtual void ComputeStringBounds(const vtkUnicodeString &string,
00127 float bounds[4]) = 0;
00129
00132 virtual void DrawImage(float p[2], float scale, vtkImageData *image) = 0;
00133
00137 virtual void DrawImage(const vtkRectf& pos, vtkImageData *image) = 0;
00138
00143 void ApplyPen(vtkPen *pen);
00144
00146
00149 vtkGetObjectMacro(Pen, vtkPen);
00151
00156 void ApplyBrush(vtkBrush *brush);
00157
00159
00161 vtkGetObjectMacro(Brush, vtkBrush);
00163
00167 void ApplyTextProp(vtkTextProperty *prop);
00168
00170
00171 vtkGetObjectMacro(TextProp, vtkTextProperty);
00173
00175 virtual void SetColor4(unsigned char color[4]) = 0;
00176
00177 enum TextureProperty {
00178 Nearest = 0x01,
00179 Linear = 0x02,
00180 Stretch = 0x04,
00181 Repeat = 0x08
00182 };
00184 virtual void SetTexture(vtkImageData* image, int properties) = 0;
00185
00187 virtual void SetPointSize(float size) = 0;
00188
00190 virtual void SetLineWidth(float width) = 0;
00191
00193 virtual void SetLineType(int type) = 0;
00194
00196 virtual int GetWidth() { return this->Geometry[0]; }
00197
00199 virtual int GetHeight() { return this->Geometry[1]; }
00200
00202 virtual void SetMatrix(vtkMatrix3x3 *m) = 0;
00203
00205 virtual void GetMatrix(vtkMatrix3x3 *m) = 0;
00206
00208 virtual void MultiplyMatrix(vtkMatrix3x3 *m) = 0;
00209
00211 virtual void PushMatrix() = 0;
00212
00214 virtual void PopMatrix() = 0;
00215
00218 virtual void SetClipping(int *x) = 0;
00219
00221 virtual void DisableClipping() = 0;
00222
00224 virtual void Begin(vtkViewport*) { }
00225
00227 virtual void End() { }
00228
00231 virtual bool GetBufferIdMode() const;
00232
00233
00235
00238 virtual void BufferIdModeBegin(vtkAbstractContextBufferId *bufferId);
00239
00240
00241
00242
00243
00244
00245
00246 virtual void BufferIdModeEnd();
00248
00249
00250 protected:
00251 vtkContextDevice2D();
00252 virtual ~vtkContextDevice2D();
00253
00255 int Geometry[2];
00256
00257 vtkAbstractContextBufferId *BufferId;
00258
00259 vtkPen *Pen;
00260 vtkBrush *Brush;
00261 vtkTextProperty *TextProp;
00262
00263 private:
00264 vtkContextDevice2D(const vtkContextDevice2D &);
00265 void operator=(const vtkContextDevice2D &);
00266
00267
00268 };
00269
00270 #endif //__vtkContextDevice2D_h