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

imaging/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 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00063 #ifndef __vtkGlyphSource2D_h
00064 #define __vtkGlyphSource2D_h
00065 
00066 #include "vtkPolyDataSource.h"
00067 
00068 #define VTK_NO_GLYPH 0
00069 #define VTK_VERTEX_GLYPH 1
00070 #define VTK_DASH_GLYPH 2
00071 #define VTK_CROSS_GLYPH 3
00072 #define VTK_THICKCROSS_GLYPH 4
00073 #define VTK_TRIANGLE_GLYPH 5
00074 #define VTK_SQUARE_GLYPH 6
00075 #define VTK_CIRCLE_GLYPH 7
00076 #define VTK_DIAMOND_GLYPH 8
00077 #define VTK_ARROW_GLYPH 9
00078 #define VTK_THICKARROW_GLYPH 10
00079 #define VTK_HOOKEDARROW_GLYPH 11
00080 
00081 class VTK_EXPORT vtkGlyphSource2D : public vtkPolyDataSource 
00082 {
00083 public:
00084   vtkTypeMacro(vtkGlyphSource2D,vtkPolyDataSource);
00085   void PrintSelf(ostream& os, vtkIndent indent);
00086 
00089   static vtkGlyphSource2D *New();
00090 
00092   vtkSetVector3Macro(Center,float);
00093   vtkGetVectorMacro(Center,float,3);
00094 
00097   vtkSetClampMacro(Scale,float,0.0,VTK_LARGE_FLOAT);
00098   vtkGetMacro(Scale,float);
00099 
00102   vtkSetClampMacro(Scale2,float,0.0,VTK_LARGE_FLOAT);
00103   vtkGetMacro(Scale2,float);
00104 
00106   vtkSetVector3Macro(Color,float);
00107   vtkGetVectorMacro(Color,float,3);
00108 
00112   vtkSetMacro(Filled,int);
00113   vtkGetMacro(Filled,int);
00114   vtkBooleanMacro(Filled,int);
00115 
00119   vtkSetMacro(Dash,int);
00120   vtkGetMacro(Dash,int);
00121   vtkBooleanMacro(Dash,int);
00122 
00126   vtkSetMacro(Cross,int);
00127   vtkGetMacro(Cross,int);
00128   vtkBooleanMacro(Cross,int);
00129 
00133   vtkSetMacro(RotationAngle,float);
00134   vtkGetMacro(RotationAngle,float);
00135   vtkBooleanMacro(RotationAngle,float);
00136 
00138   vtkSetClampMacro(GlyphType,int,VTK_NO_GLYPH,VTK_HOOKEDARROW_GLYPH);
00139   vtkGetMacro(GlyphType,int);
00140   void SetGlyphTypeToNone() {this->SetGlyphType(VTK_NO_GLYPH);}  
00141   void SetGlyphTypeToVertex() {this->SetGlyphType(VTK_VERTEX_GLYPH);}  
00142   void SetGlyphTypeToDash() {this->SetGlyphType(VTK_DASH_GLYPH);}  
00143   void SetGlyphTypeToCross() {this->SetGlyphType(VTK_CROSS_GLYPH);}
00144   void SetGlyphTypeToThickCross() {this->SetGlyphType(VTK_THICKCROSS_GLYPH);}
00145   void SetGlyphTypeToTriangle() {this->SetGlyphType(VTK_TRIANGLE_GLYPH);}
00146   void SetGlyphTypeToSquare() {this->SetGlyphType(VTK_SQUARE_GLYPH);}
00147   void SetGlyphTypeToCircle() {this->SetGlyphType(VTK_CIRCLE_GLYPH);}
00148   void SetGlyphTypeToDiamond() {this->SetGlyphType(VTK_DIAMOND_GLYPH);}
00149   void SetGlyphTypeToArrow() {this->SetGlyphType(VTK_ARROW_GLYPH);}
00150   void SetGlyphTypeToThickArrow() {this->SetGlyphType(VTK_THICKARROW_GLYPH);}
00151   void SetGlyphTypeToHookedArrow() {this->SetGlyphType(VTK_HOOKEDARROW_GLYPH);}
00152 
00153 protected:
00154   vtkGlyphSource2D();
00155   ~vtkGlyphSource2D() {};
00156   vtkGlyphSource2D(const vtkGlyphSource2D&) {};
00157   void operator=(const vtkGlyphSource2D&) {};
00158 
00159   void Execute();
00160 
00161   float Center[3];
00162   float Scale;
00163   float Scale2;
00164   float Color[3];
00165   int   Filled;
00166   int   Dash;
00167   int   Cross;
00168   int   GlyphType;
00169   float RotationAngle;
00170   
00171   void TransformGlyph(vtkPoints *pts);
00172   void ConvertColor();
00173   unsigned char RGB[3];
00174   
00175   void CreateVertex(vtkPoints *pts, vtkCellArray *verts, 
00176                     vtkUnsignedCharArray *colors);
00177   void CreateDash(vtkPoints *pts, vtkCellArray *lines, 
00178                   vtkCellArray *polys, vtkUnsignedCharArray *colors, float scale);
00179   void CreateCross(vtkPoints *pts, vtkCellArray *lines, 
00180                    vtkCellArray *polys, vtkUnsignedCharArray *colors, float scale);
00181   void CreateThickCross(vtkPoints *pts, vtkCellArray *lines, 
00182                         vtkCellArray *polys, vtkUnsignedCharArray *colors);
00183   void CreateTriangle(vtkPoints *pts, vtkCellArray *lines,
00184                       vtkCellArray *polys, vtkUnsignedCharArray *colors);
00185   void CreateSquare(vtkPoints *pts, vtkCellArray *lines,
00186                     vtkCellArray *polys, vtkUnsignedCharArray *colors);
00187   void CreateCircle(vtkPoints *pts, vtkCellArray *lines,
00188                     vtkCellArray *polys, vtkUnsignedCharArray *colors);
00189   void CreateDiamond(vtkPoints *pts, vtkCellArray *lines,
00190                      vtkCellArray *polys, vtkUnsignedCharArray *colors);
00191   void CreateArrow(vtkPoints *pts, vtkCellArray *lines,
00192                    vtkCellArray *polys, vtkUnsignedCharArray *colors);
00193   void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines,
00194                         vtkCellArray *polys, vtkUnsignedCharArray *colors);
00195   void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines,
00196                          vtkCellArray *polys, vtkUnsignedCharArray *colors);
00197 
00198 };
00199 
00200 #endif
00201 
00202 

Generated on Wed Nov 21 12:27:05 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001