VTK  9.1.0
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 =========================================================================*/
49 #ifndef vtkGlyphSource2D_h
50 #define vtkGlyphSource2D_h
51 
52 #include "vtkFiltersSourcesModule.h" // For export macro
53 #include "vtkPolyDataAlgorithm.h"
54 
55 #define VTK_NO_GLYPH 0
56 #define VTK_VERTEX_GLYPH 1
57 #define VTK_DASH_GLYPH 2
58 #define VTK_CROSS_GLYPH 3
59 #define VTK_THICKCROSS_GLYPH 4
60 #define VTK_TRIANGLE_GLYPH 5
61 #define VTK_SQUARE_GLYPH 6
62 #define VTK_CIRCLE_GLYPH 7
63 #define VTK_DIAMOND_GLYPH 8
64 #define VTK_ARROW_GLYPH 9
65 #define VTK_THICKARROW_GLYPH 10
66 #define VTK_HOOKEDARROW_GLYPH 11
67 #define VTK_EDGEARROW_GLYPH 12
68 
69 #define VTK_MAX_CIRCLE_RESOLUTION 1024
70 
71 class vtkPoints;
73 class vtkCellArray;
74 
75 class VTKFILTERSSOURCES_EXPORT vtkGlyphSource2D : public vtkPolyDataAlgorithm
76 {
77 public:
79  void PrintSelf(ostream& os, vtkIndent indent) override;
80 
85  static vtkGlyphSource2D* New();
86 
88 
91  vtkSetVector3Macro(Center, double);
92  vtkGetVectorMacro(Center, double, 3);
94 
96 
100  vtkSetClampMacro(Scale, double, 0.0, VTK_DOUBLE_MAX);
101  vtkGetMacro(Scale, double);
103 
105 
109  vtkSetClampMacro(Scale2, double, 0.0, VTK_DOUBLE_MAX);
110  vtkGetMacro(Scale2, double);
112 
114 
117  vtkSetVector3Macro(Color, double);
118  vtkGetVectorMacro(Color, double, 3);
120 
122 
127  vtkSetMacro(Filled, vtkTypeBool);
128  vtkGetMacro(Filled, vtkTypeBool);
129  vtkBooleanMacro(Filled, vtkTypeBool);
131 
133 
138  vtkSetMacro(Dash, vtkTypeBool);
139  vtkGetMacro(Dash, vtkTypeBool);
140  vtkBooleanMacro(Dash, vtkTypeBool);
142 
144 
149  vtkSetMacro(Cross, vtkTypeBool);
150  vtkGetMacro(Cross, vtkTypeBool);
151  vtkBooleanMacro(Cross, vtkTypeBool);
153 
155 
160  vtkSetMacro(RotationAngle, double);
161  vtkGetMacro(RotationAngle, double);
163 
165 
168  vtkSetClampMacro(Resolution, int, 3, VTK_MAX_CIRCLE_RESOLUTION);
169  vtkGetMacro(Resolution, int);
171 
173 
176  vtkSetClampMacro(GlyphType, int, VTK_NO_GLYPH, VTK_EDGEARROW_GLYPH);
177  vtkGetMacro(GlyphType, int);
178  void SetGlyphTypeToNone() { this->SetGlyphType(VTK_NO_GLYPH); }
179  void SetGlyphTypeToVertex() { this->SetGlyphType(VTK_VERTEX_GLYPH); }
180  void SetGlyphTypeToDash() { this->SetGlyphType(VTK_DASH_GLYPH); }
181  void SetGlyphTypeToCross() { this->SetGlyphType(VTK_CROSS_GLYPH); }
182  void SetGlyphTypeToThickCross() { this->SetGlyphType(VTK_THICKCROSS_GLYPH); }
183  void SetGlyphTypeToTriangle() { this->SetGlyphType(VTK_TRIANGLE_GLYPH); }
184  void SetGlyphTypeToSquare() { this->SetGlyphType(VTK_SQUARE_GLYPH); }
185  void SetGlyphTypeToCircle() { this->SetGlyphType(VTK_CIRCLE_GLYPH); }
186  void SetGlyphTypeToDiamond() { this->SetGlyphType(VTK_DIAMOND_GLYPH); }
187  void SetGlyphTypeToArrow() { this->SetGlyphType(VTK_ARROW_GLYPH); }
188  void SetGlyphTypeToThickArrow() { this->SetGlyphType(VTK_THICKARROW_GLYPH); }
189  void SetGlyphTypeToHookedArrow() { this->SetGlyphType(VTK_HOOKEDARROW_GLYPH); }
190  void SetGlyphTypeToEdgeArrow() { this->SetGlyphType(VTK_EDGEARROW_GLYPH); }
192 
194 
199  vtkSetMacro(OutputPointsPrecision, int);
200  vtkGetMacro(OutputPointsPrecision, int);
202 
203 protected:
205  ~vtkGlyphSource2D() override = default;
206 
208 
209  double Center[3];
210  double Scale;
211  double Scale2;
212  double Color[3];
220 
222  void ConvertColor();
223  unsigned char RGB[3];
224 
226  void CreateDash(vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys,
227  vtkUnsignedCharArray* colors, double scale);
228  void CreateCross(vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys,
229  vtkUnsignedCharArray* colors, double scale);
231  vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
233  vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
235  vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
237  vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
239  vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
241  vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
243  vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
245  vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
247  vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
248 
249 private:
250  vtkGlyphSource2D(const vtkGlyphSource2D&) = delete;
251  void operator=(const vtkGlyphSource2D&) = delete;
252 };
253 
254 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:143
VTK_CROSS_GLYPH
#define VTK_CROSS_GLYPH
Definition: vtkGlyphSource2D.h:58
vtkGlyphSource2D
create 2D glyphs represented by vtkPolyData
Definition: vtkGlyphSource2D.h:76
vtkGlyphSource2D::Scale
double Scale
Definition: vtkGlyphSource2D.h:210
vtkGlyphSource2D::SetGlyphTypeToDiamond
void SetGlyphTypeToDiamond()
Specify the type of glyph to generate.
Definition: vtkGlyphSource2D.h:186
vtkGlyphSource2D::CreateEdgeArrow
void CreateEdgeArrow(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
vtkX3D::scale
@ scale
Definition: vtkX3D.h:235
vtkGlyphSource2D::Dash
vtkTypeBool Dash
Definition: vtkGlyphSource2D.h:214
vtkGlyphSource2D::Filled
vtkTypeBool Filled
Definition: vtkGlyphSource2D.h:213
VTK_DASH_GLYPH
#define VTK_DASH_GLYPH
Definition: vtkGlyphSource2D.h:57
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
VTK_DIAMOND_GLYPH
#define VTK_DIAMOND_GLYPH
Definition: vtkGlyphSource2D.h:63
vtkGlyphSource2D::SetGlyphTypeToThickCross
void SetGlyphTypeToThickCross()
Specify the type of glyph to generate.
Definition: vtkGlyphSource2D.h:182
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:145
vtkGlyphSource2D::CreateTriangle
void CreateTriangle(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
vtkX3D::Color
@ Color
Definition: vtkX3D.h:52
vtkGlyphSource2D::SetGlyphTypeToVertex
void SetGlyphTypeToVertex()
Specify the type of glyph to generate.
Definition: vtkGlyphSource2D.h:179
VTK_CIRCLE_GLYPH
#define VTK_CIRCLE_GLYPH
Definition: vtkGlyphSource2D.h:62
vtkGlyphSource2D::TransformGlyph
void TransformGlyph(vtkPoints *pts)
vtkGlyphSource2D::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkGlyphSource2D::CreateDash
void CreateDash(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale)
vtkGlyphSource2D::Cross
vtkTypeBool Cross
Definition: vtkGlyphSource2D.h:215
vtkPolyDataAlgorithm.h
VTK_TRIANGLE_GLYPH
#define VTK_TRIANGLE_GLYPH
Definition: vtkGlyphSource2D.h:60
VTK_THICKARROW_GLYPH
#define VTK_THICKARROW_GLYPH
Definition: vtkGlyphSource2D.h:65
vtkGlyphSource2D::CreateCross
void CreateCross(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale)
vtkGlyphSource2D::SetGlyphTypeToTriangle
void SetGlyphTypeToTriangle()
Specify the type of glyph to generate.
Definition: vtkGlyphSource2D.h:183
vtkGlyphSource2D::SetGlyphTypeToNone
void SetGlyphTypeToNone()
Specify the type of glyph to generate.
Definition: vtkGlyphSource2D.h:178
vtkGlyphSource2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGlyphSource2D::SetGlyphTypeToThickArrow
void SetGlyphTypeToThickArrow()
Specify the type of glyph to generate.
Definition: vtkGlyphSource2D.h:188
vtkGlyphSource2D::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkGlyphSource2D.h:219
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:290
vtkGlyphSource2D::CreateThickArrow
void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
vtkGlyphSource2D::~vtkGlyphSource2D
~vtkGlyphSource2D() override=default
VTK_EDGEARROW_GLYPH
#define VTK_EDGEARROW_GLYPH
Definition: vtkGlyphSource2D.h:67
vtkGlyphSource2D::Scale2
double Scale2
Definition: vtkGlyphSource2D.h:211
vtkGlyphSource2D::SetGlyphTypeToSquare
void SetGlyphTypeToSquare()
Specify the type of glyph to generate.
Definition: vtkGlyphSource2D.h:184
vtkGlyphSource2D::SetGlyphTypeToCross
void SetGlyphTypeToCross()
Specify the type of glyph to generate.
Definition: vtkGlyphSource2D.h:181
vtkGlyphSource2D::SetGlyphTypeToArrow
void SetGlyphTypeToArrow()
Specify the type of glyph to generate.
Definition: vtkGlyphSource2D.h:187
vtkGlyphSource2D::New
static vtkGlyphSource2D * New()
Construct a vertex glyph centered at the origin, scale 1.0, white in color, filled,...
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
VTK_THICKCROSS_GLYPH
#define VTK_THICKCROSS_GLYPH
Definition: vtkGlyphSource2D.h:59
VTK_SQUARE_GLYPH
#define VTK_SQUARE_GLYPH
Definition: vtkGlyphSource2D.h:61
VTK_HOOKEDARROW_GLYPH
#define VTK_HOOKEDARROW_GLYPH
Definition: vtkGlyphSource2D.h:66
vtkGlyphSource2D::Resolution
int Resolution
Definition: vtkGlyphSource2D.h:218
vtkGlyphSource2D::SetGlyphTypeToHookedArrow
void SetGlyphTypeToHookedArrow()
Specify the type of glyph to generate.
Definition: vtkGlyphSource2D.h:189
vtkGlyphSource2D::SetGlyphTypeToEdgeArrow
void SetGlyphTypeToEdgeArrow()
Specify the type of glyph to generate.
Definition: vtkGlyphSource2D.h:190
vtkGlyphSource2D::SetGlyphTypeToCircle
void SetGlyphTypeToCircle()
Specify the type of glyph to generate.
Definition: vtkGlyphSource2D.h:185
VTK_VERTEX_GLYPH
#define VTK_VERTEX_GLYPH
Definition: vtkGlyphSource2D.h:56
vtkGlyphSource2D::RotationAngle
double RotationAngle
Definition: vtkGlyphSource2D.h:217
vtkGlyphSource2D::CreateThickCross
void CreateThickCross(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
vtkGlyphSource2D::SetGlyphTypeToDash
void SetGlyphTypeToDash()
Specify the type of glyph to generate.
Definition: vtkGlyphSource2D.h:180
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:64
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:69
vtkGlyphSource2D::CreateSquare
void CreateSquare(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkGlyphSource2D::GlyphType
int GlyphType
Definition: vtkGlyphSource2D.h:216
VTK_NO_GLYPH
#define VTK_NO_GLYPH
Definition: vtkGlyphSource2D.h:55
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:151