VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 class vtkPoints;
57 class vtkCellArray;
58 
60 {
61 public:
63  void PrintSelf(ostream& os, vtkIndent indent);
64 
67  static vtkGlyphSource2D *New();
68 
70 
71  vtkSetVector3Macro(Center,double);
72  vtkGetVectorMacro(Center,double,3);
74 
76 
78  vtkSetClampMacro(Scale,double,0.0,VTK_DOUBLE_MAX);
79  vtkGetMacro(Scale,double);
81 
83 
85  vtkSetClampMacro(Scale2,double,0.0,VTK_DOUBLE_MAX);
86  vtkGetMacro(Scale2,double);
88 
90 
91  vtkSetVector3Macro(Color,double);
92  vtkGetVectorMacro(Color,double,3);
94 
96 
99  vtkSetMacro(Filled,int);
100  vtkGetMacro(Filled,int);
101  vtkBooleanMacro(Filled,int);
103 
105 
108  vtkSetMacro(Dash,int);
109  vtkGetMacro(Dash,int);
110  vtkBooleanMacro(Dash,int);
112 
114 
117  vtkSetMacro(Cross,int);
118  vtkGetMacro(Cross,int);
119  vtkBooleanMacro(Cross,int);
121 
123 
126  vtkSetMacro(RotationAngle,double);
127  vtkGetMacro(RotationAngle,double);
129 
131 
133  vtkGetMacro(GlyphType,int);
134  void SetGlyphTypeToNone() {this->SetGlyphType(VTK_NO_GLYPH);}
135  void SetGlyphTypeToVertex() {this->SetGlyphType(VTK_VERTEX_GLYPH);}
136  void SetGlyphTypeToDash() {this->SetGlyphType(VTK_DASH_GLYPH);}
137  void SetGlyphTypeToCross() {this->SetGlyphType(VTK_CROSS_GLYPH);}
138  void SetGlyphTypeToThickCross() {this->SetGlyphType(VTK_THICKCROSS_GLYPH);}
139  void SetGlyphTypeToTriangle() {this->SetGlyphType(VTK_TRIANGLE_GLYPH);}
140  void SetGlyphTypeToSquare() {this->SetGlyphType(VTK_SQUARE_GLYPH);}
141  void SetGlyphTypeToCircle() {this->SetGlyphType(VTK_CIRCLE_GLYPH);}
142  void SetGlyphTypeToDiamond() {this->SetGlyphType(VTK_DIAMOND_GLYPH);}
143  void SetGlyphTypeToArrow() {this->SetGlyphType(VTK_ARROW_GLYPH);}
144  void SetGlyphTypeToThickArrow() {this->SetGlyphType(VTK_THICKARROW_GLYPH);}
145  void SetGlyphTypeToHookedArrow() {this->SetGlyphType(VTK_HOOKEDARROW_GLYPH);}
146  void SetGlyphTypeToEdgeArrow() {this->SetGlyphType(VTK_EDGEARROW_GLYPH);}
148 
150 
154  vtkSetMacro(OutputPointsPrecision,int);
155  vtkGetMacro(OutputPointsPrecision,int);
157 
158 protected:
161 
163 
164  double Center[3];
165  double Scale;
166  double Scale2;
167  double Color[3];
168  int Filled;
169  int Dash;
170  int Cross;
174 
175  void TransformGlyph(vtkPoints *pts);
176  void ConvertColor();
177  unsigned char RGB[3];
178 
179  void CreateVertex(vtkPoints *pts, vtkCellArray *verts,
180  vtkUnsignedCharArray *colors);
181  void CreateDash(vtkPoints *pts, vtkCellArray *lines,
182  vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale);
183  void CreateCross(vtkPoints *pts, vtkCellArray *lines,
184  vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale);
185  void CreateThickCross(vtkPoints *pts, vtkCellArray *lines,
186  vtkCellArray *polys, vtkUnsignedCharArray *colors);
187  void CreateTriangle(vtkPoints *pts, vtkCellArray *lines,
188  vtkCellArray *polys, vtkUnsignedCharArray *colors);
189  void CreateSquare(vtkPoints *pts, vtkCellArray *lines,
190  vtkCellArray *polys, vtkUnsignedCharArray *colors);
191  void CreateCircle(vtkPoints *pts, vtkCellArray *lines,
192  vtkCellArray *polys, vtkUnsignedCharArray *colors);
193  void CreateDiamond(vtkPoints *pts, vtkCellArray *lines,
194  vtkCellArray *polys, vtkUnsignedCharArray *colors);
195  void CreateArrow(vtkPoints *pts, vtkCellArray *lines,
196  vtkCellArray *polys, vtkUnsignedCharArray *colors);
197  void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines,
198  vtkCellArray *polys, vtkUnsignedCharArray *colors);
199  void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines,
200  vtkCellArray *polys, vtkUnsignedCharArray *colors);
201  void CreateEdgeArrow(vtkPoints *pts, vtkCellArray *lines,
202  vtkCellArray *polys, vtkUnsignedCharArray *colors);
203 
204 private:
205  vtkGlyphSource2D(const vtkGlyphSource2D&); // Not implemented.
206  void operator=(const vtkGlyphSource2D&); // Not implemented.
207 };
208 
209 #endif
#define VTK_HOOKEDARROW_GLYPH
#define VTK_DOUBLE_MAX
Definition: vtkType.h:141
Store vtkAlgorithm input/output information.
#define VTK_EDGEARROW_GLYPH
GLenum GLenum GLenum GLenum GLenum scale
Definition: vtkgl.h:15942
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
#define VTK_THICKCROSS_GLYPH
void SetGlyphTypeToThickCross()
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:133
#define VTK_NO_GLYPH
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
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 vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
#define VTK_TRIANGLE_GLYPH
create 2D glyphs represented by vtkPolyData
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:277
#define vtkGetVectorMacro(name, type, count)
Definition: vtkSetGet.h:414
void SetGlyphTypeToThickArrow()
#define VTK_THICKARROW_GLYPH
represent and manipulate 3D points
Definition: vtkPoints.h:39
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69