proj home

Files   Classes   Functions   Hierarchy  

d2func.h

Go to the documentation of this file.
00001 #ifndef D2FUNC_H
00002 #define D2FUNC_H
00003 
00004 #include <point.h>
00005 
00006 //
00007 //  Brief:  A function takes an argument and returns a value.
00008 //          This class takes a 2D point and makes a 3D point. 
00009 class d2func
00010 {
00011 public:
00012 
00013   // Destructor
00014   virtual ~d2func() {}
00015 
00016   // Clients derive d2func and define the function here.
00017   virtual double const eval(point2<double> const & X) const=0;
00018 
00019   // Make a 3D point from a point on the 2D surface.
00020   point3<double> const make(double const x, double const y) const 
00021     { return point3<double>(x,y,this->eval( point2<double>(x,y) ) ); }
00022 
00023   // Make a 3D point from a point on the 2D surface.
00024   point3<double> const make(point2<double> const & x) const
00025     { return make(x.x,x.y); }
00026 
00027 };
00028 
00029 #endif
00030 

Generated on Fri Mar 4 00:49:26 2011 for Chelton Evans Source by  doxygen 1.5.8