00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00029 #ifndef __vtkImageCanvasSource2D_h
00030 #define __vtkImageCanvasSource2D_h
00031
00032 #include "vtkImageAlgorithm.h"
00033
00034 class VTK_IMAGING_EXPORT vtkImageCanvasSource2D : public vtkImageAlgorithm
00035 {
00036 public:
00038 static vtkImageCanvasSource2D *New();
00039
00040 vtkTypeRevisionMacro(vtkImageCanvasSource2D,vtkImageAlgorithm);
00041 void PrintSelf(ostream& os, vtkIndent indent);
00042
00044
00046 vtkSetVector4Macro(DrawColor, double);
00047 vtkGetVector4Macro(DrawColor, double);
00048 void SetDrawColor(double a) {this->SetDrawColor(a, 0.0, 0.0, 0.0);}
00049 void SetDrawColor(double a,double b) {this->SetDrawColor(a, b, 0.0, 0.0);}
00050 void SetDrawColor(double a, double b, double c) {
00051 this->SetDrawColor(a, b, c, 0.0);}
00053
00054 void FillBox(int min0, int max0, int min1, int max1);
00055 void FillTube(int x0, int y0, int x1, int y1, double radius);
00056 void FillTriangle(int x0, int y0, int x1, int y1, int x2, int y2);
00057 void DrawCircle(int c0, int c1, double radius);
00058 void DrawPoint(int p0, int p1);
00059 void DrawSegment(int x0, int y0, int x1, int y1);
00060 void DrawSegment3D(double *p0, double *p1);
00061 void DrawSegment3D(double x1, double y1, double z1,
00062 double x2, double y2, double z2)
00063 { double p1[3], p2[3];
00064 p1[0] = x1; p1[1] = y1; p1[2] = z1; p2[0] = x2; p2[1] = y2; p2[2] = z2;
00065 this->DrawSegment3D(p1, p2);}
00066
00068
00070 void DrawImage(int x0, int y0, vtkImageData* i)
00071 { this->DrawImage(x0, y0, i, -1, -1, -1, -1); }
00072 void DrawImage(int x0, int y0, vtkImageData*, int sx, int sy,
00073 int width, int height);
00075
00079 void FillPixel(int x, int y);
00080
00082
00085 void SetExtent(int *extent);
00086 void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
00088
00090
00093 vtkSetMacro(DefaultZ, int);
00094 vtkGetMacro(DefaultZ, int);
00096
00098
00100 vtkSetVector3Macro(Ratio, double);
00101 vtkGetVector3Macro(Ratio, double);
00103
00105 virtual void SetNumberOfScalarComponents(int i);
00106
00108
00113 void SetScalarTypeToFloat(){this->SetScalarType(VTK_FLOAT);};
00114 void SetScalarTypeToDouble(){this->SetScalarType(VTK_DOUBLE);};
00115 void SetScalarTypeToInt(){this->SetScalarType(VTK_INT);};
00116 void SetScalarTypeToUnsignedInt()
00117 {this->SetScalarType(VTK_UNSIGNED_INT);};
00118 void SetScalarTypeToLong(){this->SetScalarType(VTK_LONG);};
00119 void SetScalarTypeToUnsignedLong()
00120 {this->SetScalarType(VTK_UNSIGNED_LONG);};
00121 void SetScalarTypeToShort(){this->SetScalarType(VTK_SHORT);};
00122 void SetScalarTypeToUnsignedShort()
00123 {this->SetScalarType(VTK_UNSIGNED_SHORT);};
00124 void SetScalarTypeToUnsignedChar()
00125 {this->SetScalarType(VTK_UNSIGNED_CHAR);};
00126 void SetScalarTypeToChar()
00127 {this->SetScalarType(VTK_CHAR);};
00128 void SetScalarType(int);
00130
00131 protected:
00132 vtkImageCanvasSource2D();
00133
00134
00135
00136 ~vtkImageCanvasSource2D();
00137
00138 vtkImageData *ImageData;
00139 int WholeExtent[6];
00140 double DrawColor[4];
00141 int DefaultZ;
00142 double Ratio[3];
00143
00144 int ClipSegment(int &a0, int &a1, int &b0, int &b1);
00145
00146 virtual int RequestInformation (vtkInformation *,
00147 vtkInformationVector**,
00148 vtkInformationVector *);
00149 virtual int RequestData (vtkInformation *,
00150 vtkInformationVector**,
00151 vtkInformationVector *);
00152
00153 private:
00154 vtkImageCanvasSource2D(const vtkImageCanvasSource2D&);
00155 void operator=(const vtkImageCanvasSource2D&);
00156 };
00157
00158
00159
00160 #endif
00161
00162