//=========================================================================== // 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. //=========================================================================== 00002 #ifndef _PROJECTCURVE_ 00003 #define _PROJECTCURVE_ 00004 00005 #include <boost/smart_ptr.hpp> 00006 00007 #include "GoTools/utils/Point.h" 00008 #include "GoTools/creators/EvalCurve.h" 00009 #include "GoTools/geometry/SplineCurve.h" 00010 #include "GoTools/geometry/SplineSurface.h" 00011 00012 namespace Go 00013 00014 { 00015 00019 class ProjectIntersectionCurve : public EvalCurve 00020 { 00021 public: 00022 00032 ProjectIntersectionCurve(boost::shared_ptr<SplineCurve>& inters_crv, 00033 boost::shared_ptr<SplineCurve>& p_crv, 00034 boost::shared_ptr<SplineCurve>& other_p_crv, 00035 boost::shared_ptr<ParamSurface>& surf, 00036 boost::shared_ptr<ParamSurface>& other_surf, 00037 double offset_dist, double other_offset_dist, 00038 double epsgeo); 00039 00041 virtual ~ProjectIntersectionCurve(); 00042 00046 virtual Point eval(double t) const; 00047 00054 virtual void eval(double t, int n, Point der[]) const; 00055 00058 virtual double start() const; 00061 virtual double end() const; 00062 00065 virtual int dim() const; 00066 00073 virtual bool approximationOK(double par, Point approxpos, 00074 double tol1, double tol2) const; 00075 00076 private: 00077 const boost::shared_ptr<SplineCurve> inters_crv_; 00078 //Param curves serve as seed generators for closest point evaluations. 00079 const boost::shared_ptr<SplineCurve> p_crv_; 00080 const boost::shared_ptr<SplineCurve> other_p_crv_; 00081 const boost::shared_ptr<ParamSurface> surf_; 00082 const boost::shared_ptr<ParamSurface> other_surf_; 00083 const double offset_dist_; // In direction normal to surf_. 00084 const double other_offset_dist_; // In direction normal to other_surf_. 00085 const double epsgeo_; 00086 00094 std::vector<double> 00095 getSuggestedSurfaceParameter(const SplineCurve& space_cv, double t, 00096 const SplineCurve& param_cv, 00097 bool pcv_turned) const; 00098 00099 }; 00100 00101 } // namespace Go 00102 00103 #endif //_PROJECTCURVE_