VTK
vtkImageCanvasSource2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageCanvasSource2D.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
29 #ifndef vtkImageCanvasSource2D_h
30 #define vtkImageCanvasSource2D_h
31 
32 #include "vtkImagingSourcesModule.h" // For export macro
33 #include "vtkImageAlgorithm.h"
34 
36 {
37 public:
40 
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
45 
47  vtkSetVector4Macro(DrawColor, double);
48  vtkGetVector4Macro(DrawColor, double);
50 
52  void SetDrawColor(double a) {this->SetDrawColor(a, 0.0, 0.0, 0.0);}
53 
55  void SetDrawColor(double a,double b) {this->SetDrawColor(a, b, 0.0, 0.0);}
56 
58 
59  void SetDrawColor(double a, double b, double c) {
60  this->SetDrawColor(a, b, c, 0.0);}
62 
65 
67 
69  void FillBox(int min0, int max0, int min1, int max1);
70  void FillTube(int x0, int y0, int x1, int y1, double radius);
71  void FillTriangle(int x0, int y0, int x1, int y1, int x2, int y2);
72  void DrawCircle(int c0, int c1, double radius);
73  void DrawPoint(int p0, int p1);
74  void DrawSegment(int x0, int y0, int x1, int y1);
75  void DrawSegment3D(double *p0, double *p1);
76  void DrawSegment3D(double x1, double y1, double z1,
77  double x2, double y2, double z2)
78  { double p1[3], p2[3];
79  p1[0] = x1; p1[1] = y1; p1[2] = z1; p2[0] = x2; p2[1] = y2; p2[2] = z2;
80  this->DrawSegment3D(p1, p2);}
82 
84 
86  void DrawImage(int x0, int y0, vtkImageData* i)
87  { this->DrawImage(x0, y0, i, -1, -1, -1, -1); }
88  void DrawImage(int x0, int y0, vtkImageData*, int sx, int sy,
89  int width, int height);
91 
95  void FillPixel(int x, int y);
96 
98 
101  void SetExtent(int *extent);
102  void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
104 
106 
109  vtkSetMacro(DefaultZ, int);
110  vtkGetMacro(DefaultZ, int);
112 
114 
117  vtkSetVector3Macro(Ratio, double);
118  vtkGetVector3Macro(Ratio, double);
120 
122 
123  virtual void SetNumberOfScalarComponents(int i);
124  virtual int GetNumberOfScalarComponents() const;
126 
128 
133  void SetScalarTypeToFloat(){this->SetScalarType(VTK_FLOAT);};
134  void SetScalarTypeToDouble(){this->SetScalarType(VTK_DOUBLE);};
135  void SetScalarTypeToInt(){this->SetScalarType(VTK_INT);};
137  {this->SetScalarType(VTK_UNSIGNED_INT);};
138  void SetScalarTypeToLong(){this->SetScalarType(VTK_LONG);};
140  {this->SetScalarType(VTK_UNSIGNED_LONG);};
141  void SetScalarTypeToShort(){this->SetScalarType(VTK_SHORT);};
143  {this->SetScalarType(VTK_UNSIGNED_SHORT);};
145  {this->SetScalarType(VTK_UNSIGNED_CHAR);};
147  {this->SetScalarType(VTK_CHAR);};
148  void SetScalarType(int);
149  int GetScalarType() const;
151 
152 protected:
154  // Destructor: Deleting a vtkImageCanvasSource2D automatically deletes the
155  // associated vtkImageData. However, since the data is reference counted,
156  // it may not actually be deleted.
158 
160  int WholeExtent[6];
161  double DrawColor[4];
162  int DefaultZ;
163  double Ratio[3];
164 
165  int ClipSegment(int &a0, int &a1, int &b0, int &b1);
166 
170  virtual int RequestData (vtkInformation *,
173 
174 private:
175  vtkImageCanvasSource2D(const vtkImageCanvasSource2D&); // Not implemented.
176  void operator=(const vtkImageCanvasSource2D&); // Not implemented.
177 };
178 
179 
180 
181 #endif
182 
183 
vtkImageCanvasSource2D::SetDrawColor
void SetDrawColor(double a, double b, double c)
Definition: vtkImageCanvasSource2D.h:59
vtkImageCanvasSource2D::ClipSegment
int ClipSegment(int &a0, int &a1, int &b0, int &b1)
vtkgl::b
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
vtkImageCanvasSource2D::DrawImage
void DrawImage(int x0, int y0, vtkImageData *, int sx, int sy, int width, int height)
vtkImageCanvasSource2D::SetDrawColor
void SetDrawColor(double a)
Definition: vtkImageCanvasSource2D.h:52
vtkImageCanvasSource2D::SetExtent
void SetExtent(int *extent)
vtkImageCanvasSource2D::SetScalarType
void SetScalarType(int)
vtkSetVector3Macro
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:287
vtkImageCanvasSource2D::SetExtent
void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2)
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:32
vtkImageCanvasSource2D::SetScalarTypeToUnsignedChar
void SetScalarTypeToUnsignedChar()
Definition: vtkImageCanvasSource2D.h:144
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:30
vtkImageCanvasSource2D::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkImageCanvasSource2D::SetScalarTypeToLong
void SetScalarTypeToLong()
Definition: vtkImageCanvasSource2D.h:138
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkImageCanvasSource2D::SetScalarTypeToUnsignedLong
void SetScalarTypeToUnsignedLong()
Definition: vtkImageCanvasSource2D.h:139
vtkImageAlgorithm.h
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkImageCanvasSource2D::GetNumberOfScalarComponents
virtual int GetNumberOfScalarComponents() const
vtkImageCanvasSource2D::DrawSegment3D
void DrawSegment3D(double x1, double y1, double z1, double x2, double y2, double z2)
Definition: vtkImageCanvasSource2D.h:76
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:40
vtkImageCanvasSource2D::InitializeCanvasVolume
void InitializeCanvasVolume(vtkImageData *volume)
vtkImageCanvasSource2D::SetNumberOfScalarComponents
virtual void SetNumberOfScalarComponents(int i)
vtkImageCanvasSource2D::SetScalarTypeToFloat
void SetScalarTypeToFloat()
Definition: vtkImageCanvasSource2D.h:133
vtkImageCanvasSource2D::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkImageCanvasSource2D::ImageData
vtkImageData * ImageData
Definition: vtkImageCanvasSource2D.h:159
vtkImageCanvasSource2D::FillPixel
void FillPixel(int x, int y)
vtkImageCanvasSource2D::~vtkImageCanvasSource2D
~vtkImageCanvasSource2D()
vtkImageCanvasSource2D::GetScalarType
int GetScalarType() const
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
vtkImageCanvasSource2D::DefaultZ
int DefaultZ
Definition: vtkImageCanvasSource2D.h:162
vtkgl::c
const GLubyte * c
Definition: vtkgl.h:15720
vtkImageCanvasSource2D::SetDrawColor
void SetDrawColor(double a, double b)
Definition: vtkImageCanvasSource2D.h:55
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:26
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
VTKIMAGINGSOURCES_EXPORT
#define VTKIMAGINGSOURCES_EXPORT
Definition: vtkImagingSourcesModule.h:15
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:35
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:36
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:28
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:33
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkImageCanvasSource2D::SetScalarTypeToUnsignedInt
void SetScalarTypeToUnsignedInt()
Definition: vtkImageCanvasSource2D.h:136
vtkImageCanvasSource2D::vtkImageCanvasSource2D
vtkImageCanvasSource2D()
vtkImageCanvasSource2D::SetScalarTypeToChar
void SetScalarTypeToChar()
Definition: vtkImageCanvasSource2D.h:146
vtkImageCanvasSource2D::FillBox
void FillBox(int min0, int max0, int min1, int max1)
vtkImageCanvasSource2D::DrawPoint
void DrawPoint(int p0, int p1)
vtkgl::a
GLboolean GLboolean GLboolean GLboolean a
Definition: vtkgl.h:12312
vtkImageCanvasSource2D
Paints on a canvas.
Definition: vtkImageCanvasSource2D.h:36
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:34
vtkgl::width
GLint GLint GLsizei width
Definition: vtkgl.h:11316
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkImageCanvasSource2D::SetScalarTypeToInt
void SetScalarTypeToInt()
Definition: vtkImageCanvasSource2D.h:135
vtkSetVector4Macro
#define vtkSetVector4Macro(name, type)
Definition: vtkSetGet.h:322
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:29
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkImageCanvasSource2D::DrawImage
void DrawImage(int x0, int y0, vtkImageData *i)
Definition: vtkImageCanvasSource2D.h:86
vtkImageCanvasSource2D::SetScalarTypeToDouble
void SetScalarTypeToDouble()
Definition: vtkImageCanvasSource2D.h:134
vtkImageCanvasSource2D::SetScalarTypeToUnsignedShort
void SetScalarTypeToUnsignedShort()
Definition: vtkImageCanvasSource2D.h:142
vtkImageCanvasSource2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkImageCanvasSource2D::SetScalarTypeToShort
void SetScalarTypeToShort()
Definition: vtkImageCanvasSource2D.h:141
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
VTK_INT
#define VTK_INT
Definition: vtkType.h:31
vtkImageCanvasSource2D::DrawCircle
void DrawCircle(int c0, int c1, double radius)
vtkImageCanvasSource2D::New
static vtkImageCanvasSource2D * New()
vtkX3D::radius
@ radius
Definition: vtkX3D.h:252
vtkGetVector4Macro
#define vtkGetVector4Macro(name, type)
Definition: vtkSetGet.h:341
vtkImagingSourcesModule.h
vtkImageCanvasSource2D::FillTriangle
void FillTriangle(int x0, int y0, int x1, int y1, int x2, int y2)
vtkImageCanvasSource2D::DrawSegment
void DrawSegment(int x0, int y0, int x1, int y1)
vtkImageCanvasSource2D::DrawSegment3D
void DrawSegment3D(double *p0, double *p1)
vtkImageCanvasSource2D::FillTube
void FillTube(int x0, int y0, int x1, int y1, double radius)
vtkgl::height
GLint GLint GLsizei GLsizei height
Definition: vtkgl.h:11316