Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Cylinder.h

Go to the documentation of this file.
00001 // $Id: Cylinder.h,v 1.2 2000/01/18 00:42:06 burnett Exp $
00002 //
00003 //
00004 
00005 #ifndef __CYLINDER_H
00006 #define __CYLINDER_H
00007 
00008 #include "geometry/Surface.h"
00009 
00010 
00012 /*
00013   Sign of radius parameter determines inside/outside:
00014     positive: "inside" is inside the cylinder.
00015 */
00016 class Cylinder: public Surface
00017 {
00018 
00019 public:
00021   Cylinder(const Point& origin, double radius);
00023   Cylinder( const Point& origin, const Vector& axis, double radius );
00024 
00025   double how_near( const Point& x ) const;
00026   double distance( const Point& x, const Vector& v, int inout)const;
00027   // basic specification of this surface
00028 
00030    virtual Vector normal( const Point& x )const;
00031 
00033   const Vector& axis()const{return Surface::direction();}
00034 
00035   const char *nameOf() const { return "Cylinder"; }
00036   void printOn( std::ostream& os = std::cout ) const;
00037 
00038   double radius()const{return _radius;}
00039   virtual void setOffset(double offset){_radius=offset;};
00040   virtual double offset()const{return _radius;};
00041         
00042 
00043  private:
00044         double _radius; // radius of Cylinder (sign indicates inside/outside)
00045 };
00046 
00047 #endif
00048 

Generated at Wed Nov 21 12:20:12 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000