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 _CVCVINTERSECTOR_H
00034 #define _CVCVINTERSECTOR_H
00035
00036
00037 #include "Intersector2Obj.h"
00038
00039
00040 namespace Go {
00043
00044
00045
00047
00048 class CvCvIntersector : public Intersector2Obj {
00049 public:
00050
00063 CvCvIntersector(boost::shared_ptr<ParamGeomInt> curve1,
00064 boost::shared_ptr<ParamGeomInt> curve2,
00065 double epsge,
00066 Intersector* prev = 0,
00067 int eliminated_parameter = -1,
00068 double eliminated_value = 0);
00069
00082 CvCvIntersector(boost::shared_ptr<ParamGeomInt> curve1,
00083 boost::shared_ptr<ParamGeomInt> curve2,
00084 boost::shared_ptr<GeoTol> epsge,
00085 Intersector* prev = 0,
00086 int eliminated_parameter = -1,
00087 double eliminated_value = 0);
00088
00090 virtual ~CvCvIntersector();
00091
00092
00093
00094
00099 virtual int numParams() const
00100 { return 2; }
00101
00102 protected:
00103
00104
00105 virtual boost::shared_ptr<Intersector>
00106 lowerOrderIntersector(boost::shared_ptr<ParamGeomInt> obj1,
00107 boost::shared_ptr<ParamGeomInt> obj2,
00108 Intersector* prev = 0,
00109 int eliminated_parameter = -1,
00110 double eliminated_value = 0);
00111
00112 virtual int performRotatedBoxTest(double eps1, double eps2);
00113
00114 virtual bool foundIntersectionNearBoundary();
00115
00116 virtual int simpleCase2(Point& axis1, Point& axis2);
00117
00118 virtual int checkCoincidence();
00119
00120 virtual void microCase();
00121
00122 virtual int updateIntersections();
00123
00124 virtual int repairIntersections()
00125 { return 0; }
00126
00127 virtual int linearCase();
00128
00129 virtual int doSubdivide();
00130
00131 virtual void writeOut();
00132
00133 private:
00134 void doIterate(double& par1, double& par2,
00135 double& dist, double *guess=0);
00136
00137 double distInCandidatePar(double par, int dir, const double* seed);
00138
00139 int sortParameterDirections(int perm[]);
00140
00141 SubdivisionClassification getSubdivisionParameter(int dir,
00142 double& par);
00143
00144 };
00145
00146
00148 }
00149
00150
00151 #endif // _CVCVINTERSECTOR_H
00152