00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00059 #ifndef __vtkImageCanvasSource2D_h
00060 #define __vtkImageCanvasSource2D_h
00061
00062 #include <math.h>
00063 #include "vtkStructuredPoints.h"
00064
00065
00066
00067
00068
00069
00070
00071 class vtkImageCanvasSource2DPixel {
00072 public:
00073 static vtkImageCanvasSource2DPixel *New()
00074 { return new vtkImageCanvasSource2DPixel ;}
00075 int X;
00076 int Y;
00077 void *Pointer;
00078 vtkImageCanvasSource2DPixel *Next;
00079 };
00080
00081
00082
00083
00084 class VTK_IMAGING_EXPORT vtkImageCanvasSource2D : public vtkStructuredPoints
00085 {
00086 public:
00088 static vtkImageCanvasSource2D *New();
00089
00090 vtkTypeMacro(vtkImageCanvasSource2D,vtkStructuredPoints);
00091 void PrintSelf(ostream& os, vtkIndent indent);
00092
00094
00095 void SetImageData(vtkImageData *image);
00096 vtkGetObjectMacro(ImageData, vtkImageData);
00098
00100
00102 vtkSetVector4Macro(DrawColor, float);
00103 vtkGetVector4Macro(DrawColor, float);
00104 void SetDrawColor(float a) {this->SetDrawColor(a, 0.0, 0.0, 0.0);}
00105 void SetDrawColor(float a,float b) {this->SetDrawColor(a, b, 0.0, 0.0);}
00106 void SetDrawColor(float a, float b, float c) {this->SetDrawColor(a, b, c, 0.0);}
00108
00109 void FillBox(int min0, int max0, int min1, int max1);
00110 void FillTube(int x0, int y0, int x1, int y1, float radius);
00111 void FillTriangle(int x0, int y0, int x1, int y1, int x2, int y2);
00112 void DrawCircle(int c0, int c1, float radius);
00113 void DrawPoint(int p0, int p1);
00114 void DrawSegment(int x0, int y0, int x1, int y1);
00115 void DrawSegment3D(float *p0, float *p1);
00116 void DrawSegment3D(float x1, float y1, float z1, float x2, float y2, float z2)
00117 { float p1[3], p2[3];
00118 p1[0] = x1; p1[1] = y1; p1[2] = z1; p2[0] = x2; p2[1] = y2; p2[2] = z2;
00119 this->DrawSegment3D(p1, p2);}
00120
00124 void FillPixel(int x, int y);
00125
00128 vtkImageData *GetOutput() {return this;}
00129
00131
00134 void SetExtent(int *extent);
00135 void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
00137
00139
00142 vtkSetMacro(DefaultZ, int);
00143 vtkGetMacro(DefaultZ, int);
00145
00146 protected:
00147 vtkImageCanvasSource2D();
00148
00149
00150
00151 ~vtkImageCanvasSource2D();
00152
00153 vtkImageData *ImageData;
00154 float DrawColor[4];
00155 int DefaultZ;
00156
00157 int ClipSegment(int &a0, int &a1, int &b0, int &b1);
00158 private:
00159 vtkImageCanvasSource2D(const vtkImageCanvasSource2D&);
00160 void operator=(const vtkImageCanvasSource2D&);
00161 };
00162
00163
00164
00165 #endif
00166
00167