Salome HOME
Mantis issue 0021425: Accepted object types in 'fillet 2D'
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IShapesOperations.cxx
index 6af52d80a467dac88cd500dd19609ab2f335bebe..bc1b8cbce2a85c4a26a261acd71b915cc0125ab2 100644 (file)
@@ -83,7 +83,6 @@
 #include <BRepAdaptor_Curve.hxx>
 #include <BRepAdaptor_Surface.hxx>
 #include <BRepBndLib.hxx>
-#include <BRepBuilderAPI_MakeFace.hxx>
 #include <BRepMesh_IncrementalMesh.hxx>
 
 #include <TopAbs.hxx>
@@ -458,6 +457,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFace (Handle(GEOM_Object) th
   aCI.SetIsPlanar(isPlanarWanted);
 
   //Compute the Face value
+  Standard_Boolean isWarning = Standard_False;
   try {
 #if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
@@ -470,14 +470,20 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFace (Handle(GEOM_Object) th
   catch (Standard_Failure) {
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
     SetErrorCode(aFail->GetMessageString());
-    return NULL;
+    // to provide warning
+    if (!aFunction->GetValue().IsNull()) {
+      isWarning = Standard_True;
+    } else {
+      return NULL;
+    }
   }
 
   //Make a Python command
   GEOM::TPythonDump(aFunction) << aFace << " = geompy.MakeFace("
     << theWire << ", " << (int)isPlanarWanted << ")";
 
-  SetErrorCode(OK);
+  // to provide warning
+  if (!isWarning) SetErrorCode(OK);
   return aFace;
 }
 
@@ -522,6 +528,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceWires
   aCI.SetIsPlanar(isPlanarWanted);
 
   //Compute the shape
+  Standard_Boolean isWarning = Standard_False;
   try {
 #if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
@@ -534,7 +541,12 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceWires
   catch (Standard_Failure) {
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
     SetErrorCode(aFail->GetMessageString());
-    return NULL;
+    // to provide warning
+    if (!aFunction->GetValue().IsNull()) {
+      isWarning = Standard_True;
+    } else {
+      return NULL;
+    }
   }
 
   //Make a Python command
@@ -551,7 +563,8 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceWires
   }
   pd << "], " << (int)isPlanarWanted << ")";
 
-  SetErrorCode(OK);
+  // to provide warning
+  if (!isWarning) SetErrorCode(OK);
   return aShape;
 }
 
@@ -1828,7 +1841,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::ReverseShape(Handle(GEOM_Object)
   if (aGen) {
     GEOMImpl_IHealingOperations* anIHealingOperations =
       aGen->GetIHealingOperations(GetDocID());
-    aReversed = anIHealingOperations->ChangeOrientation(theShape);
+    aReversed = anIHealingOperations->ChangeOrientationCopy(theShape);
     SetErrorCode(anIHealingOperations->GetErrorCode());
   }
 
@@ -4109,7 +4122,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceOld (Handle(GEOM_Objec
             if ( isFound && iType == TopAbs_FACE )
             {
               // check normals at pOnWhat and pOnWhere
-              const double angleTol = PI/180.;
+              const double angleTol = M_PI/180.;
               gp_Vec normToWhat  = GetNormal( TopoDS::Face(Exp_aWhat.Current()), aWhatDistance);
               gp_Vec normToWhere = GetNormal( TopoDS::Face(Exp_aWhere.Current()), aWhereDistance);
               if ( normToWhat * normToWhere < 0 )