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

graphics/vtkTubeFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkTubeFilter.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 =========================================================================*/
00075 #ifndef __vtkTubeFilter_h
00076 #define __vtkTubeFilter_h
00077 
00078 #include "vtkPolyDataToPolyDataFilter.h"
00079 
00080 #define VTK_VARY_RADIUS_OFF 0
00081 #define VTK_VARY_RADIUS_BY_SCALAR 1
00082 #define VTK_VARY_RADIUS_BY_VECTOR 2
00083 
00084 class VTK_EXPORT vtkTubeFilter : public vtkPolyDataToPolyDataFilter
00085 {
00086 public:
00087   vtkTypeMacro(vtkTubeFilter,vtkPolyDataToPolyDataFilter);
00088   void PrintSelf(ostream& os, vtkIndent indent);
00089 
00092   static vtkTubeFilter *New();
00093 
00096   vtkSetClampMacro(Radius,float,0.0,VTK_LARGE_FLOAT);
00097   vtkGetMacro(Radius,float);
00098 
00100   vtkSetClampMacro(VaryRadius,int,
00101                    VTK_VARY_RADIUS_OFF,VTK_VARY_RADIUS_BY_VECTOR);
00102   vtkGetMacro(VaryRadius,int);
00103   void SetVaryRadiusToVaryRadiusOff()
00104     {this->SetVaryRadius(VTK_VARY_RADIUS_OFF);};
00105   void SetVaryRadiusToVaryRadiusByScalar()
00106     {this->SetVaryRadius(VTK_VARY_RADIUS_BY_SCALAR);};
00107   void SetVaryRadiusToVaryRadiusByVector()
00108     {this->SetVaryRadius(VTK_VARY_RADIUS_BY_VECTOR);};
00109   const char *GetVaryRadiusAsString();
00110 
00113   vtkSetClampMacro(NumberOfSides,int,3,VTK_LARGE_INTEGER);
00114   vtkGetMacro(NumberOfSides,int);
00115 
00118   vtkSetMacro(RadiusFactor,float);
00119   vtkGetMacro(RadiusFactor,float);
00120 
00123   vtkSetVector3Macro(DefaultNormal,float);
00124   vtkGetVectorMacro(DefaultNormal,float,3);
00125 
00128   vtkSetMacro(UseDefaultNormal,int);
00129   vtkGetMacro(UseDefaultNormal,int);
00130   vtkBooleanMacro(UseDefaultNormal,int);
00131 
00133   vtkSetMacro(Capping,int);
00134   vtkGetMacro(Capping,int);
00135   vtkBooleanMacro(Capping,int);
00136 
00139   vtkSetClampMacro(OnRatio,int,1,VTK_LARGE_INTEGER);
00140   vtkGetMacro(OnRatio,int);
00141 
00145   vtkSetClampMacro(Offset,int,0,VTK_LARGE_INTEGER);
00146   vtkGetMacro(Offset,int);
00147 
00148 protected:
00149   vtkTubeFilter();
00150   ~vtkTubeFilter() {};
00151   vtkTubeFilter(const vtkTubeFilter&) {};
00152   void operator=(const vtkTubeFilter&) {};
00153 
00154   // Usual data generation method
00155   void Execute();
00156 
00157   float Radius; //minimum radius of tube
00158   int VaryRadius; //controls radius variation
00159   int NumberOfSides; //number of sides to create tube
00160   float RadiusFactor; //maxium allowablew radius
00161   float DefaultNormal[3];
00162   int UseDefaultNormal;
00163   int Capping;
00164   int OnRatio; //control the generation of the sides of the tube
00165   int Offset;  //control the generation of the sides
00166   
00167 };
00168 
00170 inline const char *vtkTubeFilter::GetVaryRadiusAsString(void)
00171 {
00172   if ( this->VaryRadius == VTK_VARY_RADIUS_OFF )
00173     {
00174     return "VaryRadiusOff";
00175     }
00176   else if ( this->VaryRadius == VTK_VARY_RADIUS_BY_SCALAR ) 
00177     {
00178     return "VaryRadiusByScalar";
00179     }
00180   else 
00181     {
00182     return "VaryRadiusByVector";
00183     }
00184 }
00185 
00186 
00187 #endif
00188 
00189 

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