interpolater.hxx

Go to the documentation of this file.
00001 
00007 // Written by Curtis Olson, started April 1998.
00008 //
00009 // Copyright (C) 1998  Curtis L. Olson  - http://www.flightgear.org/~curt
00010 //
00011 // This library is free software; you can redistribute it and/or
00012 // modify it under the terms of the GNU Library General Public
00013 // License as published by the Free Software Foundation; either
00014 // version 2 of the License, or (at your option) any later version.
00015 //
00016 // This library is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 // Library General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU General Public License
00022 // along with this program; if not, write to the Free Software
00023 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00024 //
00025 // $Id: interpolater_8hxx-source.html,v 1.15 2007-12-17 15:37:04 curt Exp $
00026 
00027 
00028 #ifndef _INTERPOLATER_H
00029 #define _INTERPOLATER_H
00030 
00031 
00032 #ifndef __cplusplus
00033 # error This library requires C++
00034 #endif
00035 
00036 #include <simgear/compiler.h>
00037 
00038 #include "simgear/structure/SGReferenced.hxx"
00039 
00040 #include <map>
00041 
00042 #include STL_STRING
00043 SG_USING_STD(string);
00044 
00045 class SGPropertyNode;
00046 
00053 class SGInterpTable : public SGReferenced {
00054 public:
00055 
00059     SGInterpTable();
00060 
00066     SGInterpTable(const SGPropertyNode* interpolation);
00067 
00072     SGInterpTable( const string& file );
00073 
00074 
00081     void addEntry (double ind, double dep);
00082     
00083 
00089     double interpolate(double x) const;
00090 
00092     ~SGInterpTable();
00093 
00094 private:
00095     typedef std::map<double, double> Table;
00096     Table _table;
00097 };
00098 
00099 
00100 #endif // _INTERPOLATER_H
00101 
00102 

Generated on Mon Dec 17 09:30:54 2007 for SimGear by  doxygen 1.5.1