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 
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 =========================================================================*/
00066 #ifndef __vtkGlyphSource2D_h
00067 #define __vtkGlyphSource2D_h
00068 
00069 #include "vtkPolyDataSource.h"
00070 
00071 #define VTK_NO_GLYPH 0
00072 #define VTK_VERTEX_GLYPH 1
00073 #define VTK_DASH_GLYPH 2
00074 #define VTK_CROSS_GLYPH 3
00075 #define VTK_THICKCROSS_GLYPH 4
00076 #define VTK_TRIANGLE_GLYPH 5
00077 #define VTK_SQUARE_GLYPH 6
00078 #define VTK_CIRCLE_GLYPH 7
00079 #define VTK_DIAMOND_GLYPH 8
00080 #define VTK_ARROW_GLYPH 9
00081 #define VTK_THICKARROW_GLYPH 10
00082 #define VTK_HOOKEDARROW_GLYPH 11
00083 
00084 class VTK_GRAPHICS_EXPORT vtkGlyphSource2D : public vtkPolyDataSource 
00085 {
00086 public:
00087   vtkTypeMacro(vtkGlyphSource2D,vtkPolyDataSource);
00088   void PrintSelf(ostream& os, vtkIndent indent);
00089 
00092   static vtkGlyphSource2D *New();
00093 
00095 
00096   vtkSetVector3Macro(Center,float);
00097   vtkGetVectorMacro(Center,float,3);
00099 
00101 
00103   vtkSetClampMacro(Scale,float,0.0,VTK_LARGE_FLOAT);
00104   vtkGetMacro(Scale,float);
00106 
00108 
00110   vtkSetClampMacro(Scale2,float,0.0,VTK_LARGE_FLOAT);
00111   vtkGetMacro(Scale2,float);
00113 
00115 
00116   vtkSetVector3Macro(Color,float);
00117   vtkGetVectorMacro(Color,float,3);
00119 
00121 
00124   vtkSetMacro(Filled,int);
00125   vtkGetMacro(Filled,int);
00126   vtkBooleanMacro(Filled,int);
00128 
00130 
00133   vtkSetMacro(Dash,int);
00134   vtkGetMacro(Dash,int);
00135   vtkBooleanMacro(Dash,int);
00137 
00139 
00142   vtkSetMacro(Cross,int);
00143   vtkGetMacro(Cross,int);
00144   vtkBooleanMacro(Cross,int);
00146 
00148 
00151   vtkSetMacro(RotationAngle,float);
00152   vtkGetMacro(RotationAngle,float);
00154 
00156 
00157   vtkSetClampMacro(GlyphType,int,VTK_NO_GLYPH,VTK_HOOKEDARROW_GLYPH);
00158   vtkGetMacro(GlyphType,int);
00159   void SetGlyphTypeToNone() {this->SetGlyphType(VTK_NO_GLYPH);}  
00160   void SetGlyphTypeToVertex() {this->SetGlyphType(VTK_VERTEX_GLYPH);}  
00161   void SetGlyphTypeToDash() {this->SetGlyphType(VTK_DASH_GLYPH);}  
00162   void SetGlyphTypeToCross() {this->SetGlyphType(VTK_CROSS_GLYPH);}
00163   void SetGlyphTypeToThickCross() {this->SetGlyphType(VTK_THICKCROSS_GLYPH);}
00164   void SetGlyphTypeToTriangle() {this->SetGlyphType(VTK_TRIANGLE_GLYPH);}
00165   void SetGlyphTypeToSquare() {this->SetGlyphType(VTK_SQUARE_GLYPH);}
00166   void SetGlyphTypeToCircle() {this->SetGlyphType(VTK_CIRCLE_GLYPH);}
00167   void SetGlyphTypeToDiamond() {this->SetGlyphType(VTK_DIAMOND_GLYPH);}
00168   void SetGlyphTypeToArrow() {this->SetGlyphType(VTK_ARROW_GLYPH);}
00169   void SetGlyphTypeToThickArrow() {this->SetGlyphType(VTK_THICKARROW_GLYPH);}
00170   void SetGlyphTypeToHookedArrow() {this->SetGlyphType(VTK_HOOKEDARROW_GLYPH);}
00172 
00173 protected:
00174   vtkGlyphSource2D();
00175   ~vtkGlyphSource2D() {};
00176 
00177   void Execute();
00178 
00179   float Center[3];
00180   float Scale;
00181   float Scale2;
00182   float Color[3];
00183   int   Filled;
00184   int   Dash;
00185   int   Cross;
00186   int   GlyphType;
00187   float RotationAngle;
00188   
00189   void TransformGlyph(vtkPoints *pts);
00190   void ConvertColor();
00191   unsigned char RGB[3];
00192   
00193   void CreateVertex(vtkPoints *pts, vtkCellArray *verts, 
00194                     vtkUnsignedCharArray *colors);
00195   void CreateDash(vtkPoints *pts, vtkCellArray *lines, 
00196                   vtkCellArray *polys, vtkUnsignedCharArray *colors, float scale);
00197   void CreateCross(vtkPoints *pts, vtkCellArray *lines, 
00198                    vtkCellArray *polys, vtkUnsignedCharArray *colors, float scale);
00199   void CreateThickCross(vtkPoints *pts, vtkCellArray *lines, 
00200                         vtkCellArray *polys, vtkUnsignedCharArray *colors);
00201   void CreateTriangle(vtkPoints *pts, vtkCellArray *lines,
00202                       vtkCellArray *polys, vtkUnsignedCharArray *colors);
00203   void CreateSquare(vtkPoints *pts, vtkCellArray *lines,
00204                     vtkCellArray *polys, vtkUnsignedCharArray *colors);
00205   void CreateCircle(vtkPoints *pts, vtkCellArray *lines,
00206                     vtkCellArray *polys, vtkUnsignedCharArray *colors);
00207   void CreateDiamond(vtkPoints *pts, vtkCellArray *lines,
00208                      vtkCellArray *polys, vtkUnsignedCharArray *colors);
00209   void CreateArrow(vtkPoints *pts, vtkCellArray *lines,
00210                    vtkCellArray *polys, vtkUnsignedCharArray *colors);
00211   void CreateThickArrow(vtkPoints *pts, vtkCellArray *lines,
00212                         vtkCellArray *polys, vtkUnsignedCharArray *colors);
00213   void CreateHookedArrow(vtkPoints *pts, vtkCellArray *lines,
00214                          vtkCellArray *polys, vtkUnsignedCharArray *colors);
00215 
00216 private:
00217   vtkGlyphSource2D(const vtkGlyphSource2D&);  // Not implemented.
00218   void operator=(const vtkGlyphSource2D&);  // Not implemented.
00219 };
00220 
00221 #endif
00222 
00223 

Generated on Thu Mar 28 14:19:21 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001