00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00035
#ifndef __vtkGlyphSource2D_h
00036
#define __vtkGlyphSource2D_h
00037
00038
#include "vtkPolyDataSource.h"
00039
00040 #define VTK_NO_GLYPH 0
00041 #define VTK_VERTEX_GLYPH 1
00042 #define VTK_DASH_GLYPH 2
00043 #define VTK_CROSS_GLYPH 3
00044 #define VTK_THICKCROSS_GLYPH 4
00045 #define VTK_TRIANGLE_GLYPH 5
00046 #define VTK_SQUARE_GLYPH 6
00047 #define VTK_CIRCLE_GLYPH 7
00048 #define VTK_DIAMOND_GLYPH 8
00049 #define VTK_ARROW_GLYPH 9
00050 #define VTK_THICKARROW_GLYPH 10
00051 #define VTK_HOOKEDARROW_GLYPH 11
00052
00053
class vtkPoints;
00054
class vtkUnsignedCharArray;
00055
class vtkCellArray;
00056
00057 class VTK_GRAPHICS_EXPORT vtkGlyphSource2D :
public vtkPolyDataSource
00058 {
00059
public:
00060 vtkTypeRevisionMacro(vtkGlyphSource2D,
vtkPolyDataSource);
00061
void PrintSelf(ostream& os,
vtkIndent indent);
00062
00065
static vtkGlyphSource2D *
New();
00066
00068
00069 vtkSetVector3Macro(Center,
double);
00070 vtkGetVectorMacro(Center,
double,3);
00072
00074
00076 vtkSetClampMacro(Scale,
double,0.0,VTK_DOUBLE_MAX);
00077 vtkGetMacro(Scale,
double);
00079
00081
00083 vtkSetClampMacro(Scale2,
double,0.0,VTK_DOUBLE_MAX);
00084 vtkGetMacro(Scale2,
double);
00086
00088
00089 vtkSetVector3Macro(Color,
double);
00090 vtkGetVectorMacro(Color,
double,3);
00092
00094
00097 vtkSetMacro(Filled,
int);
00098 vtkGetMacro(Filled,
int);
00099 vtkBooleanMacro(Filled,
int);
00101
00103
00106 vtkSetMacro(Dash,
int);
00107 vtkGetMacro(Dash,
int);
00108 vtkBooleanMacro(Dash,
int);
00110
00112
00115 vtkSetMacro(Cross,
int);
00116 vtkGetMacro(Cross,
int);
00117 vtkBooleanMacro(Cross,
int);
00119
00121
00124 vtkSetMacro(RotationAngle,
double);
00125 vtkGetMacro(RotationAngle,
double);
00127
00129
00130 vtkSetClampMacro(GlyphType,
int,VTK_NO_GLYPH,VTK_HOOKEDARROW_GLYPH);
00131 vtkGetMacro(GlyphType,
int);
00132 void SetGlyphTypeToNone() {this->SetGlyphType(
VTK_NO_GLYPH);}
00133 void SetGlyphTypeToVertex() {this->SetGlyphType(
VTK_VERTEX_GLYPH);}
00134 void SetGlyphTypeToDash() {this->SetGlyphType(
VTK_DASH_GLYPH);}
00135 void SetGlyphTypeToCross() {this->SetGlyphType(
VTK_CROSS_GLYPH);}
00136 void SetGlyphTypeToThickCross() {this->SetGlyphType(
VTK_THICKCROSS_GLYPH);}
00137 void SetGlyphTypeToTriangle() {this->SetGlyphType(
VTK_TRIANGLE_GLYPH);}
00138 void SetGlyphTypeToSquare() {this->SetGlyphType(
VTK_SQUARE_GLYPH);}
00139 void SetGlyphTypeToCircle() {this->SetGlyphType(
VTK_CIRCLE_GLYPH);}
00140 void SetGlyphTypeToDiamond() {this->SetGlyphType(
VTK_DIAMOND_GLYPH);}
00141 void SetGlyphTypeToArrow() {this->SetGlyphType(
VTK_ARROW_GLYPH);}
00142 void SetGlyphTypeToThickArrow() {this->SetGlyphType(
VTK_THICKARROW_GLYPH);}
00143 void SetGlyphTypeToHookedArrow() {this->SetGlyphType(
VTK_HOOKEDARROW_GLYPH);}
00145
00146
protected:
00147 vtkGlyphSource2D();
00148 ~vtkGlyphSource2D() {};
00149
00150
void Execute();
00151
00152 double Center[3];
00153 double Scale;
00154 double Scale2;
00155 double Color[3];
00156 int Filled;
00157 int Dash;
00158 int Cross;
00159 int GlyphType;
00160 double RotationAngle;
00161
00162
void TransformGlyph(
vtkPoints *pts);
00163
void ConvertColor();
00164 unsigned char RGB[3];
00165
00166
void CreateVertex(
vtkPoints *pts,
vtkCellArray *verts,
00167
vtkUnsignedCharArray *colors);
00168
void CreateDash(
vtkPoints *pts,
vtkCellArray *lines,
00169
vtkCellArray *polys,
vtkUnsignedCharArray *colors,
double scale);
00170
void CreateCross(
vtkPoints *pts,
vtkCellArray *lines,
00171
vtkCellArray *polys,
vtkUnsignedCharArray *colors,
double scale);
00172
void CreateThickCross(
vtkPoints *pts,
vtkCellArray *lines,
00173
vtkCellArray *polys,
vtkUnsignedCharArray *colors);
00174
void CreateTriangle(
vtkPoints *pts,
vtkCellArray *lines,
00175
vtkCellArray *polys,
vtkUnsignedCharArray *colors);
00176
void CreateSquare(
vtkPoints *pts,
vtkCellArray *lines,
00177
vtkCellArray *polys,
vtkUnsignedCharArray *colors);
00178
void CreateCircle(
vtkPoints *pts,
vtkCellArray *lines,
00179
vtkCellArray *polys,
vtkUnsignedCharArray *colors);
00180
void CreateDiamond(
vtkPoints *pts,
vtkCellArray *lines,
00181
vtkCellArray *polys,
vtkUnsignedCharArray *colors);
00182
void CreateArrow(
vtkPoints *pts,
vtkCellArray *lines,
00183
vtkCellArray *polys,
vtkUnsignedCharArray *colors);
00184
void CreateThickArrow(
vtkPoints *pts,
vtkCellArray *lines,
00185
vtkCellArray *polys,
vtkUnsignedCharArray *colors);
00186
void CreateHookedArrow(
vtkPoints *pts,
vtkCellArray *lines,
00187
vtkCellArray *polys,
vtkUnsignedCharArray *colors);
00188
00189
private:
00190 vtkGlyphSource2D(
const vtkGlyphSource2D&);
00191
void operator=(
const vtkGlyphSource2D&);
00192 };
00193
00194
#endif
00195
00196