include/vamos/geometry/Interpolator.h

Go to the documentation of this file.
00001 //      Vamos Automotive Simulator
00002 //  Copyright (C) 2001--2002 Sam Varner
00003 //
00004 //  This program is free software; you can redistribute it and/or modify
00005 //  it under the terms of the GNU General Public License as published by
00006 //  the Free Software Foundation; either version 2 of the License, or
00007 //  (at your option) any later version.
00008 //
00009 //  This program is distributed in the hope that it will be useful,
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 //  GNU General Public License for more details.
00013 //
00014 //  You should have received a copy of the GNU General Public License
00015 //  along with this program; if not, write to the Free Software
00016 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 #ifndef _INTERPOLATOR_H_
00019 #define _INTERPOLATOR_H_
00020 
00021 #include <vamos/geometry/Two_Point.h>
00022 #include <vector>
00023 
00024 namespace Vamos_Geometry
00025 {
00026   class Interpolator
00027   {
00028   public:
00029         // Construct an empty curve.
00030         Interpolator () {};
00031 
00032         // Construct a cuvre from an array of points.
00033         Interpolator (const std::vector <Two_Point>& points) {};
00034 
00035         //virtual ~Interpolator () {};
00036 
00037         // Add a point to the curve.
00038         virtual void load (const Two_Point& point) = 0;
00039 
00040         // Add multiple points to the curve.
00041         virtual void load (const std::vector <Two_Point>& points) = 0;
00042   
00043         // Remove all points from the curve.
00044         virtual void clear () = 0;
00045 
00046         // Remove points with x > LIMIT.
00047         virtual void remove_greater (double limit) = 0;
00048 
00049         // Scale all of the x values by FACTOR.
00050         virtual void scale (double factor) = 0;
00051 
00052         // Return the y value at the x value DIST
00053         virtual double interpolate (double dist) const = 0;
00054 
00055         // Return the normal to the tanget at DIST.
00056         virtual Two_Point normal (double dist) const = 0;
00057   };
00058 }
00059 
00060 #endif

Generated on Thu Oct 19 04:05:48 2006 by  doxygen 1.4.6