//=========================================================================== // 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 _CLOSESTPTCURVESURF_H 00016 #define _CLOSESTPTCURVESURF_H 00017 00029 #include "GoTools/geometry/ParamCurve.h" 00030 #include "GoTools/geometry/ParamSurface.h" 00031 00032 namespace Go { 00033 00056 void closestPtCurveSurf(ParamCurve* pcurve, ParamSurface* psurf, double aepsge, 00057 double astart1, double aend1, RectDomain *domain, 00058 double anext1, double enext2[], 00059 double& cpos1, double gpos2[], 00060 double& dist, Point& pt_cv, Point& pt_su, 00061 bool second_order=false); 00062 00087 void closestPtCurveSurf(ParamCurve* pcurve, ParamSurface* psurf, double aepsge, 00088 double astart1, double estart2[], double aend1, 00089 double eend2[], double anext1, double enext2[], 00090 double& cpos1, double gpos2[], 00091 double& dist, Point& pt_cv, Point& pt_su, int& istat, 00092 bool second_order=false); 00093 00094 00095 // Anonymous namespace 00096 namespace { 00106 void insideParamDomain(Point& gd, const Point& acoef, double astart1, 00107 double aend1, double astart2[],double aend2[], 00108 int& corr); 00109 00123 void nextStep(double& dist,Point& diff,Point& delta,int& kstat, 00124 std::vector<Point>& eval_cv,std::vector<Point>& eval_su, 00125 int order); 00126 00127 00138 int localPretop(double dist,const Point& diff,const Point& normal, 00139 const std::vector<Point>& eval_cv, 00140 const std::vector<Point>& eval_su); 00141 00142 00160 void singular(ParamCurve* pcurve,ParamSurface* psurf,Point& par_val, 00161 double& dist, double aepsge,double delta,const Point& diff, 00162 const Point& norm_vec, 00163 const std::vector<Point>&eval_cv, 00164 const std::vector<Point>&eval_su, 00165 double astart1,double estart2[],double aend1,double eend2[]); 00166 00167 00181 void secant(ParamCurve *pcurve,ParamSurface *psurf,Point& par_val, 00182 double& dist,int& jstat, double delta,double aepsge, 00183 double astart1,double estart2[],double aend1,double eend2[]); 00184 00185 00198 void setReturnValues(const Point& par_val,ParamCurve* pcurve, 00199 ParamSurface* psurf,double aepsge, 00200 int& jstat,double& par_cv,double par_su[], 00201 double& dist,Point& pt_cv,Point& pt_su); 00202 00203 00221 void newPointEval(ParamCurve *pcurve,double par_cv,ParamSurface *psurf, 00222 double estart2[],double eend2[],double aepsge, 00223 Point& par_su,double& y,double& dist,int& jstat); 00224 00225 00226 } // Anonymous namespace 00227 00228 } // namespace Go 00229 00230 #endif // _CLOSESTPTCURVESURF_H