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
00055 #ifndef __vtkImageCanvasSource2D_h
00056 #define __vtkImageCanvasSource2D_h
00057
00058 #include <math.h>
00059 #include "vtkStructuredPoints.h"
00060
00061
00062
00063
00064
00065
00066
00067 class vtkImageCanvasSource2DPixel {
00068 public:
00069 static vtkImageCanvasSource2DPixel *New()
00070 { return new vtkImageCanvasSource2DPixel ;}
00071 int X;
00072 int Y;
00073 void *Pointer;
00074 vtkImageCanvasSource2DPixel *Next;
00075 };
00076
00077
00078
00079
00080 class VTK_EXPORT vtkImageCanvasSource2D : public vtkStructuredPoints
00081 {
00082 public:
00084 static vtkImageCanvasSource2D *New();
00085
00086 vtkTypeMacro(vtkImageCanvasSource2D,vtkStructuredPoints);
00087 void PrintSelf(ostream& os, vtkIndent indent);
00088
00090 void SetImageData(vtkImageData *image);
00091 vtkGetObjectMacro(ImageData, vtkImageData);
00092
00095 void SetDrawColor(int dim, float *color);
00096 void GetDrawColor(int dim, float *color);
00097 vtkSetVector4Macro(DrawColor, float);
00098 vtkGetVector4Macro(DrawColor, float);
00099 void SetDrawColor(float a) {this->SetDrawColor(a, 0.0, 0.0, 0.0);}
00100 void SetDrawColor(float a,float b) {this->SetDrawColor(a, b, 0.0, 0.0);}
00101 void SetDrawColor(float a, float b, float c) {this->SetDrawColor(a, b, c, 0.0);}
00102
00103 void FillBox(int min0, int max0, int min1, int max1);
00104 void FillTube(int x0, int y0, int x1, int y1, float radius);
00105 void FillTriangle(int x0, int y0, int x1, int y1, int x2, int y2);
00106 void DrawCircle(int c0, int c1, float radius);
00107 void DrawPoint(int p0, int p1);
00108 void DrawSegment(int x0, int y0, int x1, int y1);
00109 void DrawSegment3D(float *p0, float *p1);
00110 void DrawSegment3D(float x1, float y1, float z1, float x2, float y2, float z2)
00111 { float p1[3], p2[3];
00112 p1[0] = x1; p1[1] = y1; p1[2] = z1; p2[0] = x2; p2[1] = y2; p2[2] = z2;
00113 this->DrawSegment3D(p1, p2);}
00114
00117 void FillPixel(int x, int y);
00118
00121 vtkImageData *GetOutput() {return this;}
00122
00124 void SetExtent(int *extent);
00125 void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
00126
00129 vtkSetMacro(DefaultZ, int);
00130 vtkGetMacro(DefaultZ, int);
00131
00132 protected:
00133 vtkImageCanvasSource2D();
00134
00135
00136
00137 ~vtkImageCanvasSource2D();
00138 vtkImageCanvasSource2D(const vtkImageCanvasSource2D&) {};
00139 void operator=(const vtkImageCanvasSource2D&) {};
00140
00141 vtkImageData *ImageData;
00142 float DrawColor[4];
00143 int DefaultZ;
00144
00145 int ClipSegment(int &a0, int &a1, int &b0, int &b1);
00146 };
00147
00148
00149
00150 #endif
00151
00152