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 _INTERSECTOR2OBJ_H
00034 #define _INTERSECTOR2OBJ_H
00035
00036
00037 #include "Intersector.h"
00038 #include "ParamGeomInt.h"
00039
00040
00041 namespace Go {
00044
00045
00046
00049
00050 class Intersector2Obj : public Intersector {
00051 public:
00052
00054 Intersector2Obj() {}
00055
00070 Intersector2Obj(boost::shared_ptr<ParamGeomInt> obj1,
00071 boost::shared_ptr<ParamGeomInt> obj2,
00072 boost::shared_ptr<GeoTol> epsge,
00073 Intersector* prev = 0,
00074 int eliminated_parameter = -1,
00075 double eliminated_value = 0);
00076
00091 Intersector2Obj(boost::shared_ptr<ParamGeomInt> obj1,
00092 boost::shared_ptr<ParamGeomInt> obj2,
00093 double epsge,
00094 Intersector* prev = 0,
00095 int eliminated_parameter = -1,
00096 double eliminated_value = 0);
00097
00099 virtual ~Intersector2Obj();
00100
00101
00102
00103
00108 virtual int nmbBdObj(int idx) const
00109 { return (idx < 0 || idx > 1) ? 0 : obj_int_[idx]->nmbBdObj(); }
00110
00117 virtual BoundaryGeomInt* getBoundaryObject(int idx, int bd_idx) const
00118 { return (idx < 0 || idx > 1) ? 0
00119 : obj_int_[idx]->getBoundaryObject(bd_idx); }
00120
00123 void setSelfintCase(int type)
00124 { selfint_case_ = type; }
00125
00130 virtual int isSelfintCase()
00131 { return selfint_case_; }
00132
00133
00134 protected:
00135 boost::shared_ptr<ParamGeomInt> obj_int_[2];
00136 int selfint_case_;
00137
00138
00139
00140
00141
00142 virtual void print_objs();
00143
00144 virtual boost::shared_ptr<Intersector>
00145 lowerOrderIntersector(boost::shared_ptr<ParamGeomInt> obj1,
00146 boost::shared_ptr<ParamGeomInt> obj2,
00147 Intersector* prev = 0,
00148 int eliminated_parameter = -1,
00149 double eliminated_value = 0) = 0;
00150
00151 virtual int getBoundaryIntersections();
00152
00153 virtual int performInterception();
00154
00155 virtual bool foundIntersectionNearBoundary()
00156 { return false; }
00157
00158
00159 virtual int performRotatedBoxTest(double eps1, double eps2);
00160
00161
00162
00163 virtual int performInterceptionByImplicitization()
00164 { return 1; }
00165
00166
00167
00168
00169
00170 virtual int interceptionBySeparationSurface()
00171 { return 1; }
00172
00173 virtual int simpleCase();
00174
00175 virtual int simpleCase2(Point& axis1, Point& axis2);
00176
00177
00178
00179 virtual int simpleCaseByImplicitization()
00180 { return 0; }
00181
00182 virtual bool isLinear();
00183
00184 virtual bool complexityReduced()
00185 {
00186
00187 return true;
00188 }
00189
00190 virtual void handleComplexity()
00191 {
00192
00193
00194 }
00195
00196 virtual int checkCoincidence() = 0;
00197
00198 virtual void microCase() = 0;
00199
00200 virtual int updateIntersections() = 0;
00201
00202 virtual int linearCase() = 0;
00203
00204 virtual int doSubdivide() = 0;
00205
00206 virtual int complexIntercept();
00207
00208 virtual int complexSimpleCase();
00209
00210 virtual void postIterate(int nmb_orig, int dir=-1, bool keep_endpt=true) { }
00211
00212 virtual void doPostIterate()
00213 {
00214 postIterate(0, -1);
00215 }
00216
00217 virtual void removeDegenerateConnections() { }
00218
00219 void getSeedIteration(double seed[]);
00220
00221 bool atSameBoundary(const double *par1, const double *par2);
00222
00223 bool atBoundary(const double *par1, std::vector<bool>& boundaries);
00224
00225 virtual void printDebugInfo();
00226
00227 virtual void writeOut() { }
00228
00229 private:
00230
00231 };
00232
00233
00235 }
00236
00237
00238 #endif // _INTERSECTOR2OBJ_H
00239