00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00063 #ifndef __vtkGlyphSource2D_h
00064 #define __vtkGlyphSource2D_h
00065
00066 #include "vtkPolyDataSource.h"
00067
00068 #define VTK_NO_GLYPH 0
00069 #define VTK_VERTEX_GLYPH 1
00070 #define VTK_DASH_GLYPH 2
00071 #define VTK_CROSS_GLYPH 3
00072 #define VTK_THICKCROSS_GLYPH 4
00073 #define VTK_TRIANGLE_GLYPH 5
00074 #define VTK_SQUARE_GLYPH 6
00075 #define VTK_CIRCLE_GLYPH 7
00076 #define VTK_DIAMOND_GLYPH 8
00077 #define VTK_ARROW_GLYPH 9
00078 #define VTK_THICKARROW_GLYPH 10
00079 #define VTK_HOOKEDARROW_GLYPH 11
00080
00081 class VTK_EXPORT vtkGlyphSource2D : public vtkPolyDataSource
00082 {
00083 public:
00084 vtkTypeMacro(vtkGlyphSource2D,vtkPolyDataSource);
00085 void PrintSelf(ostream& os, vtkIndent indent);
00086
00089 static vtkGlyphSource2D *New();
00090
00092 vtkSetVector3Macro(Center,float);
00093 vtkGetVectorMacro(Center,float,3);
00094
00097 vtkSetClampMacro(Scale,float,0.0,VTK_LARGE_FLOAT);
00098 vtkGetMacro(Scale,float);
00099
00102 vtkSetClampMacro(Scale2,float,0.0,VTK_LARGE_FLOAT);
00103 vtkGetMacro(Scale2,float);
00104
00106 vtkSetVector3Macro(Color,float);
00107 vtkGetVectorMacro(Color,float,3);
00108
00112 vtkSetMacro(Filled,int);
00113 vtkGetMacro(Filled,int);
00114 vtkBooleanMacro(Filled,int);
00115
00119 vtkSetMacro(Dash,int);
00120 vtkGetMacro(Dash,int);
00121 vtkBooleanMacro(Dash,int);
00122
00126 vtkSetMacro(Cross,int);
00127 vtkGetMacro(Cross,int);
00128 vtkBooleanMacro(Cross,int);
00129
00133 vtkSetMacro(RotationAngle,float);
00134 vtkGetMacro(RotationAngle,float);
00135 vtkBooleanMacro(RotationAngle,float);
00136
00138 vtkSetClampMacro(GlyphType,int,VTK_NO_GLYPH,VTK_HOOKEDARROW_GLYPH);
00139 vtkGetMacro(GlyphType,int);
00140 void SetGlyphTypeToNone() {this->SetGlyphType(VTK_NO_GLYPH);}
00141 void SetGlyphTypeToVertex() {this->SetGlyphType(VTK_VERTEX_GLYPH);}
00142 void SetGlyphTypeToDash() {this->SetGlyphType(VTK_DASH_GLYPH);}
00143 void SetGlyphTypeToCross() {this->SetGlyphType(VTK_CROSS_GLYPH);}
00144 void SetGlyphTypeToThickCross() {this->SetGlyphType(VTK_THICKCROSS_GLYPH);}
00145 void SetGlyphTypeToTriangle() {this->SetGlyphType(VTK_TRIANGLE_GLYPH);}
00146 void SetGlyphTypeToSquare() {this->SetGlyphType(VTK_SQUARE_GLYPH);}
00147 void SetGlyphTypeToCircle() {this->SetGlyphType(VTK_CIRCLE_GLYPH);}
00148 void SetGlyphTypeToDiamond() {this->SetGlyphType(VTK_DIAMOND_GLYPH);}
00149 void SetGlyphTypeToArrow() {this->SetGlyphType(VTK_ARROW_GLYPH);}
00150 void SetGlyphTypeToThickArrow() {this->SetGlyphType(VTK_THICKARROW_GLYPH);}
00151 void SetGlyphTypeToHookedArrow() {this->SetGlyphType(VTK_HOOKEDARROW_GLYPH);}
00152
00153 protected:
00154 vtkGlyphSource2D();
00155 ~vtkGlyphSource2D() {};
00156 vtkGlyphSource2D(const vtkGlyphSource2D&) {};
00157 void operator=(const vtkGlyphSource2D&) {};
00158
00159 void Execute();
00160
00161 float Center[3];
00162 float Scale;
00163 float Scale2;
00164 float Color[3];
00165 int Filled;
00166 int Dash;
00167 int Cross;
00168 int GlyphType;
00169 float RotationAngle;
00170
00171 void TransformGlyph(vtkPoints *pts);
00172 void ConvertColor();
00173 unsigned char RGB[3];
00174
00175 void CreateVertex(vtkPoints *pts, vtkCellArray *verts,
00176 vtkUnsignedCharArray *colors);
00177 void CreateDash(vtkPoints *pts, vtkCellArray *lines,
00178 vtkCellArray *polys, vtkUnsignedCharArray *colors, float scale);
00179 void CreateCross(vtkPoints *pts, vtkCellArray *lines,
00180 vtkCellArray *polys, vtkUnsignedCharArray *colors, float scale);
00181 void CreateThickCross(vtkPoints *pts, vtkCellArray *lines,
00182 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00183 void CreateTriangle(vtkPoints *pts, vtkCellArray *lines,
00184 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00185 void CreateSquare(vtkPoints *pts, vtkCellArray *lines,
00186 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00187 void CreateCircle(vtkPoints *pts, vtkCellArray *lines,
00188 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00189 void CreateDiamond(vtkPoints *pts, vtkCellArray *lines,
00190 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00191 void CreateArrow(vtkPoints *pts, vtkCellArray *lines,
00192 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00193 void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines,
00194 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00195 void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines,
00196 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00197
00198 };
00199
00200 #endif
00201
00202