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 =========================================================================*/
00079 #ifndef __vtkTubeFilter_h
00080 #define __vtkTubeFilter_h
00081 
00082 #include "vtkPolyDataToPolyDataFilter.h"
00083 
00084 #define VTK_VARY_RADIUS_OFF 0
00085 #define VTK_VARY_RADIUS_BY_SCALAR 1
00086 #define VTK_VARY_RADIUS_BY_VECTOR 2
00087 
00088 class VTK_GRAPHICS_EXPORT vtkTubeFilter : public vtkPolyDataToPolyDataFilter
00089 {
00090 public:
00091   vtkTypeMacro(vtkTubeFilter,vtkPolyDataToPolyDataFilter);
00092   void PrintSelf(ostream& os, vtkIndent indent);
00093 
00096   static vtkTubeFilter *New();
00097 
00099 
00101   vtkSetClampMacro(Radius,float,0.0,VTK_LARGE_FLOAT);
00102   vtkGetMacro(Radius,float);
00104 
00106 
00107   vtkSetClampMacro(VaryRadius,int,
00108                    VTK_VARY_RADIUS_OFF,VTK_VARY_RADIUS_BY_VECTOR);
00109   vtkGetMacro(VaryRadius,int);
00110   void SetVaryRadiusToVaryRadiusOff()
00111     {this->SetVaryRadius(VTK_VARY_RADIUS_OFF);};
00112   void SetVaryRadiusToVaryRadiusByScalar()
00113     {this->SetVaryRadius(VTK_VARY_RADIUS_BY_SCALAR);};
00114   void SetVaryRadiusToVaryRadiusByVector()
00115     {this->SetVaryRadius(VTK_VARY_RADIUS_BY_VECTOR);};
00116   const char *GetVaryRadiusAsString();
00118 
00120 
00122   vtkSetClampMacro(NumberOfSides,int,3,VTK_LARGE_INTEGER);
00123   vtkGetMacro(NumberOfSides,int);
00125 
00127 
00129   vtkSetMacro(RadiusFactor,float);
00130   vtkGetMacro(RadiusFactor,float);
00132 
00134 
00136   vtkSetVector3Macro(DefaultNormal,float);
00137   vtkGetVectorMacro(DefaultNormal,float,3);
00139 
00141 
00143   vtkSetMacro(UseDefaultNormal,int);
00144   vtkGetMacro(UseDefaultNormal,int);
00145   vtkBooleanMacro(UseDefaultNormal,int);
00147 
00149 
00150   vtkSetMacro(Capping,int);
00151   vtkGetMacro(Capping,int);
00152   vtkBooleanMacro(Capping,int);
00154 
00156 
00158   vtkSetClampMacro(OnRatio,int,1,VTK_LARGE_INTEGER);
00159   vtkGetMacro(OnRatio,int);
00161 
00163 
00166   vtkSetClampMacro(Offset,int,0,VTK_LARGE_INTEGER);
00167   vtkGetMacro(Offset,int);
00169 
00170 protected:
00171   vtkTubeFilter();
00172   ~vtkTubeFilter() {};
00173 
00174   // Usual data generation method
00175   void Execute();
00176 
00177   float Radius; //minimum radius of tube
00178   int VaryRadius; //controls radius variation
00179   int NumberOfSides; //number of sides to create tube
00180   float RadiusFactor; //maxium allowablew radius
00181   float DefaultNormal[3];
00182   int UseDefaultNormal;
00183   int Capping;
00184   int OnRatio; //control the generation of the sides of the tube
00185   int Offset;  //control the generation of the sides
00186   
00187 private:
00188   vtkTubeFilter(const vtkTubeFilter&);  // Not implemented.
00189   void operator=(const vtkTubeFilter&);  // Not implemented.
00190 };
00191 
00193 inline const char *vtkTubeFilter::GetVaryRadiusAsString(void)
00194 {
00195   if ( this->VaryRadius == VTK_VARY_RADIUS_OFF )
00196     {
00197     return "VaryRadiusOff";
00198     }
00199   else if ( this->VaryRadius == VTK_VARY_RADIUS_BY_SCALAR ) 
00200     {
00201     return "VaryRadiusByScalar";
00202     }
00203   else 
00204     {
00205     return "VaryRadiusByVector";
00206     }
00207 }
00208 
00209 
00210 #endif

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