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 =========================================================================*/
30 #ifndef vtkGlyphSource2D_h
31 #define vtkGlyphSource2D_h
32 
33 #include "vtkFiltersSourcesModule.h" // For export macro
34 #include "vtkPolyDataAlgorithm.h"
35 
36 #define VTK_NO_GLYPH 0
37 #define VTK_VERTEX_GLYPH 1
38 #define VTK_DASH_GLYPH 2
39 #define VTK_CROSS_GLYPH 3
40 #define VTK_THICKCROSS_GLYPH 4
41 #define VTK_TRIANGLE_GLYPH 5
42 #define VTK_SQUARE_GLYPH 6
43 #define VTK_CIRCLE_GLYPH 7
44 #define VTK_DIAMOND_GLYPH 8
45 #define VTK_ARROW_GLYPH 9
46 #define VTK_THICKARROW_GLYPH 10
47 #define VTK_HOOKEDARROW_GLYPH 11
48 #define VTK_EDGEARROW_GLYPH 12
49 
50 #define VTK_MAX_CIRCLE_RESOLUTION 1024
51 
52 class vtkPoints;
54 class vtkCellArray;
55 
56 class VTKFILTERSSOURCES_EXPORT vtkGlyphSource2D : public vtkPolyDataAlgorithm
57 {
58 public:
60  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
61 
66  static vtkGlyphSource2D *New();
67 
69 
72  vtkSetVector3Macro(Center,double);
73  vtkGetVectorMacro(Center,double,3);
75 
77 
81  vtkSetClampMacro(Scale,double,0.0,VTK_DOUBLE_MAX);
82  vtkGetMacro(Scale,double);
84 
86 
90  vtkSetClampMacro(Scale2,double,0.0,VTK_DOUBLE_MAX);
91  vtkGetMacro(Scale2,double);
93 
95 
98  vtkSetVector3Macro(Color,double);
99  vtkGetVectorMacro(Color,double,3);
101 
103 
108  vtkSetMacro(Filled,int);
109  vtkGetMacro(Filled,int);
110  vtkBooleanMacro(Filled,int);
112 
114 
119  vtkSetMacro(Dash,int);
120  vtkGetMacro(Dash,int);
121  vtkBooleanMacro(Dash,int);
123 
125 
130  vtkSetMacro(Cross,int);
131  vtkGetMacro(Cross,int);
132  vtkBooleanMacro(Cross,int);
134 
136 
141  vtkSetMacro(RotationAngle,double);
142  vtkGetMacro(RotationAngle,double);
144 
146 
149  vtkSetClampMacro(Resolution,int,3,VTK_MAX_CIRCLE_RESOLUTION);
150  vtkGetMacro(Resolution,int);
152 
154 
157  vtkSetClampMacro(GlyphType,int,VTK_NO_GLYPH,VTK_EDGEARROW_GLYPH);
158  vtkGetMacro(GlyphType,int);
159  void SetGlyphTypeToNone() {this->SetGlyphType(VTK_NO_GLYPH);}
160  void SetGlyphTypeToVertex() {this->SetGlyphType(VTK_VERTEX_GLYPH);}
161  void SetGlyphTypeToDash() {this->SetGlyphType(VTK_DASH_GLYPH);}
162  void SetGlyphTypeToCross() {this->SetGlyphType(VTK_CROSS_GLYPH);}
163  void SetGlyphTypeToThickCross() {this->SetGlyphType(VTK_THICKCROSS_GLYPH);}
164  void SetGlyphTypeToTriangle() {this->SetGlyphType(VTK_TRIANGLE_GLYPH);}
165  void SetGlyphTypeToSquare() {this->SetGlyphType(VTK_SQUARE_GLYPH);}
166  void SetGlyphTypeToCircle() {this->SetGlyphType(VTK_CIRCLE_GLYPH);}
167  void SetGlyphTypeToDiamond() {this->SetGlyphType(VTK_DIAMOND_GLYPH);}
168  void SetGlyphTypeToArrow() {this->SetGlyphType(VTK_ARROW_GLYPH);}
169  void SetGlyphTypeToThickArrow() {this->SetGlyphType(VTK_THICKARROW_GLYPH);}
170  void SetGlyphTypeToHookedArrow() {this->SetGlyphType(VTK_HOOKEDARROW_GLYPH);}
171  void SetGlyphTypeToEdgeArrow() {this->SetGlyphType(VTK_EDGEARROW_GLYPH);}
173 
175 
180  vtkSetMacro(OutputPointsPrecision,int);
181  vtkGetMacro(OutputPointsPrecision,int);
183 
184 protected:
186  ~vtkGlyphSource2D() VTK_OVERRIDE {}
187 
189 
190  double Center[3];
191  double Scale;
192  double Scale2;
193  double Color[3];
194  int Filled;
195  int Dash;
196  int Cross;
201 
202  void TransformGlyph(vtkPoints *pts);
203  void ConvertColor();
204  unsigned char RGB[3];
205 
206  void CreateVertex(vtkPoints *pts, vtkCellArray *verts,
207  vtkUnsignedCharArray *colors);
208  void CreateDash(vtkPoints *pts, vtkCellArray *lines,
209  vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale);
210  void CreateCross(vtkPoints *pts, vtkCellArray *lines,
211  vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale);
212  void CreateThickCross(vtkPoints *pts, vtkCellArray *lines,
213  vtkCellArray *polys, vtkUnsignedCharArray *colors);
214  void CreateTriangle(vtkPoints *pts, vtkCellArray *lines,
215  vtkCellArray *polys, vtkUnsignedCharArray *colors);
216  void CreateSquare(vtkPoints *pts, vtkCellArray *lines,
217  vtkCellArray *polys, vtkUnsignedCharArray *colors);
218  void CreateCircle(vtkPoints *pts, vtkCellArray *lines,
219  vtkCellArray *polys, vtkUnsignedCharArray *colors);
220  void CreateDiamond(vtkPoints *pts, vtkCellArray *lines,
221  vtkCellArray *polys, vtkUnsignedCharArray *colors);
222  void CreateArrow(vtkPoints *pts, vtkCellArray *lines,
223  vtkCellArray *polys, vtkUnsignedCharArray *colors);
224  void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines,
225  vtkCellArray *polys, vtkUnsignedCharArray *colors);
226  void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines,
227  vtkCellArray *polys, vtkUnsignedCharArray *colors);
228  void CreateEdgeArrow(vtkPoints *pts, vtkCellArray *lines,
229  vtkCellArray *polys, vtkUnsignedCharArray *colors);
230 
231 private:
232  vtkGlyphSource2D(const vtkGlyphSource2D&) VTK_DELETE_FUNCTION;
233  void operator=(const vtkGlyphSource2D&) VTK_DELETE_FUNCTION;
234 };
235 
236 #endif
#define VTK_HOOKEDARROW_GLYPH
#define VTK_DOUBLE_MAX
Definition: vtkType.h:167
Store vtkAlgorithm input/output information.
#define VTK_EDGEARROW_GLYPH
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
void SetGlyphTypeToVertex()
Specify the type of glyph to generate.
void SetGlyphTypeToDash()
Specify the type of glyph to generate.
#define VTK_MAX_CIRCLE_RESOLUTION
#define VTK_THICKCROSS_GLYPH
void SetGlyphTypeToThickCross()
Specify the type of glyph to generate.
void SetGlyphTypeToCircle()
Specify the type of glyph to generate.
#define VTK_NO_GLYPH
void SetGlyphTypeToTriangle()
Specify the type of glyph to generate.
static vtkPolyDataAlgorithm * New()
#define VTK_SQUARE_GLYPH
Superclass for algorithms that produce only polydata as output.
void SetGlyphTypeToNone()
Specify the type of glyph to generate.
#define VTK_VERTEX_GLYPH
void SetGlyphTypeToHookedArrow()
Specify the type of glyph to generate.
a simple class to control print indentation
Definition: vtkIndent.h:33
#define VTK_DIAMOND_GLYPH
void SetGlyphTypeToCross()
Specify the type of glyph to generate.
void SetGlyphTypeToEdgeArrow()
Specify the type of glyph to generate.
#define VTK_ARROW_GLYPH
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
dynamic, self-adjusting array of unsigned char
void SetGlyphTypeToSquare()
Specify the type of glyph to generate.
object to represent cell connectivity
Definition: vtkCellArray.h:44
#define VTK_CROSS_GLYPH
#define VTK_CIRCLE_GLYPH
#define VTK_DASH_GLYPH
Store zero or more vtkInformation instances.
#define VTK_TRIANGLE_GLYPH
create 2D glyphs represented by vtkPolyData
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetGlyphTypeToDiamond()
Specify the type of glyph to generate.
~vtkGlyphSource2D() override
void SetGlyphTypeToThickArrow()
Specify the type of glyph to generate.
#define VTK_THICKARROW_GLYPH
represent and manipulate 3D points
Definition: vtkPoints.h:33
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetGlyphTypeToArrow()
Specify the type of glyph to generate.