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 "vtkPolyDataAlgorithm.h"
39 
40 #define VTK_NO_GLYPH 0
41 #define VTK_VERTEX_GLYPH 1
42 #define VTK_DASH_GLYPH 2
43 #define VTK_CROSS_GLYPH 3
44 #define VTK_THICKCROSS_GLYPH 4
45 #define VTK_TRIANGLE_GLYPH 5
46 #define VTK_SQUARE_GLYPH 6
47 #define VTK_CIRCLE_GLYPH 7
48 #define VTK_DIAMOND_GLYPH 8
49 #define VTK_ARROW_GLYPH 9
50 #define VTK_THICKARROW_GLYPH 10
51 #define VTK_HOOKEDARROW_GLYPH 11
52 #define VTK_EDGEARROW_GLYPH 12
53 
54 class vtkPoints;
56 class vtkCellArray;
57 
59 {
60 public:
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
66  static vtkGlyphSource2D *New();
67 
69 
70  vtkSetVector3Macro(Center,double);
71  vtkGetVectorMacro(Center,double,3);
73 
75 
77  vtkSetClampMacro(Scale,double,0.0,VTK_DOUBLE_MAX);
78  vtkGetMacro(Scale,double);
80 
82 
84  vtkSetClampMacro(Scale2,double,0.0,VTK_DOUBLE_MAX);
85  vtkGetMacro(Scale2,double);
87 
89 
90  vtkSetVector3Macro(Color,double);
91  vtkGetVectorMacro(Color,double,3);
93 
95 
98  vtkSetMacro(Filled,int);
99  vtkGetMacro(Filled,int);
100  vtkBooleanMacro(Filled,int);
102 
104 
107  vtkSetMacro(Dash,int);
108  vtkGetMacro(Dash,int);
109  vtkBooleanMacro(Dash,int);
111 
113 
116  vtkSetMacro(Cross,int);
117  vtkGetMacro(Cross,int);
118  vtkBooleanMacro(Cross,int);
120 
122 
125  vtkSetMacro(RotationAngle,double);
126  vtkGetMacro(RotationAngle,double);
128 
130 
131  vtkSetClampMacro(GlyphType,int,VTK_NO_GLYPH,VTK_EDGEARROW_GLYPH);
132  vtkGetMacro(GlyphType,int);
133  void SetGlyphTypeToNone() {this->SetGlyphType(VTK_NO_GLYPH);}
134  void SetGlyphTypeToVertex() {this->SetGlyphType(VTK_VERTEX_GLYPH);}
135  void SetGlyphTypeToDash() {this->SetGlyphType(VTK_DASH_GLYPH);}
136  void SetGlyphTypeToCross() {this->SetGlyphType(VTK_CROSS_GLYPH);}
137  void SetGlyphTypeToThickCross() {this->SetGlyphType(VTK_THICKCROSS_GLYPH);}
138  void SetGlyphTypeToTriangle() {this->SetGlyphType(VTK_TRIANGLE_GLYPH);}
139  void SetGlyphTypeToSquare() {this->SetGlyphType(VTK_SQUARE_GLYPH);}
140  void SetGlyphTypeToCircle() {this->SetGlyphType(VTK_CIRCLE_GLYPH);}
141  void SetGlyphTypeToDiamond() {this->SetGlyphType(VTK_DIAMOND_GLYPH);}
142  void SetGlyphTypeToArrow() {this->SetGlyphType(VTK_ARROW_GLYPH);}
143  void SetGlyphTypeToThickArrow() {this->SetGlyphType(VTK_THICKARROW_GLYPH);}
144  void SetGlyphTypeToHookedArrow() {this->SetGlyphType(VTK_HOOKEDARROW_GLYPH);}
145  void SetGlyphTypeToEdgeArrow() {this->SetGlyphType(VTK_EDGEARROW_GLYPH);}
147 
148 protected:
151 
153 
154  double Center[3];
155  double Scale;
156  double Scale2;
157  double Color[3];
158  int Filled;
159  int Dash;
160  int Cross;
163 
164  void TransformGlyph(vtkPoints *pts);
165  void ConvertColor();
166  unsigned char RGB[3];
167 
168  void CreateVertex(vtkPoints *pts, vtkCellArray *verts,
169  vtkUnsignedCharArray *colors);
170  void CreateDash(vtkPoints *pts, vtkCellArray *lines,
171  vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale);
172  void CreateCross(vtkPoints *pts, vtkCellArray *lines,
173  vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale);
174  void CreateThickCross(vtkPoints *pts, vtkCellArray *lines,
175  vtkCellArray *polys, vtkUnsignedCharArray *colors);
176  void CreateTriangle(vtkPoints *pts, vtkCellArray *lines,
177  vtkCellArray *polys, vtkUnsignedCharArray *colors);
178  void CreateSquare(vtkPoints *pts, vtkCellArray *lines,
179  vtkCellArray *polys, vtkUnsignedCharArray *colors);
180  void CreateCircle(vtkPoints *pts, vtkCellArray *lines,
181  vtkCellArray *polys, vtkUnsignedCharArray *colors);
182  void CreateDiamond(vtkPoints *pts, vtkCellArray *lines,
183  vtkCellArray *polys, vtkUnsignedCharArray *colors);
184  void CreateArrow(vtkPoints *pts, vtkCellArray *lines,
185  vtkCellArray *polys, vtkUnsignedCharArray *colors);
186  void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines,
187  vtkCellArray *polys, vtkUnsignedCharArray *colors);
188  void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines,
189  vtkCellArray *polys, vtkUnsignedCharArray *colors);
190  void CreateEdgeArrow(vtkPoints *pts, vtkCellArray *lines,
191  vtkCellArray *polys, vtkUnsignedCharArray *colors);
192 
193 private:
194  vtkGlyphSource2D(const vtkGlyphSource2D&); // Not implemented.
195  void operator=(const vtkGlyphSource2D&); // Not implemented.
196 };
197 
198 #endif
#define VTK_HOOKEDARROW_GLYPH
#define VTK_GRAPHICS_EXPORT
#define VTK_DOUBLE_MAX
Definition: vtkType.h:133
Store vtkAlgorithm input/output information.
#define VTK_EDGEARROW_GLYPH
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#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:37
#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:48
#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