Graphics/vtkGlyphSource2D.h Source File

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# Graphics/vtkGlyphSource2D.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkGlyphSource2D.h,v $
    00005   Language:  C++
    00006
    00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
    00008   All rights reserved.
    00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
    00010
    00011      This software is distributed WITHOUT ANY WARRANTY; without even
    00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00013      PURPOSE.  See the above copyright notice for more information.
    00014
    00015 =========================================================================*/
    00049 #ifndef __vtkGlyphSource2D_h
    00050 #define __vtkGlyphSource2D_h
    00051
    00052 #include "vtkPolyDataSource.h"
    00053
    00054 #define VTK_NO_GLYPH 0
    00055 #define VTK_VERTEX_GLYPH 1
    00056 #define VTK_DASH_GLYPH 2
    00057 #define VTK_CROSS_GLYPH 3
    00058 #define VTK_THICKCROSS_GLYPH 4
    00059 #define VTK_TRIANGLE_GLYPH 5
    00060 #define VTK_SQUARE_GLYPH 6
    00061 #define VTK_CIRCLE_GLYPH 7
    00062 #define VTK_DIAMOND_GLYPH 8
    00063 #define VTK_ARROW_GLYPH 9
    00064 #define VTK_THICKARROW_GLYPH 10
    00065 #define VTK_HOOKEDARROW_GLYPH 11
    00066
    00067 class vtkPoints;
    00068 class vtkUnsignedCharArray;
    00069 class vtkCellArray;
    00070
    00071 class VTK_GRAPHICS_EXPORT vtkGlyphSource2D : public vtkPolyDataSource
    00072 {
    00073 public:
    00074   vtkTypeRevisionMacro(vtkGlyphSource2D,vtkPolyDataSource);
    00075   void PrintSelf(ostream& os, vtkIndent indent);
    00076
    00079   static vtkGlyphSource2D *New();
    00080
    00082
    00083   vtkSetVector3Macro(Center,float);
    00084   vtkGetVectorMacro(Center,float,3);
    00086
    00088
    00090   vtkSetClampMacro(Scale,float,0.0,VTK_LARGE_FLOAT);
    00091   vtkGetMacro(Scale,float);
    00093
    00095
    00097   vtkSetClampMacro(Scale2,float,0.0,VTK_LARGE_FLOAT);
    00098   vtkGetMacro(Scale2,float);
    00100
    00102
    00103   vtkSetVector3Macro(Color,float);
    00104   vtkGetVectorMacro(Color,float,3);
    00106
    00108
    00111   vtkSetMacro(Filled,int);
    00112   vtkGetMacro(Filled,int);
    00113   vtkBooleanMacro(Filled,int);
    00115
    00117
    00120   vtkSetMacro(Dash,int);
    00121   vtkGetMacro(Dash,int);
    00122   vtkBooleanMacro(Dash,int);
    00124
    00126
    00129   vtkSetMacro(Cross,int);
    00130   vtkGetMacro(Cross,int);
    00131   vtkBooleanMacro(Cross,int);
    00133
    00135
    00138   vtkSetMacro(RotationAngle,float);
    00139   vtkGetMacro(RotationAngle,float);
    00141
    00143
    00144   vtkSetClampMacro(GlyphType,int,VTK_NO_GLYPH,VTK_HOOKEDARROW_GLYPH);
    00145   vtkGetMacro(GlyphType,int);
    00146   void SetGlyphTypeToNone() {this->SetGlyphType(VTK_NO_GLYPH);}
    00147   void SetGlyphTypeToVertex() {this->SetGlyphType(VTK_VERTEX_GLYPH);}
    00148   void SetGlyphTypeToDash() {this->SetGlyphType(VTK_DASH_GLYPH);}
    00149   void SetGlyphTypeToCross() {this->SetGlyphType(VTK_CROSS_GLYPH);}
    00150   void SetGlyphTypeToThickCross() {this->SetGlyphType(VTK_THICKCROSS_GLYPH);}
    00151   void SetGlyphTypeToTriangle() {this->SetGlyphType(VTK_TRIANGLE_GLYPH);}
    00152   void SetGlyphTypeToSquare() {this->SetGlyphType(VTK_SQUARE_GLYPH);}
    00153   void SetGlyphTypeToCircle() {this->SetGlyphType(VTK_CIRCLE_GLYPH);}
    00154   void SetGlyphTypeToDiamond() {this->SetGlyphType(VTK_DIAMOND_GLYPH);}
    00155   void SetGlyphTypeToArrow() {this->SetGlyphType(VTK_ARROW_GLYPH);}
    00156   void SetGlyphTypeToThickArrow() {this->SetGlyphType(VTK_THICKARROW_GLYPH);}
    00157   void SetGlyphTypeToHookedArrow() {this->SetGlyphType(VTK_HOOKEDARROW_GLYPH);}
    00159
    00160 protected:
    00161   vtkGlyphSource2D();
    00162   ~vtkGlyphSource2D() {};
    00163
    00164   void Execute();
    00165
    00166   float Center[3];
    00167   float Scale;
    00168   float Scale2;
    00169   float Color[3];
    00170   int   Filled;
    00171   int   Dash;
    00172   int   Cross;
    00173   int   GlyphType;
    00174   float RotationAngle;
    00175
    00176   void TransformGlyph(vtkPoints *pts);
    00177   void ConvertColor();
    00178   unsigned char RGB[3];
    00179
    00180   void CreateVertex(vtkPoints *pts, vtkCellArray *verts,
    00181                     vtkUnsignedCharArray *colors);
    00182   void CreateDash(vtkPoints *pts, vtkCellArray *lines,
    00183                   vtkCellArray *polys, vtkUnsignedCharArray *colors, float scale);
    00184   void CreateCross(vtkPoints *pts, vtkCellArray *lines,
    00185                    vtkCellArray *polys, vtkUnsignedCharArray *colors, float scale);
    00186   void CreateThickCross(vtkPoints *pts, vtkCellArray *lines,
    00187                         vtkCellArray *polys, vtkUnsignedCharArray *colors);
    00188   void CreateTriangle(vtkPoints *pts, vtkCellArray *lines,
    00189                       vtkCellArray *polys, vtkUnsignedCharArray *colors);
    00190   void CreateSquare(vtkPoints *pts, vtkCellArray *lines,
    00191                     vtkCellArray *polys, vtkUnsignedCharArray *colors);
    00192   void CreateCircle(vtkPoints *pts, vtkCellArray *lines,
    00193                     vtkCellArray *polys, vtkUnsignedCharArray *colors);
    00194   void CreateDiamond(vtkPoints *pts, vtkCellArray *lines,
    00195                      vtkCellArray *polys, vtkUnsignedCharArray *colors);
    00196   void CreateArrow(vtkPoints *pts, vtkCellArray *lines,
    00197                    vtkCellArray *polys, vtkUnsignedCharArray *colors);
    00198   void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines,
    00199                         vtkCellArray *polys, vtkUnsignedCharArray *colors);
    00200   void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines,
    00201                          vtkCellArray *polys, vtkUnsignedCharArray *colors);
    00202
    00203 private:
    00204   vtkGlyphSource2D(const vtkGlyphSource2D&);  // Not implemented.
    00205   void operator=(const vtkGlyphSource2D&);  // Not implemented.
    00206 };
    00207
    00208 #endif
    00209
    00210