//=========================================================================== // GoTools Core - SINTEF Geometry Tools Core library, version 2.0.1 // // Copyright (C) 2000-2007, 2010 SINTEF ICT, Applied Mathematics, Norway. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., // 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // // Contact information: E-mail: tor.dokken@sintef.no // SINTEF ICT, Department of Applied Mathematics, // P.O. Box 124 Blindern, // 0314 Oslo, Norway. // // Other licenses are also available for this software, notably licenses // for: // - Building commercial software. // - Building software whose source code you wish to keep private. //=========================================================================== 00015 #ifndef _SPLINEAPPROXIMATOR_H 00016 #define _SPLINEAPPROXIMATOR_H 00017 00018 00019 #include "GoTools/geometry/Interpolator.h" 00020 #include "GoTools/geometry/BsplineBasis.h" 00021 00022 namespace Go 00023 { 00024 00025 00029 class SplineApproximator : public Interpolator 00030 { 00031 public: 00033 SplineApproximator() 00034 : num_coefs_(0) 00035 { 00036 } 00037 00039 virtual ~SplineApproximator(); 00040 00041 // inherited from Interpolator 00042 virtual const BsplineBasis& basis(); 00043 00053 virtual void interpolate(int num_points, 00054 int dimension, 00055 const double* param_start, 00056 const double* data_start, 00057 std::vector<double>& coefs); 00058 00061 void setNumCoefs(int num) { 00062 num_coefs_ = num; 00063 } 00064 00067 void setSplineSpace(const BsplineBasis& basis) { 00068 basis_ = basis; 00069 } 00070 00071 00072 private: 00073 int num_coefs_; 00074 BsplineBasis basis_; 00075 }; 00076 00077 00078 } // namespace Go 00079 00080 00081 #endif // _SPLINEAPPROXIMATOR_H 00082