VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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:
39  static vtkImageCanvasSource2D *New();
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 
64 
66  void FillBox(int min0, int max0, int min1, int max1);
67  void FillTube(int x0, int y0, int x1, int y1, double radius);
68  void FillTriangle(int x0, int y0, int x1, int y1, int x2, int y2);
69  void DrawCircle(int c0, int c1, double radius);
70  void DrawPoint(int p0, int p1);
71  void DrawSegment(int x0, int y0, int x1, int y1);
72  void DrawSegment3D(double *p0, double *p1);
73  void DrawSegment3D(double x1, double y1, double z1,
74  double x2, double y2, double z2)
75  { double p1[3], p2[3];
76  p1[0] = x1; p1[1] = y1; p1[2] = z1; p2[0] = x2; p2[1] = y2; p2[2] = z2;
77  this->DrawSegment3D(p1, p2);}
79 
81 
83  void DrawImage(int x0, int y0, vtkImageData* i)
84  { this->DrawImage(x0, y0, i, -1, -1, -1, -1); }
85  void DrawImage(int x0, int y0, vtkImageData*, int sx, int sy,
86  int width, int height);
88 
92  void FillPixel(int x, int y);
93 
95 
98  void SetExtent(int *extent);
99  void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
101 
103 
106  vtkSetMacro(DefaultZ, int);
107  vtkGetMacro(DefaultZ, int);
109 
111 
114  vtkSetVector3Macro(Ratio, double);
115  vtkGetVector3Macro(Ratio, double);
117 
119 
120  virtual void SetNumberOfScalarComponents(int i);
121  virtual int GetNumberOfScalarComponents() const;
123 
125 
130  void SetScalarTypeToFloat(){this->SetScalarType(VTK_FLOAT);};
131  void SetScalarTypeToDouble(){this->SetScalarType(VTK_DOUBLE);};
132  void SetScalarTypeToInt(){this->SetScalarType(VTK_INT);};
134  {this->SetScalarType(VTK_UNSIGNED_INT);};
135  void SetScalarTypeToLong(){this->SetScalarType(VTK_LONG);};
137  {this->SetScalarType(VTK_UNSIGNED_LONG);};
138  void SetScalarTypeToShort(){this->SetScalarType(VTK_SHORT);};
140  {this->SetScalarType(VTK_UNSIGNED_SHORT);};
142  {this->SetScalarType(VTK_UNSIGNED_CHAR);};
144  {this->SetScalarType(VTK_CHAR);};
145  void SetScalarType(int);
146  int GetScalarType() const;
148 
149 protected:
151  // Destructor: Deleting a vtkImageCanvasSource2D automatically deletes the
152  // associated vtkImageData. However, since the data is reference counted,
153  // it may not actually be deleted.
155 
157  int WholeExtent[6];
158  double DrawColor[4];
159  int DefaultZ;
160  double Ratio[3];
161 
162  int ClipSegment(int &a0, int &a1, int &b0, int &b1);
163 
164  virtual int RequestInformation (vtkInformation *,
167  virtual int RequestData (vtkInformation *,
170 
171 private:
172  vtkImageCanvasSource2D(const vtkImageCanvasSource2D&); // Not implemented.
173  void operator=(const vtkImageCanvasSource2D&); // Not implemented.
174 };
175 
176 
177 
178 #endif
179 
180 
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
#define VTK_UNSIGNED_INT
Definition: vtkType.h:32
Store vtkAlgorithm input/output information.
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:30
void DrawImage(int x0, int y0, vtkImageData *i)
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
GLint GLint GLsizei GLsizei height
Definition: vtkgl.h:11316
#define VTK_DOUBLE
Definition: vtkType.h:36
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
#define VTK_FLOAT
Definition: vtkType.h:35
#define vtkSetVector4Macro(name, type)
Definition: vtkSetGet.h:312
a simple class to control print indentation
Definition: vtkIndent.h:38
const GLubyte * c
Definition: vtkgl.h:15720
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
GLint GLint GLsizei width
Definition: vtkgl.h:11316
#define VTK_SHORT
Definition: vtkType.h:29
#define VTK_CHAR
Definition: vtkType.h:26
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:294
#define VTK_LONG
Definition: vtkType.h:33
#define vtkGetVector4Macro(name, type)
Definition: vtkSetGet.h:331
void SetDrawColor(double a, double b, double c)
#define VTKIMAGINGSOURCES_EXPORT
GLboolean GLboolean GLboolean GLboolean a
Definition: vtkgl.h:12312
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:28
Generic algorithm superclass for image algs.
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent)
static vtkAlgorithm * New()
void DrawSegment3D(double x1, double y1, double z1, double x2, double y2, double z2)
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:34
void SetDrawColor(double a, double b)
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:277
#define VTK_INT
Definition: vtkType.h:31
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69