//=========================================================================== // 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 _POINT_ON_CURVE_H 00016 #define _POINT_ON_CURVE_H 00017 00018 #include "GoTools/utils/Point.h" 00019 #include <boost/smart_ptr.hpp> 00020 #include "GoTools/geometry/ParamCurve.h" 00021 00022 namespace Go 00023 { 00024 00028 class PointOnCurve 00029 { 00030 public: 00031 00032 PointOnCurve(); // Empty constructor 00033 00035 PointOnCurve(boost::shared_ptr<ParamCurve> curve, double par); 00036 00038 PointOnCurve(boost::shared_ptr<ParamCurve> curve, Point pnt); 00039 00040 ~PointOnCurve(); 00041 00045 Point getPos() const; 00046 00047 boost::shared_ptr<ParamCurve> getCurve() const 00048 { 00049 return crv_; 00050 } 00051 00052 double getPar() const 00053 { 00054 return par_; 00055 } 00056 00058 void evaluate(int der, std::vector<Point>& deriv) const; 00059 00061 void setParInterval(double start, double end); 00062 00063 private: 00064 Point point_; // The point 00065 double par_; // Parameter value on the curve corresponding to this point 00066 double t1_, t2_; // End parameters of current parameter interval 00067 boost::shared_ptr<ParamCurve> crv_; // The curve 00068 00069 }; 00070 00071 00072 } // namespace Go 00073 00074 #endif // _POINT_ON_CURVE_H 00075