0026894: Intersection algorithm between two infinite cylinders is hanging
[occt.git] / src / IntPatch / IntPatch_ImpImpIntersection.hxx
index ece87d6..989cfa2 100644 (file)
@@ -45,10 +45,25 @@ public:
 
   DEFINE_STANDARD_ALLOC
 
-  
+  enum IntStatus
+  {
+    //! OK. Good intersection result.
+    IntStatus_OK,
+
+    //! Intersection curve is too long (e.g. as in the bug #26894).
+    //! We cannot provide precise computation of value and
+    //! derivatives of this curve having used floating-point model
+    //! determined by IEEE 754 standard. As result, OCCT algorithms
+    //! cannot work with that curve correctly.
+    IntStatus_InfiniteSectionCurve,
+
+    //! Algorithm cannot finish correctly.
+    IntStatus_Fail   
+  };
+
   Standard_EXPORT IntPatch_ImpImpIntersection();
   
-  //! Flag theIsReqToKeepRLine has been enterred only for
+  //! Flag theIsReqToKeepRLine has been entered only for
   //! compatibility with TopOpeBRep package. It shall be deleted
   //! after deleting TopOpeBRep.
   //! When intersection result returns IntPatch_RLine and another
@@ -56,7 +71,7 @@ public:
   //! will always keep both lines even if they are coincided.
   Standard_EXPORT IntPatch_ImpImpIntersection(const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& D1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& D2, const Standard_Real TolArc, const Standard_Real TolTang, const Standard_Boolean theIsReqToKeepRLine = Standard_False);
   
-  //! Flag theIsReqToKeepRLine has been enterred only for
+  //! Flag theIsReqToKeepRLine has been entered only for
   //! compatibility with TopOpeBRep package. It shall be deleted
   //! after deleting TopOpeBRep.
   //! When intersection result returns IntPatch_RLine and another
@@ -71,8 +86,11 @@ public:
                                 const Standard_Boolean theIsReqToKeepRLine =
                                                                   Standard_False);
   
-  //! Returns True if the calculus was succesfull.
-    Standard_Boolean IsDone() const;
+  //! Returns True if the calculus was successful.
+  Standard_Boolean IsDone() const;
+
+  //! Returns status
+  IntStatus GetStatus() const;
   
   //! Returns true if the is no intersection.
     Standard_Boolean IsEmpty() const;
@@ -116,7 +134,7 @@ private:
 
 
 
-  Standard_Boolean done;
+  IntStatus myDone;
   Standard_Boolean empt;
   Standard_Boolean tgte;
   Standard_Boolean oppo;