]> OCCT Git - occt.git/commitdiff
0026230: Segmentation fault because a NULL curve is used without precaution in case...
authorifv <ifv@opencascade.com>
Fri, 29 May 2015 08:25:56 +0000 (11:25 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 4 Jun 2015 11:17:07 +0000 (14:17 +0300)
src/BOPTools/BOPTools_AlgoTools2D.cdl
src/BOPTools/BOPTools_AlgoTools2D.cxx

index 51bd22d407d46016b5cabfa1ab5abdd329243a16..b7b3c46c330aba5e3942678e28d5036a3af2b999 100644 (file)
@@ -38,7 +38,8 @@ is
               aF:  Face from TopoDS); 
           ---Purpose: 
           --- Compute P-Curve for the edge <aE> on the face <aF> 
-          ---
+          --- Raises exception Standard_ConstructionError if projection algorithm fails
+
     EdgeTangent     (myclass;  
               anE  : Edge from TopoDS; 
               aT   : Real from Standard; 
@@ -56,8 +57,11 @@ is
               V : out Real from Standard); 
           ---Purpose: 
           --- Compute surface parameters <U,V> of the face <aF> 
-          --- for  the point from the edge <aE> at parameter <aT>.   
-          ---
+          --- for  the point from the edge <aE> at parameter <aT>. 
+          --- If <aE> has't pcurve on surface, algorithm tries to get it by
+          --- projection and can  
+          --- raise exception Standard_ConstructionError if projection algorithm fails
+
     CurveOnSurface  (myclass; 
               aE:  Edge from TopoDS; 
               aF:  Face from TopoDS; 
@@ -67,7 +71,8 @@ is
           --- Get P-Curve <aC>  for the edge <aE> on surface <aF> . 
           --- If the P-Curve does not exist, build  it using Make2D(). 
           --- [aToler] - reached tolerance 
-          ---
+          --- Raises exception Standard_ConstructionError if algorithm Make2D() fails
+
     CurveOnSurface  (myclass; 
               aE:  Edge from TopoDS; 
               aF:  Face from TopoDS; 
@@ -81,7 +86,8 @@ is
           --- If the P-Curve does not exist, build  it using Make2D(). 
           --- [aFirst, aLast] - range of the P-Curve    
           --- [aToler] - reached tolerance 
-          ---
+          --- Raises exception Standard_ConstructionError if algorithm Make2D() fails
+
     HasCurveOnSurface  (myclass;  
               aE:  Edge from TopoDS; 
               aF:  Face from TopoDS; 
@@ -167,18 +173,8 @@ is
           --- Make P-Curve <aC> for the edge <aE> on surface <aF> . 
           --- [aFirst, aLast] - range of the P-Curve    
           --- [aToler] - reached tolerance 
-          --- 
+          --- Raises exception Standard_ConstructionError if algorithm fails
           
-    MakeCurveOnSurface        (myclass;  
-              aE:  Edge from TopoDS; 
-              aF:  Face from TopoDS; 
-              aC    : out Curve from Geom2d;
-              aFirst: out Real from Standard; 
-              aLast : out Real from Standard; 
-              aToler: out Real from Standard);             
-          ---Purpose:   
-          --- Same  as   Make2D() 
-          ---
     MakePCurveOnFace  (myclass;    
               aF:  Face from TopoDS; 
               C3D   :     Curve from Geom; 
@@ -187,7 +183,8 @@ is
           ---Purpose:   
           --- Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> . 
           --- [aToler] - reached tolerance 
-          ---
+          --- Raises exception Standard_ConstructionError if projection algorithm fails
+
     MakePCurveOnFace  (myclass;    
               aF:  Face from TopoDS; 
               C3D   :     Curve from Geom;  
@@ -199,7 +196,8 @@ is
           --- Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .  
           --- [aT1,  aT2] - range to build    
           --- [aToler] - reached tolerance 
-          ---
+          --- Raises exception Standard_ConstructionError if projection algorithm fails
+
     MakePCurveOfType  (myclass;    
               PC  : ProjectedCurve from ProjLib; 
               aC  : out Curve from Geom2d);         
index 5a3348c8f39a44ee285b3260430d9f42872cfe46..6b607820261caabd83b9a6537f01ecb09555dd6e 100644 (file)
@@ -15,6 +15,7 @@
 #include <BOPTools_AlgoTools2D.ixx>
 
 #include <Standard_NotImplemented.hxx>
+#include <Standard_ConstructionError.hxx>
 #include <Precision.hxx>
 #include <gp.hxx>
 
@@ -652,6 +653,12 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
       aTolR = aProj3.GetTolerance();
     }
   }
+  //
+  if(aC2D.IsNull())
+  {
+    Standard_ConstructionError::Raise("BOPTools_AlgoTools2D::MakePCurveOnFace : PCurve is Null");
+  }
+  //
   TolReached2d=aTolR;
   BOPTools_AlgoTools2D::AdjustPCurveOnFace (aBAS, aT1, aT2, 
                                             aC2D, aC2DA);