00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00045 #ifndef __vtkGlyphSource2D_h
00046 #define __vtkGlyphSource2D_h
00047
00048 #include "vtkPolyDataSource.h"
00049
00050 #define VTK_NO_GLYPH 0
00051 #define VTK_VERTEX_GLYPH 1
00052 #define VTK_DASH_GLYPH 2
00053 #define VTK_CROSS_GLYPH 3
00054 #define VTK_THICKCROSS_GLYPH 4
00055 #define VTK_TRIANGLE_GLYPH 5
00056 #define VTK_SQUARE_GLYPH 6
00057 #define VTK_CIRCLE_GLYPH 7
00058 #define VTK_DIAMOND_GLYPH 8
00059 #define VTK_ARROW_GLYPH 9
00060 #define VTK_THICKARROW_GLYPH 10
00061 #define VTK_HOOKEDARROW_GLYPH 11
00062
00063 class vtkPoints;
00064 class vtkUnsignedCharArray;
00065 class vtkCellArray;
00066
00067 class VTK_GRAPHICS_EXPORT vtkGlyphSource2D : public vtkPolyDataSource
00068 {
00069 public:
00070 vtkTypeRevisionMacro(vtkGlyphSource2D,vtkPolyDataSource);
00071 void PrintSelf(ostream& os, vtkIndent indent);
00072
00075 static vtkGlyphSource2D *New();
00076
00078
00079 vtkSetVector3Macro(Center,double);
00080 vtkGetVectorMacro(Center,double,3);
00082
00084
00086 vtkSetClampMacro(Scale,double,0.0,VTK_DOUBLE_MAX);
00087 vtkGetMacro(Scale,double);
00089
00091
00093 vtkSetClampMacro(Scale2,double,0.0,VTK_DOUBLE_MAX);
00094 vtkGetMacro(Scale2,double);
00096
00098
00099 vtkSetVector3Macro(Color,double);
00100 vtkGetVectorMacro(Color,double,3);
00102
00104
00107 vtkSetMacro(Filled,int);
00108 vtkGetMacro(Filled,int);
00109 vtkBooleanMacro(Filled,int);
00111
00113
00116 vtkSetMacro(Dash,int);
00117 vtkGetMacro(Dash,int);
00118 vtkBooleanMacro(Dash,int);
00120
00122
00125 vtkSetMacro(Cross,int);
00126 vtkGetMacro(Cross,int);
00127 vtkBooleanMacro(Cross,int);
00129
00131
00134 vtkSetMacro(RotationAngle,double);
00135 vtkGetMacro(RotationAngle,double);
00137
00139
00140 vtkSetClampMacro(GlyphType,int,VTK_NO_GLYPH,VTK_HOOKEDARROW_GLYPH);
00141 vtkGetMacro(GlyphType,int);
00142 void SetGlyphTypeToNone() {this->SetGlyphType(VTK_NO_GLYPH);}
00143 void SetGlyphTypeToVertex() {this->SetGlyphType(VTK_VERTEX_GLYPH);}
00144 void SetGlyphTypeToDash() {this->SetGlyphType(VTK_DASH_GLYPH);}
00145 void SetGlyphTypeToCross() {this->SetGlyphType(VTK_CROSS_GLYPH);}
00146 void SetGlyphTypeToThickCross() {this->SetGlyphType(VTK_THICKCROSS_GLYPH);}
00147 void SetGlyphTypeToTriangle() {this->SetGlyphType(VTK_TRIANGLE_GLYPH);}
00148 void SetGlyphTypeToSquare() {this->SetGlyphType(VTK_SQUARE_GLYPH);}
00149 void SetGlyphTypeToCircle() {this->SetGlyphType(VTK_CIRCLE_GLYPH);}
00150 void SetGlyphTypeToDiamond() {this->SetGlyphType(VTK_DIAMOND_GLYPH);}
00151 void SetGlyphTypeToArrow() {this->SetGlyphType(VTK_ARROW_GLYPH);}
00152 void SetGlyphTypeToThickArrow() {this->SetGlyphType(VTK_THICKARROW_GLYPH);}
00153 void SetGlyphTypeToHookedArrow() {this->SetGlyphType(VTK_HOOKEDARROW_GLYPH);}
00155
00156 protected:
00157 vtkGlyphSource2D();
00158 ~vtkGlyphSource2D() {};
00159
00160 void Execute();
00161
00162 double Center[3];
00163 double Scale;
00164 double Scale2;
00165 double Color[3];
00166 int Filled;
00167 int Dash;
00168 int Cross;
00169 int GlyphType;
00170 double RotationAngle;
00171
00172 void TransformGlyph(vtkPoints *pts);
00173 void ConvertColor();
00174 unsigned char RGB[3];
00175
00176 void CreateVertex(vtkPoints *pts, vtkCellArray *verts,
00177 vtkUnsignedCharArray *colors);
00178 void CreateDash(vtkPoints *pts, vtkCellArray *lines,
00179 vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale);
00180 void CreateCross(vtkPoints *pts, vtkCellArray *lines,
00181 vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale);
00182 void CreateThickCross(vtkPoints *pts, vtkCellArray *lines,
00183 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00184 void CreateTriangle(vtkPoints *pts, vtkCellArray *lines,
00185 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00186 void CreateSquare(vtkPoints *pts, vtkCellArray *lines,
00187 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00188 void CreateCircle(vtkPoints *pts, vtkCellArray *lines,
00189 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00190 void CreateDiamond(vtkPoints *pts, vtkCellArray *lines,
00191 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00192 void CreateArrow(vtkPoints *pts, vtkCellArray *lines,
00193 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00194 void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines,
00195 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00196 void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines,
00197 vtkCellArray *polys, vtkUnsignedCharArray *colors);
00198
00199 private:
00200 vtkGlyphSource2D(const vtkGlyphSource2D&);
00201 void operator=(const vtkGlyphSource2D&);
00202 };
00203
00204 #endif
00205
00206