VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 class vtkPoints;
56 class vtkUnsignedCharArray;
57 class vtkCellArray;
58 
59 class VTKFILTERSSOURCES_EXPORT vtkGlyphSource2D : public vtkPolyDataAlgorithm
60 {
61 public:
62  vtkTypeMacro(vtkGlyphSource2D,vtkPolyDataAlgorithm);
63  void PrintSelf(ostream& os, vtkIndent indent);
64 
67  static vtkGlyphSource2D *New();
68 
70 
71  vtkSetVector3Macro(Center,double);
72  vtkGetVectorMacro(Center,double,3);
74 
76 
78  vtkSetClampMacro(Scale,double,0.0,VTK_DOUBLE_MAX);
79  vtkGetMacro(Scale,double);
81 
83 
85  vtkSetClampMacro(Scale2,double,0.0,VTK_DOUBLE_MAX);
86  vtkGetMacro(Scale2,double);
88 
90 
91  vtkSetVector3Macro(Color,double);
92  vtkGetVectorMacro(Color,double,3);
94 
96 
99  vtkSetMacro(Filled,int);
100  vtkGetMacro(Filled,int);
101  vtkBooleanMacro(Filled,int);
103 
105 
108  vtkSetMacro(Dash,int);
109  vtkGetMacro(Dash,int);
110  vtkBooleanMacro(Dash,int);
112 
114 
117  vtkSetMacro(Cross,int);
118  vtkGetMacro(Cross,int);
119  vtkBooleanMacro(Cross,int);
121 
123 
126  vtkSetMacro(RotationAngle,double);
127  vtkGetMacro(RotationAngle,double);
129 
131 
132  vtkSetClampMacro(GlyphType,int,VTK_NO_GLYPH,VTK_EDGEARROW_GLYPH);
133  vtkGetMacro(GlyphType,int);
134  void SetGlyphTypeToNone() {this->SetGlyphType(VTK_NO_GLYPH);}
135  void SetGlyphTypeToVertex() {this->SetGlyphType(VTK_VERTEX_GLYPH);}
136  void SetGlyphTypeToDash() {this->SetGlyphType(VTK_DASH_GLYPH);}
137  void SetGlyphTypeToCross() {this->SetGlyphType(VTK_CROSS_GLYPH);}
138  void SetGlyphTypeToThickCross() {this->SetGlyphType(VTK_THICKCROSS_GLYPH);}
139  void SetGlyphTypeToTriangle() {this->SetGlyphType(VTK_TRIANGLE_GLYPH);}
140  void SetGlyphTypeToSquare() {this->SetGlyphType(VTK_SQUARE_GLYPH);}
141  void SetGlyphTypeToCircle() {this->SetGlyphType(VTK_CIRCLE_GLYPH);}
142  void SetGlyphTypeToDiamond() {this->SetGlyphType(VTK_DIAMOND_GLYPH);}
143  void SetGlyphTypeToArrow() {this->SetGlyphType(VTK_ARROW_GLYPH);}
144  void SetGlyphTypeToThickArrow() {this->SetGlyphType(VTK_THICKARROW_GLYPH);}
145  void SetGlyphTypeToHookedArrow() {this->SetGlyphType(VTK_HOOKEDARROW_GLYPH);}
146  void SetGlyphTypeToEdgeArrow() {this->SetGlyphType(VTK_EDGEARROW_GLYPH);}
148 
149 protected:
152 
153  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
154 
155  double Center[3];
156  double Scale;
157  double Scale2;
158  double Color[3];
159  int Filled;
160  int Dash;
161  int Cross;
164 
165  void TransformGlyph(vtkPoints *pts);
166  void ConvertColor();
167  unsigned char RGB[3];
168 
169  void CreateVertex(vtkPoints *pts, vtkCellArray *verts,
170  vtkUnsignedCharArray *colors);
171  void CreateDash(vtkPoints *pts, vtkCellArray *lines,
172  vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale);
173  void CreateCross(vtkPoints *pts, vtkCellArray *lines,
174  vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale);
175  void CreateThickCross(vtkPoints *pts, vtkCellArray *lines,
176  vtkCellArray *polys, vtkUnsignedCharArray *colors);
177  void CreateTriangle(vtkPoints *pts, vtkCellArray *lines,
178  vtkCellArray *polys, vtkUnsignedCharArray *colors);
179  void CreateSquare(vtkPoints *pts, vtkCellArray *lines,
180  vtkCellArray *polys, vtkUnsignedCharArray *colors);
181  void CreateCircle(vtkPoints *pts, vtkCellArray *lines,
182  vtkCellArray *polys, vtkUnsignedCharArray *colors);
183  void CreateDiamond(vtkPoints *pts, vtkCellArray *lines,
184  vtkCellArray *polys, vtkUnsignedCharArray *colors);
185  void CreateArrow(vtkPoints *pts, vtkCellArray *lines,
186  vtkCellArray *polys, vtkUnsignedCharArray *colors);
187  void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines,
188  vtkCellArray *polys, vtkUnsignedCharArray *colors);
189  void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines,
190  vtkCellArray *polys, vtkUnsignedCharArray *colors);
191  void CreateEdgeArrow(vtkPoints *pts, vtkCellArray *lines,
192  vtkCellArray *polys, vtkUnsignedCharArray *colors);
193 
194 private:
195  vtkGlyphSource2D(const vtkGlyphSource2D&); // Not implemented.
196  void operator=(const vtkGlyphSource2D&); // Not implemented.
197 };
198 
199 #endif
#define VTK_HOOKEDARROW_GLYPH
#define VTK_EDGEARROW_GLYPH
#define VTK_THICKCROSS_GLYPH
void SetGlyphTypeToThickCross()
#define VTK_NO_GLYPH
#define VTK_SQUARE_GLYPH
#define VTK_VERTEX_GLYPH
void SetGlyphTypeToHookedArrow()
#define VTK_DIAMOND_GLYPH
void SetGlyphTypeToEdgeArrow()
#define VTK_ARROW_GLYPH
#define VTK_CROSS_GLYPH
#define VTK_CIRCLE_GLYPH
#define VTK_DASH_GLYPH
#define VTK_TRIANGLE_GLYPH
create 2D glyphs represented by vtkPolyData
void SetGlyphTypeToThickArrow()
#define VTK_THICKARROW_GLYPH