//=========================================================================== // 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. //===========================================================================
00001 #ifndef _INTCRVEVALUATOR_ 00002 #define _INTCRVEVALUATOR_ 00003 00004 #include "GoTools/creators/EvalCurveSet.h" 00005 #include "GoTools/geometry/CurveOnSurface.h" 00006 #include "GoTools/utils/Point.h" 00007 00008 namespace Go 00009 { 00012 class IntCrvEvaluator : public EvalCurveSet 00013 { 00014 public: 00016 IntCrvEvaluator(boost::shared_ptr<CurveOnSurface> sfcv1, 00017 double start1, double end1, 00018 boost::shared_ptr<CurveOnSurface> sfcv2, 00019 double start2, double end2, 00020 bool same_orientation, 00021 int keep_crv = 0); 00022 00024 virtual ~IntCrvEvaluator(); 00025 00029 virtual std::vector<Point> eval(double t); 00030 00035 virtual void eval(double t, int n, std::vector<std::vector<Point> >& der); // n = order of diff 00036 00039 virtual double start(); 00040 00043 virtual double end(); 00044 00047 virtual int dim(); 00048 00056 virtual bool approximationOK(double par, const std::vector<Point>& approxpos, 00057 double tol1, double tol2); 00058 00061 virtual int nmbCvs(); 00062 00064 virtual void resetErr() 00065 { 00066 max_err_ = 0.0; 00067 } 00068 00069 // Get maximum error 00070 double getMaxErr() 00071 { 00072 return std::max(max_dist_, max_err_); 00073 } 00074 00075 private: 00076 boost::shared_ptr<CurveOnSurface> sfcv1_; 00077 double start1_; 00078 double end1_; 00079 boost::shared_ptr<CurveOnSurface> sfcv2_; 00080 double start2_; 00081 double end2_; 00082 bool same_orientation_; 00083 int keep_crv_; 00084 double max_dist_; 00085 double max_err_; 00086 00087 void evaluate(double t, int n, std::vector<Point>& result); 00088 }; 00089 00090 } // namespace Go 00091 00092 #endif //_INTCRVEVALUATOR_