ParamCurve.h

00001 //===========================================================================
00002 // GoTools - SINTEF Geometry Tools version 1.1
00003 //
00004 // GoTools module: CORE
00005 //
00006 // Copyright (C) 2000-2007 SINTEF ICT, Applied Mathematics, Norway.
00007 //
00008 // This program is free software; you can redistribute it and/or          
00009 // modify it under the terms of the GNU General Public License            
00010 // as published by the Free Software Foundation version 2 of the License. 
00011 //
00012 // This program is distributed in the hope that it will be useful,        
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of         
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          
00015 // GNU General Public License for more details.                           
00016 //
00017 // You should have received a copy of the GNU General Public License      
00018 // along with this program; if not, write to the Free Software            
00019 // Foundation, Inc.,                                                      
00020 // 59 Temple Place - Suite 330,                                           
00021 // Boston, MA  02111-1307, USA.                                           
00022 //
00023 // Contact information: E-mail: tor.dokken@sintef.no                      
00024 // SINTEF ICT, Department of Applied Mathematics,                         
00025 // P.O. Box 124 Blindern,                                                 
00026 // 0314 Oslo, Norway.                                                     
00027 //
00028 // Other licenses are also available for this software, notably licenses
00029 // for:
00030 // - Building commercial software.                                        
00031 // - Building software whose source code you wish to keep private.        
00032 //===========================================================================
00033 #ifndef _GOPARAMCURVE_H
00034 #define _GOPARAMCURVE_H
00035 
00036 #include "Point.h"
00037 #include "GeomObject.h"
00038 #include "CompositeBox.h"
00039 #include "DirectionCone.h"
00040 #include "Values.h"
00041 #include <vector>
00042 #include <boost/smart_ptr.hpp>
00043 
00044 
00045 namespace Go
00046 {
00049 
00050 
00051 class SplineCurve;
00052 
00057 class ParamCurve : public GeomObject
00058 {
00059 public:
00061     virtual ~ParamCurve();
00062 
00066     virtual void point(Point& pt, double tpar) const = 0;
00067 
00079     virtual void point(std::vector<Point>& pts, 
00080                        double tpar,
00081                        int derivs,
00082                        bool from_right = true) const = 0;
00083 
00084 
00092     Point point(double tpar) const;
00093 
00109     std::vector<Point> point(double tpar, int derivs, bool from_right = true) const;
00110 
00113     virtual double startparam() const = 0;
00114 
00117     virtual double endparam() const = 0;
00118 
00125     virtual void reverseParameterDirection(bool switchparam = false) = 0;
00126     
00132     virtual SplineCurve* geometryCurve() = 0;
00133 
00139     virtual bool isDegenerate(double degenerate_epsilon) = 0;
00140 
00153     virtual ParamCurve* subCurve(double from_par, double to_par,
00154                                  double fuzzy = DEFAULT_PARAMETER_EPSILON) const = 0;
00155 
00158 // #ifdef _MSC_VER
00159 // #if _MSC_VER < 1300
00160 //     virtual GeomObject* clone() const = 0;
00161 // #else
00162 //     virtual ParamCurve* clone() const = 0;
00163 // #endif //_MSC_VER < 1300
00164 // #else
00165     virtual ParamCurve* clone() const = 0;
00166 // #endif
00167 
00172     virtual DirectionCone directionCone() const = 0;
00173  
00181     virtual CompositeBox compositeBox() const;
00182 
00189     virtual void appendCurve(ParamCurve* cv, bool reparam=true) = 0;
00190 
00198     virtual void appendCurve(ParamCurve* cv,
00199                              int continuity, double& dist, bool reparam=true) = 0;
00200 
00205     double estimatedCurveLength(int numpts = 4) const;
00206 
00214     double estimatedCurveLength(double tmin, double tmax, int numpts = 4) const;
00215 
00229     virtual void closestPoint(const Point& pt,
00230                               double tmin,
00231                               double tmax,
00232                               double& clo_t,
00233                               Point& clo_pt,
00234                               double& clo_dist,
00235                               double const *seed = 0) const = 0;
00236 
00246     void closestPoint(const Point& pt, double& clo_t, Point& clo_pt, double& clo_dist) const;
00247 
00257     virtual double nextSegmentVal(double par, bool forward, double tol) const;
00258 
00259 protected:
00260     void closestPointGeneric(const Point&   pt,
00261                              double    tmin,
00262                              double    tmax,
00263                              double guess_param,
00264                              double&   clo_t,
00265                              Point&  clo_pt,
00266                              double&   clo_dist) const;
00267 
00268     void s1771(Point pt,double aepsge,
00269                double astart,double aend,double anext,double &cpos,int *jstat) const;
00270 
00271     void s1771_s9point(Point pt, std::vector<Point> val, Point diff,
00272                           double astart,double aend,int max_it,double *cnext,double *ad,
00273                        double adel,double *cdist,double aprev,int *jstat) const;
00274 
00275     double s1771_s9del(double *eco,double *eco1,double *eco2,int idim) const;
00276 };
00277 
00279 } // namespace Go
00280 
00281 
00282 
00283 #endif // _GOPARAMCURVE_H
00284 
00285 

Generated on Mon Jun 11 14:48:18 2007 for GoTools Core Library by  doxygen 1.5.1