VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkGlyphSource2D.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00035 #ifndef vtkGlyphSource2D_h 00036 #define vtkGlyphSource2D_h 00037 00038 #include "vtkFiltersSourcesModule.h" // For export macro 00039 #include "vtkPolyDataAlgorithm.h" 00040 00041 #define VTK_NO_GLYPH 0 00042 #define VTK_VERTEX_GLYPH 1 00043 #define VTK_DASH_GLYPH 2 00044 #define VTK_CROSS_GLYPH 3 00045 #define VTK_THICKCROSS_GLYPH 4 00046 #define VTK_TRIANGLE_GLYPH 5 00047 #define VTK_SQUARE_GLYPH 6 00048 #define VTK_CIRCLE_GLYPH 7 00049 #define VTK_DIAMOND_GLYPH 8 00050 #define VTK_ARROW_GLYPH 9 00051 #define VTK_THICKARROW_GLYPH 10 00052 #define VTK_HOOKEDARROW_GLYPH 11 00053 #define VTK_EDGEARROW_GLYPH 12 00054 00055 class vtkPoints; 00056 class vtkUnsignedCharArray; 00057 class vtkCellArray; 00058 00059 class VTKFILTERSSOURCES_EXPORT vtkGlyphSource2D : public vtkPolyDataAlgorithm 00060 { 00061 public: 00062 vtkTypeMacro(vtkGlyphSource2D,vtkPolyDataAlgorithm); 00063 void PrintSelf(ostream& os, vtkIndent indent); 00064 00067 static vtkGlyphSource2D *New(); 00068 00070 00071 vtkSetVector3Macro(Center,double); 00072 vtkGetVectorMacro(Center,double,3); 00074 00076 00078 vtkSetClampMacro(Scale,double,0.0,VTK_DOUBLE_MAX); 00079 vtkGetMacro(Scale,double); 00081 00083 00085 vtkSetClampMacro(Scale2,double,0.0,VTK_DOUBLE_MAX); 00086 vtkGetMacro(Scale2,double); 00088 00090 00091 vtkSetVector3Macro(Color,double); 00092 vtkGetVectorMacro(Color,double,3); 00094 00096 00099 vtkSetMacro(Filled,int); 00100 vtkGetMacro(Filled,int); 00101 vtkBooleanMacro(Filled,int); 00103 00105 00108 vtkSetMacro(Dash,int); 00109 vtkGetMacro(Dash,int); 00110 vtkBooleanMacro(Dash,int); 00112 00114 00117 vtkSetMacro(Cross,int); 00118 vtkGetMacro(Cross,int); 00119 vtkBooleanMacro(Cross,int); 00121 00123 00126 vtkSetMacro(RotationAngle,double); 00127 vtkGetMacro(RotationAngle,double); 00129 00131 00132 vtkSetClampMacro(GlyphType,int,VTK_NO_GLYPH,VTK_EDGEARROW_GLYPH); 00133 vtkGetMacro(GlyphType,int); 00134 void SetGlyphTypeToNone() {this->SetGlyphType(VTK_NO_GLYPH);} 00135 void SetGlyphTypeToVertex() {this->SetGlyphType(VTK_VERTEX_GLYPH);} 00136 void SetGlyphTypeToDash() {this->SetGlyphType(VTK_DASH_GLYPH);} 00137 void SetGlyphTypeToCross() {this->SetGlyphType(VTK_CROSS_GLYPH);} 00138 void SetGlyphTypeToThickCross() {this->SetGlyphType(VTK_THICKCROSS_GLYPH);} 00139 void SetGlyphTypeToTriangle() {this->SetGlyphType(VTK_TRIANGLE_GLYPH);} 00140 void SetGlyphTypeToSquare() {this->SetGlyphType(VTK_SQUARE_GLYPH);} 00141 void SetGlyphTypeToCircle() {this->SetGlyphType(VTK_CIRCLE_GLYPH);} 00142 void SetGlyphTypeToDiamond() {this->SetGlyphType(VTK_DIAMOND_GLYPH);} 00143 void SetGlyphTypeToArrow() {this->SetGlyphType(VTK_ARROW_GLYPH);} 00144 void SetGlyphTypeToThickArrow() {this->SetGlyphType(VTK_THICKARROW_GLYPH);} 00145 void SetGlyphTypeToHookedArrow() {this->SetGlyphType(VTK_HOOKEDARROW_GLYPH);} 00146 void SetGlyphTypeToEdgeArrow() {this->SetGlyphType(VTK_EDGEARROW_GLYPH);} 00148 00150 00154 vtkSetMacro(OutputPointsPrecision,int); 00155 vtkGetMacro(OutputPointsPrecision,int); 00157 00158 protected: 00159 vtkGlyphSource2D(); 00160 ~vtkGlyphSource2D() {} 00161 00162 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00163 00164 double Center[3]; 00165 double Scale; 00166 double Scale2; 00167 double Color[3]; 00168 int Filled; 00169 int Dash; 00170 int Cross; 00171 int GlyphType; 00172 double RotationAngle; 00173 int OutputPointsPrecision; 00174 00175 void TransformGlyph(vtkPoints *pts); 00176 void ConvertColor(); 00177 unsigned char RGB[3]; 00178 00179 void CreateVertex(vtkPoints *pts, vtkCellArray *verts, 00180 vtkUnsignedCharArray *colors); 00181 void CreateDash(vtkPoints *pts, vtkCellArray *lines, 00182 vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale); 00183 void CreateCross(vtkPoints *pts, vtkCellArray *lines, 00184 vtkCellArray *polys, vtkUnsignedCharArray *colors, double scale); 00185 void CreateThickCross(vtkPoints *pts, vtkCellArray *lines, 00186 vtkCellArray *polys, vtkUnsignedCharArray *colors); 00187 void CreateTriangle(vtkPoints *pts, vtkCellArray *lines, 00188 vtkCellArray *polys, vtkUnsignedCharArray *colors); 00189 void CreateSquare(vtkPoints *pts, vtkCellArray *lines, 00190 vtkCellArray *polys, vtkUnsignedCharArray *colors); 00191 void CreateCircle(vtkPoints *pts, vtkCellArray *lines, 00192 vtkCellArray *polys, vtkUnsignedCharArray *colors); 00193 void CreateDiamond(vtkPoints *pts, vtkCellArray *lines, 00194 vtkCellArray *polys, vtkUnsignedCharArray *colors); 00195 void CreateArrow(vtkPoints *pts, vtkCellArray *lines, 00196 vtkCellArray *polys, vtkUnsignedCharArray *colors); 00197 void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines, 00198 vtkCellArray *polys, vtkUnsignedCharArray *colors); 00199 void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines, 00200 vtkCellArray *polys, vtkUnsignedCharArray *colors); 00201 void CreateEdgeArrow(vtkPoints *pts, vtkCellArray *lines, 00202 vtkCellArray *polys, vtkUnsignedCharArray *colors); 00203 00204 private: 00205 vtkGlyphSource2D(const vtkGlyphSource2D&); // Not implemented. 00206 void operator=(const vtkGlyphSource2D&); // Not implemented. 00207 }; 00208 00209 #endif