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 
93  vtkSetVector3Macro(Color,double);
94  vtkGetVectorMacro(Color,double,3);
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 
134  vtkSetClampMacro(Resolution,int,3,VTK_MAX_CIRCLE_RESOLUTION);
135  vtkGetMacro(Resolution,int);
137 
139 
140  vtkSetClampMacro(GlyphType,int,VTK_NO_GLYPH,VTK_EDGEARROW_GLYPH);
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 
184  void TransformGlyph(vtkPoints *pts);
185  void ConvertColor();
186  unsigned char RGB[3];
187 
188  void CreateVertex(vtkPoints *pts, vtkCellArray *verts,
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);
194  void CreateThickCross(vtkPoints *pts, vtkCellArray *lines,
195  vtkCellArray *polys, vtkUnsignedCharArray *colors);
196  void CreateTriangle(vtkPoints *pts, vtkCellArray *lines,
197  vtkCellArray *polys, vtkUnsignedCharArray *colors);
198  void CreateSquare(vtkPoints *pts, vtkCellArray *lines,
199  vtkCellArray *polys, vtkUnsignedCharArray *colors);
200  void CreateCircle(vtkPoints *pts, vtkCellArray *lines,
201  vtkCellArray *polys, vtkUnsignedCharArray *colors);
202  void CreateDiamond(vtkPoints *pts, vtkCellArray *lines,
203  vtkCellArray *polys, vtkUnsignedCharArray *colors);
204  void CreateArrow(vtkPoints *pts, vtkCellArray *lines,
205  vtkCellArray *polys, vtkUnsignedCharArray *colors);
206  void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines,
207  vtkCellArray *polys, vtkUnsignedCharArray *colors);
208  void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines,
209  vtkCellArray *polys, vtkUnsignedCharArray *colors);
210  void CreateEdgeArrow(vtkPoints *pts, vtkCellArray *lines,
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
#define VTK_HOOKEDARROW_GLYPH
#define VTK_DOUBLE_MAX
Definition: vtkType.h:142
Store vtkAlgorithm input/output information.
#define VTK_EDGEARROW_GLYPH
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define VTK_MAX_CIRCLE_RESOLUTION
#define VTK_THICKCROSS_GLYPH
void SetGlyphTypeToThickCross()
#define VTK_NO_GLYPH
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
#define VTK_SQUARE_GLYPH
Superclass for algorithms that produce only polydata as output.
#define VTK_VERTEX_GLYPH
void SetGlyphTypeToHookedArrow()
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKFILTERSSOURCES_EXPORT
#define VTK_DIAMOND_GLYPH
void SetGlyphTypeToEdgeArrow()
#define VTK_ARROW_GLYPH
dynamic, self-adjusting array of unsigned char
object to represent cell connectivity
Definition: vtkCellArray.h:49
#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
void SetGlyphTypeToThickArrow()
#define VTK_THICKARROW_GLYPH
represent and manipulate 3D points
Definition: vtkPoints.h:38