00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00026 #ifndef __vtkImageCanvasSource2D_h
00027 #define __vtkImageCanvasSource2D_h
00028
00029 #include "vtkImageAlgorithm.h"
00030
00031 class VTK_IMAGING_EXPORT vtkImageCanvasSource2D : public vtkImageAlgorithm
00032 {
00033 public:
00035 static vtkImageCanvasSource2D *New();
00036
00037 vtkTypeRevisionMacro(vtkImageCanvasSource2D,vtkImageAlgorithm);
00038 void PrintSelf(ostream& os, vtkIndent indent);
00039
00041
00043 vtkSetVector4Macro(DrawColor, double);
00044 vtkGetVector4Macro(DrawColor, double);
00046
00048 void SetDrawColor(double a) {this->SetDrawColor(a, 0.0, 0.0, 0.0);}
00049
00051 void SetDrawColor(double a,double b) {this->SetDrawColor(a, b, 0.0, 0.0);}
00052
00054
00055 void SetDrawColor(double a, double b, double c) {
00056 this->SetDrawColor(a, b, c, 0.0);}
00058
00060
00062 void FillBox(int min0, int max0, int min1, int max1);
00063 void FillTube(int x0, int y0, int x1, int y1, double radius);
00064 void FillTriangle(int x0, int y0, int x1, int y1, int x2, int y2);
00065 void DrawCircle(int c0, int c1, double radius);
00066 void DrawPoint(int p0, int p1);
00067 void DrawSegment(int x0, int y0, int x1, int y1);
00068 void DrawSegment3D(double *p0, double *p1);
00069 void DrawSegment3D(double x1, double y1, double z1,
00070 double x2, double y2, double z2)
00071 { double p1[3], p2[3];
00072 p1[0] = x1; p1[1] = y1; p1[2] = z1; p2[0] = x2; p2[1] = y2; p2[2] = z2;
00073 this->DrawSegment3D(p1, p2);}
00075
00077
00079 void DrawImage(int x0, int y0, vtkImageData* i)
00080 { this->DrawImage(x0, y0, i, -1, -1, -1, -1); }
00081 void DrawImage(int x0, int y0, vtkImageData*, int sx, int sy,
00082 int width, int height);
00084
00088 void FillPixel(int x, int y);
00089
00091
00094 void SetExtent(int *extent);
00095 void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
00097
00099
00102 vtkSetMacro(DefaultZ, int);
00103 vtkGetMacro(DefaultZ, int);
00105
00107
00110 vtkSetVector3Macro(Ratio, double);
00111 vtkGetVector3Macro(Ratio, double);
00113
00115
00116 virtual void SetNumberOfScalarComponents(int i);
00117 virtual int GetNumberOfScalarComponents() const;
00119
00121
00126 void SetScalarTypeToFloat(){this->SetScalarType(VTK_FLOAT);};
00127 void SetScalarTypeToDouble(){this->SetScalarType(VTK_DOUBLE);};
00128 void SetScalarTypeToInt(){this->SetScalarType(VTK_INT);};
00129 void SetScalarTypeToUnsignedInt()
00130 {this->SetScalarType(VTK_UNSIGNED_INT);};
00131 void SetScalarTypeToLong(){this->SetScalarType(VTK_LONG);};
00132 void SetScalarTypeToUnsignedLong()
00133 {this->SetScalarType(VTK_UNSIGNED_LONG);};
00134 void SetScalarTypeToShort(){this->SetScalarType(VTK_SHORT);};
00135 void SetScalarTypeToUnsignedShort()
00136 {this->SetScalarType(VTK_UNSIGNED_SHORT);};
00137 void SetScalarTypeToUnsignedChar()
00138 {this->SetScalarType(VTK_UNSIGNED_CHAR);};
00139 void SetScalarTypeToChar()
00140 {this->SetScalarType(VTK_CHAR);};
00141 void SetScalarType(int);
00142 int GetScalarType() const;
00144
00145 protected:
00146 vtkImageCanvasSource2D();
00147
00148
00149
00150 ~vtkImageCanvasSource2D();
00151
00152 vtkImageData *ImageData;
00153 int WholeExtent[6];
00154 double DrawColor[4];
00155 int DefaultZ;
00156 double Ratio[3];
00157
00158 int ClipSegment(int &a0, int &a1, int &b0, int &b1);
00159
00160 virtual int RequestInformation (vtkInformation *,
00161 vtkInformationVector**,
00162 vtkInformationVector *);
00163 virtual int RequestData (vtkInformation *,
00164 vtkInformationVector**,
00165 vtkInformationVector *);
00166
00167 private:
00168 vtkImageCanvasSource2D(const vtkImageCanvasSource2D&);
00169 void operator=(const vtkImageCanvasSource2D&);
00170 };
00171
00172
00173
00174 #endif
00175
00176