00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00044 #ifndef __vtkImageCanvasSource2D_h
00045 #define __vtkImageCanvasSource2D_h
00046
00047 #include "vtkStructuredPoints.h"
00048
00049
00050
00051
00052
00053
00054
00055 class vtkImageCanvasSource2DPixel {
00056 public:
00057 static vtkImageCanvasSource2DPixel *New()
00058 { return new vtkImageCanvasSource2DPixel ;}
00059 int X;
00060 int Y;
00061 void *Pointer;
00062 vtkImageCanvasSource2DPixel *Next;
00063 };
00064
00065
00066
00067
00068 class VTK_IMAGING_EXPORT vtkImageCanvasSource2D : public vtkStructuredPoints
00069 {
00070 public:
00072 static vtkImageCanvasSource2D *New();
00073
00074 vtkTypeRevisionMacro(vtkImageCanvasSource2D,vtkStructuredPoints);
00075 void PrintSelf(ostream& os, vtkIndent indent);
00076
00078
00079 void SetImageData(vtkImageData *image);
00080 vtkGetObjectMacro(ImageData, vtkImageData);
00082
00084
00086 vtkSetVector4Macro(DrawColor, double);
00087 vtkGetVector4Macro(DrawColor, double);
00088 void SetDrawColor(double a) {this->SetDrawColor(a, 0.0, 0.0, 0.0);}
00089 void SetDrawColor(double a,double b) {this->SetDrawColor(a, b, 0.0, 0.0);}
00090 void SetDrawColor(double a, double b, double c) {
00091 this->SetDrawColor(a, b, c, 0.0);}
00093
00094 void FillBox(int min0, int max0, int min1, int max1);
00095 void FillTube(int x0, int y0, int x1, int y1, double radius);
00096 void FillTriangle(int x0, int y0, int x1, int y1, int x2, int y2);
00097 void DrawCircle(int c0, int c1, double radius);
00098 void DrawPoint(int p0, int p1);
00099 void DrawSegment(int x0, int y0, int x1, int y1);
00100 void DrawSegment3D(double *p0, double *p1);
00101 void DrawSegment3D(double x1, double y1, double z1,
00102 double x2, double y2, double z2)
00103 { double p1[3], p2[3];
00104 p1[0] = x1; p1[1] = y1; p1[2] = z1; p2[0] = x2; p2[1] = y2; p2[2] = z2;
00105 this->DrawSegment3D(p1, p2);}
00106
00108
00110 void DrawImage(int x0, int y0, vtkImageData* i)
00111 { this->DrawImage(x0, y0, i, -1, -1, -1, -1); }
00112 void DrawImage(int x0, int y0, vtkImageData*, int sx, int sy,
00113 int width, int height);
00115
00119 void FillPixel(int x, int y);
00120
00123 vtkImageData *GetOutput() {return this;}
00124
00126
00129 void SetExtent(int *extent);
00130 void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
00132
00134
00137 vtkSetMacro(DefaultZ, int);
00138 vtkGetMacro(DefaultZ, int);
00140
00142
00144 vtkSetVector3Macro(Ratio, double);
00145 vtkGetVector3Macro(Ratio, double);
00147
00148 protected:
00149 vtkImageCanvasSource2D();
00150
00151
00152
00153 ~vtkImageCanvasSource2D();
00154
00155 vtkImageData *ImageData;
00156 double DrawColor[4];
00157 int DefaultZ;
00158 double Ratio[3];
00159
00160 int ClipSegment(int &a0, int &a1, int &b0, int &b1);
00161 private:
00162 vtkImageCanvasSource2D(const vtkImageCanvasSource2D&);
00163 void operator=(const vtkImageCanvasSource2D&);
00164 };
00165
00166
00167
00168 #endif
00169
00170