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 _GOSMOOTHTRANSITION_H_
00034 #define _GOSMOOTHTRANSITION_H_
00035
00036 #include <boost/smart_ptr.hpp>
00037
00038 #include "Point.h"
00039 #include "EvalCurveSet.h"
00040 #include "SplineCurve.h"
00041 #include "SplineSurface.h"
00042 #include "SISLconversion.h"
00043
00044 namespace Go
00045 {
00048
00049
00056
00057 class SmoothTransition : public EvalCurveSet
00058 {
00059 public:
00060
00062 SmoothTransition(boost::shared_ptr<const SplineCurve>& inters_crv,
00063 boost::shared_ptr<const SplineCurve>& p_crv1,
00064 boost::shared_ptr<const SplineCurve>& p_crv2,
00065 boost::shared_ptr<const ParamSurface> surf1,
00066 boost::shared_ptr<const ParamSurface> surf2,
00067 double offset_dist1, double offset_dist2,
00068 double epsgeo);
00069
00070
00071
00073 virtual ~SmoothTransition();
00074 virtual std::vector<Point> eval( double t);
00075
00076 virtual void eval(double t, int n, std::vector<std::vector<Point> >& der);
00077 virtual double start();
00078 virtual double end();
00079 virtual int dim();
00080 virtual bool approximationOK(double par, const std::vector<Point>& approxpos,
00081 double tol1, double tol2);
00082 virtual int nmbCvs()
00083 { return 6; }
00084
00085 private:
00086 boost::shared_ptr<const SplineCurve> inters_crv_;
00087
00088 boost::shared_ptr<const SplineCurve> p_crv1_;
00089 boost::shared_ptr<const SplineCurve> p_crv2_;
00090 boost::shared_ptr<const ParamSurface> surf1_;
00091 boost::shared_ptr<const ParamSurface> surf2_;
00092 boost::shared_ptr<const SplineSurface> under_surf1_;
00093 boost::shared_ptr<const SplineSurface> under_surf2_;
00094 double offset_dist1_;
00095 double offset_dist2_;
00096 const double epsgeo_;
00097 const double kinktol_;
00098 std::vector<double> tangent_lengths_;
00099
00100
00101
00102 Point projectPoint(const Point& space_pt, const ParamSurface& surf,
00103 std::vector<double>& seed, bool boundary_pt,
00104 double epsgeo, double& dist);
00105
00106
00107
00108 std::vector<Point> computeCrosstangentValues(std::vector<Point>& space_pt,
00109 std::vector<Point>& local_pt, int derivs);
00110
00111
00112
00113 void guessParameterPoints(const Point& inters_cv_pt, double t,
00114 const SplineCurve& inters_cv,
00115 const ParamSurface& sf1, const ParamSurface& sf2,
00116 const SplineCurve& p_inters_cv1, const SplineCurve& p_inters_cv2,
00117 double offset_dist1, double offset_dist2,
00118 Point& guess_pt1, Point& guess_pt2);
00119
00120
00121 std::vector<double>
00122 getSuggestedSurfaceParameter(const SplineCurve& space_cv, double t,
00123 const SplineCurve& param_cv,
00124 bool pcv_turned);
00125
00126
00127
00128
00129 std::vector<double> getSuggestedSurfaceParameter(Point& surf_par_pt, const ParamSurface& surf,
00130 Point& space_pt, double tolerance);
00131
00132 void offsetIntersectionPoints(std::vector<Point>& ep, std::vector<Point>& eq,
00133 std::vector<Point>& eoffp, std::vector<Point>& eoffq,
00134 Point& eparp, Point& eparq,
00135 std::vector<Point>& espine, std::vector<Point>& egeobb1,
00136 std::vector<Point>& egeobb2, std::vector<Point>& ecrtan1,
00137 std::vector<Point>& ecrtan2, std::vector<Point>& egeop,
00138 std::vector<Point>& egeoq, std::vector<double>& curv_radis);
00139
00140 void offsetIntersectionIterate(double arad1, double arad2, std::vector<Point>& epoint,
00141 std::vector<Point>& epnt1, std::vector<Point>& epnt2,
00142 Point& epar1, Point& epar2,
00143 const SplineSurface& psurf1, const SplineSurface& psurf2,
00144 double astep, double aepsge, std::vector<Point>& gpnt1,
00145 std::vector<Point>& gpnt2, std::vector<Point>& goffpnt1,
00146 std::vector<Point>& goffpnt2, Point& gpar1,
00147 Point& gpar2p);
00148
00149 void blend_s1421(const SplineSurface* ps, double aoffset, int ider,
00150 const Point& epar, int& ilfs, int& ilft,
00151 std::vector<Point>& eoffpnt, std::vector<Point>& epnt, int* jstat);
00152
00153
00154 };
00155
00157 }
00158
00159 #endif // _GOSMOOTHTRANSITION_H_
00160