//=========================================================================== // 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 _TRIMCURVE_ 00002 #define _TRIMCURVE_ 00003 00004 #include <boost/smart_ptr.hpp> 00005 00006 #include "GoTools/utils/Point.h" 00007 #include "GoTools/creators/EvalCurveSet.h" 00008 #include "GoTools/geometry/SplineCurve.h" 00009 #include "GoTools/geometry/SplineSurface.h" 00010 00011 00012 namespace Go 00013 { 00014 00015 class CurveOnSurface; 00018 00019 class TrimCurve : public EvalCurveSet 00020 { 00021 public: 00022 00024 TrimCurve(CurveOnSurface* bd_crv); 00025 00026 TrimCurve(CurveOnSurface* bd_crv, double start, double end); 00027 00028 TrimCurve(Point startpt, Point endpt, CurveOnSurface* bd_crv); 00029 00031 virtual ~TrimCurve(); 00032 00033 // Inherited from EvalCurveSet 00034 std::vector<Point> eval( double t); 00035 00036 // Inherited from EvalCurveSet 00037 virtual void eval(double t, int n, std::vector<std::vector<Point> >& der); 00038 00039 // Inherited from EvalCurveSet 00040 virtual double start(); 00041 00042 // Inherited from EvalCurveSet 00043 virtual double end(); 00044 00046 virtual int dim(); 00047 00058 virtual bool approximationOK(double par, const std::vector<Point>& approxpos, 00059 double tol1, double tol2); 00060 00063 virtual int nmbCvs(); 00064 00065 private: 00066 CurveOnSurface* sfcv_; 00067 Point startpt_; 00068 Point endpt_; 00069 double start_; 00070 double end_; 00071 00072 void evaluate(double t, int n, std::vector<Point>& result); 00073 }; 00074 00075 00076 } 00077 00078 #endif //_TRIMCURVE_