00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
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
00159
00160
00161
00162
00163
00164
00165 virtual ParamCurve* clone() const = 0;
00166
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 }
00280
00281
00282
00283 #endif // _GOPARAMCURVE_H
00284
00285