00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2008 University of Malaga | 00007 | | 00008 | This software was written by the Machine Perception and Intelligent | 00009 | Robotics Lab, University of Malaga (Spain). | 00010 | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> | 00011 | | 00012 | This file is part of the MRPT project. | 00013 | | 00014 | MRPT is free software: you can redistribute it and/or modify | 00015 | it under the terms of the GNU General Public License as published by | 00016 | the Free Software Foundation, either version 3 of the License, or | 00017 | (at your option) any later version. | 00018 | | 00019 | MRPT is distributed in the hope that it will be useful, | 00020 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00021 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 00022 | GNU General Public License for more details. | 00023 | | 00024 | You should have received a copy of the GNU General Public License | 00025 | along with MRPT. If not, see <http://www.gnu.org/licenses/>. | 00026 | | 00027 +---------------------------------------------------------------------------+ */ 00028 #ifndef CSplineInterpolator1D_H 00029 #define CSplineInterpolator1D_H 00030 00031 #include <mrpt/utils/utils_defs.h> 00032 #include <mrpt/utils/CSerializable.h> 00033 #include <mrpt/utils/stl_extensions.h> 00034 00035 namespace mrpt 00036 { 00037 namespace math 00038 { 00039 // This must be added to any CSerializable derived class: 00040 DEFINE_SERIALIZABLE_PRE( CSplineInterpolator1D ) 00041 00042 00047 class MRPTDLLIMPEXP CSplineInterpolator1D : public mrpt::utils::CSerializable 00048 { 00049 // This must be added to any CSerializable derived class: 00050 DEFINE_SERIALIZABLE( CSplineInterpolator1D ) 00051 00052 private: 00054 mrpt::utils::map_serializable<double,double> m_x2y; 00055 00056 bool m_wrap2pi; 00057 00058 public: 00060 CSplineInterpolator1D( 00061 const std::vector<double> &initial_x, 00062 const std::vector<double> &initial_y, 00063 bool wrap2pi = false 00064 ); 00065 00067 CSplineInterpolator1D( bool wrap2pi = false ); 00068 00070 void setWrap2pi(bool wrap) { m_wrap2pi=wrap; } 00071 00073 bool getWrap2pi() { return m_wrap2pi; } 00074 00078 void setXY( const std::vector<double> &x, const std::vector<double> &y, bool clearPreviousContent = true ); 00079 00081 void appendXY( double x, double y ); 00082 00084 void clear() { m_x2y.clear(); } 00085 00091 double &query( double x, double &y, bool &out_valid ) const; 00092 00097 bool queryVector( const vector_double &x, vector_double &out_y ) const; 00098 00099 }; 00100 00101 } // End of namespace 00102 } // End of namespace 00103 #endif
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN:exported at Mon Jan 12 13:00:16 UTC 2009 |