VTK
vtkGlyphSource2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGlyphSource2D.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 =========================================================================*/
35 #ifndef vtkGlyphSource2D_h
36 #define vtkGlyphSource2D_h
37 
38 #include "vtkFiltersSourcesModule.h" // For export macro
39 #include "vtkPolyDataAlgorithm.h"
40 
41 #define VTK_NO_GLYPH 0
42 #define VTK_VERTEX_GLYPH 1
43 #define VTK_DASH_GLYPH 2
44 #define VTK_CROSS_GLYPH 3
45 #define VTK_THICKCROSS_GLYPH 4
46 #define VTK_TRIANGLE_GLYPH 5
47 #define VTK_SQUARE_GLYPH 6
48 #define VTK_CIRCLE_GLYPH 7
49 #define VTK_DIAMOND_GLYPH 8
50 #define VTK_ARROW_GLYPH 9
51 #define VTK_THICKARROW_GLYPH 10
52 #define VTK_HOOKEDARROW_GLYPH 11
53 #define VTK_EDGEARROW_GLYPH 12
54 
55 #define VTK_MAX_CIRCLE_RESOLUTION 1024
56 
57 class vtkPoints;
59 class vtkCellArray;
60 
62 {
63 public:
65  void PrintSelf(ostream& os, vtkIndent indent);
66 
69  static vtkGlyphSource2D *New();
70 
72 
73  vtkSetVector3Macro(Center,double);
74  vtkGetVectorMacro(Center,double,3);
76 
78 
80  vtkSetClampMacro(Scale,double,0.0,VTK_DOUBLE_MAX);
81  vtkGetMacro(Scale,double);
83 
85 
87  vtkSetClampMacro(Scale2,double,0.0,VTK_DOUBLE_MAX);
88  vtkGetMacro(Scale2,double);
90 
92 
96 
98 
101  vtkSetMacro(Filled,int);
102  vtkGetMacro(Filled,int);
103  vtkBooleanMacro(Filled,int);
105 
107 
110  vtkSetMacro(Dash,int);
111  vtkGetMacro(Dash,int);
112  vtkBooleanMacro(Dash,int);
114 
116 
119  vtkSetMacro(Cross,int);
120  vtkGetMacro(Cross,int);
121  vtkBooleanMacro(Cross,int);
123 
125 
128  vtkSetMacro(RotationAngle,double);
129  vtkGetMacro(RotationAngle,double);
131 
133 
135  vtkGetMacro(Resolution,int);
137 
139 
141  vtkGetMacro(GlyphType,int);
142  void SetGlyphTypeToNone() {this->SetGlyphType(VTK_NO_GLYPH);}
143  void SetGlyphTypeToVertex() {this->SetGlyphType(VTK_VERTEX_GLYPH);}
144  void SetGlyphTypeToDash() {this->SetGlyphType(VTK_DASH_GLYPH);}
145  void SetGlyphTypeToCross() {this->SetGlyphType(VTK_CROSS_GLYPH);}
146  void SetGlyphTypeToThickCross() {this->SetGlyphType(VTK_THICKCROSS_GLYPH);}
147  void SetGlyphTypeToTriangle() {this->SetGlyphType(VTK_TRIANGLE_GLYPH);}
148  void SetGlyphTypeToSquare() {this->SetGlyphType(VTK_SQUARE_GLYPH);}
149  void SetGlyphTypeToCircle() {this->SetGlyphType(VTK_CIRCLE_GLYPH);}
150  void SetGlyphTypeToDiamond() {this->SetGlyphType(VTK_DIAMOND_GLYPH);}
151  void SetGlyphTypeToArrow() {this->SetGlyphType(VTK_ARROW_GLYPH);}
152  void SetGlyphTypeToThickArrow() {this->SetGlyphType(VTK_THICKARROW_GLYPH);}
153  void SetGlyphTypeToHookedArrow() {this->SetGlyphType(VTK_HOOKEDARROW_GLYPH);}
154  void SetGlyphTypeToEdgeArrow() {this->SetGlyphType(VTK_EDGEARROW_GLYPH);}
156 
158 
162  vtkSetMacro(OutputPointsPrecision,int);
163  vtkGetMacro(OutputPointsPrecision,int);
165 
166 protected:
169 
171 
172  double Center[3];
173  double Scale;
174  double Scale2;
175  double Color[3];
176  int Filled;
177  int Dash;
178  int Cross;
183 
185  void ConvertColor();
186  unsigned char RGB[3];
187 
189  vtkUnsignedCharArray *colors);
190  void CreateDash(vtkPoints *pts, vtkCellArray *lines,
191  vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale);
192  void CreateCross(vtkPoints *pts, vtkCellArray *lines,
193  vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale);
195  vtkCellArray *polys, vtkUnsignedCharArray *colors);
197  vtkCellArray *polys, vtkUnsignedCharArray *colors);
199  vtkCellArray *polys, vtkUnsignedCharArray *colors);
201  vtkCellArray *polys, vtkUnsignedCharArray *colors);
203  vtkCellArray *polys, vtkUnsignedCharArray *colors);
204  void CreateArrow(vtkPoints *pts, vtkCellArray *lines,
205  vtkCellArray *polys, vtkUnsignedCharArray *colors);
207  vtkCellArray *polys, vtkUnsignedCharArray *colors);
209  vtkCellArray *polys, vtkUnsignedCharArray *colors);
211  vtkCellArray *polys, vtkUnsignedCharArray *colors);
212 
213 private:
214  vtkGlyphSource2D(const vtkGlyphSource2D&); // Not implemented.
215  void operator=(const vtkGlyphSource2D&); // Not implemented.
216 };
217 
218 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
VTK_CROSS_GLYPH
#define VTK_CROSS_GLYPH
Definition: vtkGlyphSource2D.h:44
vtkGlyphSource2D::~vtkGlyphSource2D
~vtkGlyphSource2D()
Definition: vtkGlyphSource2D.h:168
vtkGlyphSource2D
create 2D glyphs represented by vtkPolyData
Definition: vtkGlyphSource2D.h:62
vtkGlyphSource2D::Scale
double Scale
Definition: vtkGlyphSource2D.h:173
vtkGlyphSource2D::SetGlyphTypeToDiamond
void SetGlyphTypeToDiamond()
Definition: vtkGlyphSource2D.h:150
vtkGlyphSource2D::CreateEdgeArrow
void CreateEdgeArrow(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
vtkSetVector3Macro
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:287
VTK_DASH_GLYPH
#define VTK_DASH_GLYPH
Definition: vtkGlyphSource2D.h:43
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
VTK_DIAMOND_GLYPH
#define VTK_DIAMOND_GLYPH
Definition: vtkGlyphSource2D.h:49
vtkgl::scale
GLenum GLenum GLenum GLenum GLenum scale
Definition: vtkgl.h:15942
vtkGlyphSource2D::SetGlyphTypeToThickCross
void SetGlyphTypeToThickCross()
Definition: vtkGlyphSource2D.h:146
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:49
vtkGlyphSource2D::CreateTriangle
void CreateTriangle(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
vtkX3D::Color
@ Color
Definition: vtkX3D.h:46
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkGlyphSource2D::Dash
int Dash
Definition: vtkGlyphSource2D.h:177
vtkGlyphSource2D::SetGlyphTypeToVertex
void SetGlyphTypeToVertex()
Definition: vtkGlyphSource2D.h:143
VTK_CIRCLE_GLYPH
#define VTK_CIRCLE_GLYPH
Definition: vtkGlyphSource2D.h:48
vtkFiltersSourcesModule.h
vtkGlyphSource2D::TransformGlyph
void TransformGlyph(vtkPoints *pts)
vtkGetVectorMacro
#define vtkGetVectorMacro(name, type, count)
Definition: vtkSetGet.h:424
vtkGlyphSource2D::Cross
int Cross
Definition: vtkGlyphSource2D.h:178
vtkGlyphSource2D::CreateDash
void CreateDash(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale)
vtkPolyDataAlgorithm.h
VTK_TRIANGLE_GLYPH
#define VTK_TRIANGLE_GLYPH
Definition: vtkGlyphSource2D.h:46
VTK_THICKARROW_GLYPH
#define VTK_THICKARROW_GLYPH
Definition: vtkGlyphSource2D.h:51
vtkGlyphSource2D::CreateCross
void CreateCross(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale)
vtkGlyphSource2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
VTKFILTERSSOURCES_EXPORT
#define VTKFILTERSSOURCES_EXPORT
Definition: vtkFiltersSourcesModule.h:15
vtkGlyphSource2D::SetGlyphTypeToTriangle
void SetGlyphTypeToTriangle()
Definition: vtkGlyphSource2D.h:147
vtkGlyphSource2D::SetGlyphTypeToNone
void SetGlyphTypeToNone()
Definition: vtkGlyphSource2D.h:142
vtkGlyphSource2D::SetGlyphTypeToThickArrow
void SetGlyphTypeToThickArrow()
Definition: vtkGlyphSource2D.h:152
vtkGlyphSource2D::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkGlyphSource2D.h:182
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkGlyphSource2D::CreateThickArrow
void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
VTK_EDGEARROW_GLYPH
#define VTK_EDGEARROW_GLYPH
Definition: vtkGlyphSource2D.h:53
vtkGlyphSource2D::Scale2
double Scale2
Definition: vtkGlyphSource2D.h:174
vtkGlyphSource2D::SetGlyphTypeToSquare
void SetGlyphTypeToSquare()
Definition: vtkGlyphSource2D.h:148
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGlyphSource2D::SetGlyphTypeToCross
void SetGlyphTypeToCross()
Definition: vtkGlyphSource2D.h:145
vtkGlyphSource2D::SetGlyphTypeToArrow
void SetGlyphTypeToArrow()
Definition: vtkGlyphSource2D.h:151
vtkGlyphSource2D::Filled
int Filled
Definition: vtkGlyphSource2D.h:176
vtkGlyphSource2D::New
static vtkGlyphSource2D * New()
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
VTK_THICKCROSS_GLYPH
#define VTK_THICKCROSS_GLYPH
Definition: vtkGlyphSource2D.h:45
VTK_SQUARE_GLYPH
#define VTK_SQUARE_GLYPH
Definition: vtkGlyphSource2D.h:47
vtkGlyphSource2D::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
VTK_HOOKEDARROW_GLYPH
#define VTK_HOOKEDARROW_GLYPH
Definition: vtkGlyphSource2D.h:52
vtkGlyphSource2D::Resolution
int Resolution
Definition: vtkGlyphSource2D.h:181
vtkGlyphSource2D::SetGlyphTypeToHookedArrow
void SetGlyphTypeToHookedArrow()
Definition: vtkGlyphSource2D.h:153
vtkGlyphSource2D::SetGlyphTypeToEdgeArrow
void SetGlyphTypeToEdgeArrow()
Definition: vtkGlyphSource2D.h:154
vtkGlyphSource2D::SetGlyphTypeToCircle
void SetGlyphTypeToCircle()
Definition: vtkGlyphSource2D.h:149
VTK_VERTEX_GLYPH
#define VTK_VERTEX_GLYPH
Definition: vtkGlyphSource2D.h:42
vtkGlyphSource2D::RotationAngle
double RotationAngle
Definition: vtkGlyphSource2D.h:180
vtkGlyphSource2D::CreateThickCross
void CreateThickCross(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
vtkGlyphSource2D::SetGlyphTypeToDash
void SetGlyphTypeToDash()
Definition: vtkGlyphSource2D.h:144
vtkGlyphSource2D::CreateHookedArrow
void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
vtkGlyphSource2D::CreateArrow
void CreateArrow(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
vtkGlyphSource2D::vtkGlyphSource2D
vtkGlyphSource2D()
VTK_ARROW_GLYPH
#define VTK_ARROW_GLYPH
Definition: vtkGlyphSource2D.h:50
vtkGlyphSource2D::CreateDiamond
void CreateDiamond(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
vtkGlyphSource2D::ConvertColor
void ConvertColor()
VTK_MAX_CIRCLE_RESOLUTION
#define VTK_MAX_CIRCLE_RESOLUTION
Definition: vtkGlyphSource2D.h:55
vtkGlyphSource2D::CreateSquare
void CreateSquare(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:142
vtkGlyphSource2D::GlyphType
int GlyphType
Definition: vtkGlyphSource2D.h:179
VTK_NO_GLYPH
#define VTK_NO_GLYPH
Definition: vtkGlyphSource2D.h:41
vtkGlyphSource2D::CreateCircle
void CreateCircle(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
vtkGlyphSource2D::CreateVertex
void CreateVertex(vtkPoints *pts, vtkCellArray *verts, vtkUnsignedCharArray *colors)
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44