Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/Imaging/vtkImageCanvasSource2D.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageCanvasSource2D.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00034 #ifndef __vtkImageCanvasSource2D_h
00035 #define __vtkImageCanvasSource2D_h
00036 
00037 #include "vtkStructuredPoints.h"
00038 
00039 //
00040 // Special classes for manipulating data
00041 //
00042 //BTX - begin tcl exclude
00043 //
00044 // For the fill functionality (use connector ??)
00045 class vtkImageCanvasSource2DPixel { //;prevent man page generation
00046 public:
00047   static vtkImageCanvasSource2DPixel *New() 
00048     { return new vtkImageCanvasSource2DPixel ;}
00049   int X;
00050   int Y;
00051   void *Pointer;
00052   vtkImageCanvasSource2DPixel *Next;
00053 };
00054 //ETX - end tcl exclude
00055 //
00056 
00057 
00058 class VTK_IMAGING_EXPORT vtkImageCanvasSource2D : public vtkStructuredPoints
00059 {
00060 public:
00062   static vtkImageCanvasSource2D *New();
00063 
00064   vtkTypeRevisionMacro(vtkImageCanvasSource2D,vtkStructuredPoints);
00065   void PrintSelf(ostream& os, vtkIndent indent);
00066 
00068 
00069   void SetImageData(vtkImageData *image);
00070   vtkGetObjectMacro(ImageData, vtkImageData);
00072   
00074 
00076   vtkSetVector4Macro(DrawColor, float);
00077   vtkGetVector4Macro(DrawColor, float);
00078   void SetDrawColor(float a) {this->SetDrawColor(a, 0.0, 0.0, 0.0);}
00079   void SetDrawColor(float a,float b) {this->SetDrawColor(a, b, 0.0, 0.0);}
00080   void SetDrawColor(float a, float b, float c) {this->SetDrawColor(a, b, c, 0.0);}
00082     
00083   void FillBox(int min0, int max0, int min1, int max1);
00084   void FillTube(int x0, int y0, int x1, int y1, float radius);
00085   void FillTriangle(int x0, int y0, int x1, int y1, int x2, int y2);
00086   void DrawCircle(int c0, int c1, float radius);
00087   void DrawPoint(int p0, int p1);
00088   void DrawSegment(int x0, int y0, int x1, int y1);
00089   void DrawSegment3D(float *p0, float *p1);
00090   void DrawSegment3D(float x1, float y1, float z1, float x2, float y2, float z2) 
00091     { float p1[3], p2[3]; 
00092     p1[0] = x1; p1[1] = y1; p1[2] = z1; p2[0] = x2; p2[1] = y2; p2[2] = z2;
00093     this->DrawSegment3D(p1, p2);}
00094 
00096 
00098   void DrawImage(int x0, int y0, vtkImageData* i)
00099     { this->DrawImage(x0, y0, i, -1, -1, -1, -1); }
00100   void DrawImage(int x0, int y0, vtkImageData*, int sx, int sy,
00101                  int width, int height);
00103 
00107   void FillPixel(int x, int y);
00108 
00111   vtkImageData *GetOutput() {return this;}
00112   
00114 
00117   void SetExtent(int *extent);
00118   void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
00120   
00122 
00125   vtkSetMacro(DefaultZ, int);
00126   vtkGetMacro(DefaultZ, int);
00128 
00130 
00132   vtkSetVector3Macro(Ratio, float);
00133   vtkGetVector3Macro(Ratio, float);
00135 
00136 protected:
00137   vtkImageCanvasSource2D();
00138   // Destructor: Deleting a vtkImageCanvasSource2D automatically deletes the
00139   // associated vtkImageData.  However, since the data is reference counted,
00140   // it may not actually be deleted.
00141   ~vtkImageCanvasSource2D();
00142 
00143   vtkImageData *ImageData;
00144   float DrawColor[4];
00145   int DefaultZ;
00146   float Ratio[3];
00147   
00148   int ClipSegment(int &a0, int &a1, int &b0, int &b1);
00149 private:
00150   vtkImageCanvasSource2D(const vtkImageCanvasSource2D&);  // Not implemented.
00151   void operator=(const vtkImageCanvasSource2D&);  // Not implemented.
00152 };
00153 
00154 
00155 
00156 #endif
00157 
00158