VTK  9.5.20250917
vtkGlyphSource2D.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
45#ifndef vtkGlyphSource2D_h
46#define vtkGlyphSource2D_h
47
48#include "vtkFiltersSourcesModule.h" // For export macro
50#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
51
52#define VTK_NO_GLYPH 0
53#define VTK_VERTEX_GLYPH 1
54#define VTK_DASH_GLYPH 2
55#define VTK_CROSS_GLYPH 3
56#define VTK_THICKCROSS_GLYPH 4
57#define VTK_TRIANGLE_GLYPH 5
58#define VTK_SQUARE_GLYPH 6
59#define VTK_CIRCLE_GLYPH 7
60#define VTK_DIAMOND_GLYPH 8
61#define VTK_ARROW_GLYPH 9
62#define VTK_THICKARROW_GLYPH 10
63#define VTK_HOOKEDARROW_GLYPH 11
64#define VTK_EDGEARROW_GLYPH 12
65
66#define VTK_MAX_CIRCLE_RESOLUTION 1024
67
68VTK_ABI_NAMESPACE_BEGIN
69class vtkPoints;
71class vtkCellArray;
72
73class VTKFILTERSSOURCES_EXPORT VTK_MARSHALAUTO vtkGlyphSource2D : public vtkPolyDataAlgorithm
74{
75public:
77 void PrintSelf(ostream& os, vtkIndent indent) override;
78
84
86
89 vtkSetVector3Macro(Center, double);
90 vtkGetVectorMacro(Center, double, 3);
92
94
98 vtkSetClampMacro(Scale, double, 0.0, VTK_DOUBLE_MAX);
99 vtkGetMacro(Scale, double);
101
103
107 vtkSetClampMacro(Scale2, double, 0.0, VTK_DOUBLE_MAX);
108 vtkGetMacro(Scale2, double);
110
112
115 vtkSetVector3Macro(Color, double);
116 vtkGetVectorMacro(Color, double, 3);
118
120
125 vtkSetMacro(Filled, vtkTypeBool);
126 vtkGetMacro(Filled, vtkTypeBool);
127 vtkBooleanMacro(Filled, vtkTypeBool);
129
131
136 vtkSetMacro(Dash, vtkTypeBool);
137 vtkGetMacro(Dash, vtkTypeBool);
138 vtkBooleanMacro(Dash, vtkTypeBool);
140
142
147 vtkSetMacro(Cross, vtkTypeBool);
148 vtkGetMacro(Cross, vtkTypeBool);
149 vtkBooleanMacro(Cross, vtkTypeBool);
151
153
158 vtkSetMacro(RotationAngle, double);
159 vtkGetMacro(RotationAngle, double);
161
163
166 vtkSetClampMacro(Resolution, int, 3, VTK_MAX_CIRCLE_RESOLUTION);
167 vtkGetMacro(Resolution, int);
169
171
174 vtkSetClampMacro(GlyphType, int, VTK_NO_GLYPH, VTK_EDGEARROW_GLYPH);
175 vtkGetMacro(GlyphType, int);
176 void SetGlyphTypeToNone() { this->SetGlyphType(VTK_NO_GLYPH); }
177 void SetGlyphTypeToVertex() { this->SetGlyphType(VTK_VERTEX_GLYPH); }
178 void SetGlyphTypeToDash() { this->SetGlyphType(VTK_DASH_GLYPH); }
179 void SetGlyphTypeToCross() { this->SetGlyphType(VTK_CROSS_GLYPH); }
180 void SetGlyphTypeToThickCross() { this->SetGlyphType(VTK_THICKCROSS_GLYPH); }
181 void SetGlyphTypeToTriangle() { this->SetGlyphType(VTK_TRIANGLE_GLYPH); }
182 void SetGlyphTypeToSquare() { this->SetGlyphType(VTK_SQUARE_GLYPH); }
183 void SetGlyphTypeToCircle() { this->SetGlyphType(VTK_CIRCLE_GLYPH); }
184 void SetGlyphTypeToDiamond() { this->SetGlyphType(VTK_DIAMOND_GLYPH); }
185 void SetGlyphTypeToArrow() { this->SetGlyphType(VTK_ARROW_GLYPH); }
186 void SetGlyphTypeToThickArrow() { this->SetGlyphType(VTK_THICKARROW_GLYPH); }
187 void SetGlyphTypeToHookedArrow() { this->SetGlyphType(VTK_HOOKEDARROW_GLYPH); }
188 void SetGlyphTypeToEdgeArrow() { this->SetGlyphType(VTK_EDGEARROW_GLYPH); }
190
192
197 vtkSetMacro(OutputPointsPrecision, int);
198 vtkGetMacro(OutputPointsPrecision, int);
200
202
207 vtkSetClampMacro(TipLength, double, 0.0, 1.0);
208 vtkGetMacro(TipLength, double);
210
212
217 vtkSetMacro(DoublePointed, bool);
218 vtkGetMacro(DoublePointed, bool);
219 vtkBooleanMacro(DoublePointed, bool);
221
223
228 vtkSetMacro(PointInwards, bool);
229 vtkGetMacro(PointInwards, bool);
230 vtkBooleanMacro(PointInwards, bool);
232
233protected:
235 ~vtkGlyphSource2D() override = default;
236
238
239 double Center[3] = { 0.0, 0.0, 0.0 };
240 double Scale = 1.0;
241 double Scale2 = 1.5;
242 double Color[3] = { 1.0, 1.0, 1.0 };
243 vtkTypeBool Filled = true;
244 vtkTypeBool Dash = false;
245 vtkTypeBool Cross = false;
246 int GlyphType = VTK_VERTEX_GLYPH;
247 double RotationAngle = 0.0;
248 int Resolution = 8;
249 int OutputPointsPrecision = SINGLE_PRECISION;
250 double TipLength = 0.3;
251 bool DoublePointed = false;
252 bool PointInwards = false;
253
256 unsigned char RGB[3];
257
260 vtkUnsignedCharArray* colors, double scale);
262 vtkUnsignedCharArray* colors, double scale);
264 vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
266 vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
268 vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
270 vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
272 vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
274 vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
276 vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
278 vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
280 vtkPoints* pts, vtkCellArray* lines, vtkCellArray* polys, vtkUnsignedCharArray* colors);
281
282private:
283 vtkGlyphSource2D(const vtkGlyphSource2D&) = delete;
284 void operator=(const vtkGlyphSource2D&) = delete;
285};
286
287VTK_ABI_NAMESPACE_END
288#endif
object to represent cell connectivity
create 2D glyphs represented by vtkPolyData
void SetGlyphTypeToArrow()
Specify the type of glyph to generate.
void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
void SetGlyphTypeToSquare()
Specify the type of glyph to generate.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetGlyphTypeToTriangle()
Specify the type of glyph to generate.
void SetGlyphTypeToCross()
Specify the type of glyph to generate.
void SetGlyphTypeToThickArrow()
Specify the type of glyph to generate.
void SetGlyphTypeToEdgeArrow()
Specify the type of glyph to generate.
void CreateCross(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale)
void CreateThickCross(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
void CreateDiamond(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
void TransformGlyph(vtkPoints *pts)
void SetGlyphTypeToNone()
Specify the type of glyph to generate.
~vtkGlyphSource2D() override=default
void CreateCircle(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
void CreateTriangle(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
void SetGlyphTypeToCircle()
Specify the type of glyph to generate.
void SetGlyphTypeToHookedArrow()
Specify the type of glyph to generate.
void CreateEdgeArrow(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
void CreateVertex(vtkPoints *pts, vtkCellArray *verts, vtkUnsignedCharArray *colors)
void CreateArrow(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
void SetGlyphTypeToDash()
Specify the type of glyph to generate.
void SetGlyphTypeToDiamond()
Specify the type of glyph to generate.
void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
static vtkGlyphSource2D * New()
Construct a vertex glyph centered at the origin, scale 1.0, white in color, filled,...
void SetGlyphTypeToThickCross()
Specify the type of glyph to generate.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void CreateDash(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale)
void CreateSquare(vtkPoints *pts, vtkCellArray *lines, vtkCellArray *polys, vtkUnsignedCharArray *colors)
void SetGlyphTypeToVertex()
Specify the type of glyph to generate.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition vtkPoints.h:139
Superclass for algorithms that produce only polydata as output.
dynamic, self-adjusting array of unsigned char
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DIAMOND_GLYPH
#define VTK_SQUARE_GLYPH
#define VTK_TRIANGLE_GLYPH
#define VTK_NO_GLYPH
#define VTK_MAX_CIRCLE_RESOLUTION
#define VTK_VERTEX_GLYPH
#define VTK_THICKCROSS_GLYPH
#define VTK_DASH_GLYPH
#define VTK_HOOKEDARROW_GLYPH
#define VTK_ARROW_GLYPH
#define VTK_EDGEARROW_GLYPH
#define VTK_CIRCLE_GLYPH
#define VTK_CROSS_GLYPH
#define VTK_THICKARROW_GLYPH
#define VTK_DOUBLE_MAX
Definition vtkType.h:172
#define VTK_MARSHALAUTO