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
00066 #ifndef __vtkGlyphSource2D_h
00067 #define __vtkGlyphSource2D_h
00068
00069 #include "vtkPolyDataSource.h"
00070
00071 #define VTK_NO_GLYPH 0
00072 #define VTK_VERTEX_GLYPH 1
00073 #define VTK_DASH_GLYPH 2
00074 #define VTK_CROSS_GLYPH 3
00075 #define VTK_THICKCROSS_GLYPH 4
00076 #define VTK_TRIANGLE_GLYPH 5
00077 #define VTK_SQUARE_GLYPH 6
00078 #define VTK_CIRCLE_GLYPH 7
00079 #define VTK_DIAMOND_GLYPH 8
00080 #define VTK_ARROW_GLYPH 9
00081 #define VTK_THICKARROW_GLYPH 10
00082 #define VTK_HOOKEDARROW_GLYPH 11
00083
00084 class VTK_GRAPHICS_EXPORT vtkGlyphSource2D : public vtkPolyDataSource
00085 {
00086 public:
00087 vtkTypeMacro(vtkGlyphSource2D,vtkPolyDataSource);
00088 void PrintSelf(ostream& os, vtkIndent indent);
00089
00092 static vtkGlyphSource2D *New();
00093
00095
00096 vtkSetVector3Macro(Center,float);
00097 vtkGetVectorMacro(Center,float,3);
00099
00101
00103 vtkSetClampMacro(Scale,float,0.0,VTK_LARGE_FLOAT);
00104 vtkGetMacro(Scale,float);
00106
00108
00110 vtkSetClampMacro(Scale2,float,0.0,VTK_LARGE_FLOAT);
00111 vtkGetMacro(Scale2,float);
00113
00115
00116 vtkSetVector3Macro(Color,float);
00117 vtkGetVectorMacro(Color,float,3);
00119
00121
00124 vtkSetMacro(Filled,int);
00125 vtkGetMacro(Filled,int);
00126 vtkBooleanMacro(Filled,int);
00128
00130
00133 vtkSetMacro(Dash,int);
00134 vtkGetMacro(Dash,int);
00135 vtkBooleanMacro(Dash,int);
00137
00139
00142 vtkSetMacro(Cross,int);
00143 vtkGetMacro(Cross,int);
00144 vtkBooleanMacro(Cross,int);
00146
00148
00151 vtkSetMacro(RotationAngle,float);
00152 vtkGetMacro(RotationAngle,float);
00154
00156
00157 vtkSetClampMacro(GlyphType,int,VTK_NO_GLYPH,VTK_HOOKEDARROW_GLYPH);
00158 vtkGetMacro(GlyphType,int);
00159 void SetGlyphTypeToNone() {this->SetGlyphType(VTK_NO_GLYPH);}
00160 void SetGlyphTypeToVertex() {this->SetGlyphType(VTK_VERTEX_GLYPH);}
00161 void SetGlyphTypeToDash() {this->SetGlyphType(VTK_DASH_GLYPH);}
00162 void SetGlyphTypeToCross() {this->SetGlyphType(VTK_CROSS_GLYPH);}
00163 void SetGlyphTypeToThickCross() {this->SetGlyphType(VTK_THICKCROSS_GLYPH);}
00164 void SetGlyphTypeToTriangle() {this->SetGlyphType(VTK_TRIANGLE_GLYPH);}
00165 void SetGlyphTypeToSquare() {this->SetGlyphType(VTK_SQUARE_GLYPH);}
00166 void SetGlyphTypeToCircle() {this->SetGlyphType(VTK_CIRCLE_GLYPH);}
00167 void SetGlyphTypeToDiamond() {this->SetGlyphType(VTK_DIAMOND_GLYPH);}
00168 void SetGlyphTypeToArrow() {this->SetGlyphType(VTK_ARROW_GLYPH);}
00169 void SetGlyphTypeToThickArrow() {this->SetGlyphType(VTK_THICKARROW_GLYPH);}
00170 void SetGlyphTypeToHookedArrow() {this->SetGlyphType(VTK_HOOKEDARROW_GLYPH);}
00172
00173 protected:
00174 vtkGlyphSource2D();
00175 ~vtkGlyphSource2D() {};
00176
00177 void Execute();
00178
00179 float Center[3];
00180 float Scale;
00181 float Scale2;
00182 float Color[3];
00183 int Filled;
00184 int Dash;
00185 int Cross;
00186 int GlyphType;
00187 float RotationAngle;
00188
00189 void TransformGlyph(vtkPoints *pts);
00190 void ConvertColor();
00191 unsigned char RGB[3];
00192
00193 void CreateVertex(vtkPoints *pts, vtkCellArray *verts,
00194 vtkUnsignedCharArray *colors);
00195 void CreateDash(vtkPoints *pts, vtkCellArray *lines,
00196 vtkCellArray *polys, vtkUnsignedCharArray *colors, float scale);
00197 void CreateCross(vtkPoints *pts, vtkCellArray *lines,
00198 vtkCellArray *polys, vtkUnsignedCharArray *colors, float scale);
00199 void CreateThickCross(vtkPoints *pts, vtkCellArray *lines,
00200 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00201 void CreateTriangle(vtkPoints *pts, vtkCellArray *lines,
00202 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00203 void CreateSquare(vtkPoints *pts, vtkCellArray *lines,
00204 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00205 void CreateCircle(vtkPoints *pts, vtkCellArray *lines,
00206 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00207 void CreateDiamond(vtkPoints *pts, vtkCellArray *lines,
00208 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00209 void CreateArrow(vtkPoints *pts, vtkCellArray *lines,
00210 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00211 void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines,
00212 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00213 void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines,
00214 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00215
00216 private:
00217 vtkGlyphSource2D(const vtkGlyphSource2D&);
00218 void operator=(const vtkGlyphSource2D&);
00219 };
00220
00221 #endif
00222
00223