//=========================================================================== // 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 _CLOSESTPTCURVES2D_H 00016 #define _CLOSESTPTCURVES2D_H 00017 00029 #include "GoTools/geometry/ParamCurve.h" 00030 00031 namespace Go { 00032 00057 void closestPtCurves2D(ParamCurve* cv1, ParamCurve* cv2, double aepsge, 00058 double tmin1, double tmax1, double tmin2, double tmax2, 00059 double seed1, double seed2, int method, bool quick, 00060 double& par1, double& par2, double& dist, 00061 Point& ptc1, Point& ptc2, int& istat); 00062 00063 00064 // Anonymous namespace 00065 namespace { 00075 void insideParamDomain2D(Point& gd, const Point& acoef, double astart1, 00076 double aend1, double astart2,double aend2, int& corr); 00077 00078 00096 void nextStep2D(double& dist, Point& diff, Point& delta, double& det, 00097 int& kstat, std::vector<Point>& eval1, 00098 std::vector<Point>& eval2, int method); 00099 00100 00117 void makeEqSys1(double A[], double b[], const std::vector<Point>& eval1, 00118 const std::vector<Point>&eval2, const Point& diff); 00119 00120 00139 void makeEqSys2(double A[], double b[], const std::vector<Point>& eval1, 00140 const std::vector<Point>&eval2, const Point& diff); 00141 00142 00161 void makeEqSys3(double A[], double b[], const std::vector<Point>& eval1, 00162 const std::vector<Point>&eval2, const Point& diff); 00163 00164 00174 int localPretop(double dist,const Point& diff, 00175 const std::vector<Point>& eval1, 00176 const std::vector<Point>& eval2); 00177 00178 00195 void singular(ParamCurve* cv1, ParamCurve* cv2,Point& par_val,double& dist, 00196 int quick,double aepsge,double delta,const Point& diff, 00197 const std::vector<Point>&eval1,const std::vector<Point>&eval2, 00198 double astart1,double astart2,double aend1,double aend2); 00199 00200 00214 void secant2D(ParamCurve *pcurve1,ParamCurve *pcurve2,Point& par_val, 00215 double& dist,int& jstat, double delta,double aepsge, 00216 double astart1,double astart2,double aend1,double aend2); 00217 00218 00231 void setReturnValues(const Point& par_val,ParamCurve* cv1,ParamCurve* cv2, 00232 double aepsge, int& jstat,double& par1,double& par2, 00233 double& dist,Point& ptc1,Point& ptc2); 00234 00235 00253 void newPointEval(ParamCurve *pcurve1,double par1,ParamCurve *pcurve2, 00254 double astart2,double aend2,double aepsge, 00255 double& par2,double& y,double& dist,int& jstat); 00256 00257 } // Anonymous namespace 00258 00259 } // namespace Go 00260 00261 #endif // _CLOSESTPTCURVES2D_H