Salome HOME
Merge V8_4_BR branch.
[modules/geom.git] / src / GEOMImpl / GEOMImpl_BooleanDriver.cxx
index 224d59c466b533acc09481df9de20e9a10823826..abfc738eaa38435dfec6a0ef047022f51eaf918d 100644 (file)
@@ -114,7 +114,7 @@ GEOMImpl_BooleanDriver::GEOMImpl_BooleanDriver()
 //function : Execute
 //purpose  :
 //=======================================================================
-Standard_Integer GEOMImpl_BooleanDriver::Execute(LOGBOOK& log) const
+Standard_Integer GEOMImpl_BooleanDriver::Execute(Handle(TFunction_Logbook)& log) const
 {
   if (Label().IsNull()) return 0;
   Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
@@ -150,19 +150,11 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(LOGBOOK& log) const
           aList2.Append(aShape2);
           aCSI.SetArguments(aList1);
           aCSI.Perform();
-#if OCC_VERSION_LARGE > 0x07010001
           if (aCSI.HasErrors() || aCSI.DS().Interferences().Extent() > 0)
-#else
-          if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0)
-#endif
             StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
           aCSI.SetArguments(aList2);
           aCSI.Perform();
-#if OCC_VERSION_LARGE > 0x07010001
           if (aCSI.HasErrors() || aCSI.DS().Interferences().Extent() > 0)
-#else
-          if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0)
-#endif
             StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
         }
 
@@ -213,11 +205,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(LOGBOOK& log) const
             aList1.Append(aShape);
             aCSI.SetArguments(aList1);
             aCSI.Perform();
-#if OCC_VERSION_LARGE > 0x07010001
             if (aCSI.HasErrors() || aCSI.DS().Interferences().Extent() > 0) {
-#else
-            if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0) {
-#endif
               StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
             }
           }
@@ -241,11 +229,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(LOGBOOK& log) const
               aList2.Append(aShape2);
               aCSI.SetArguments(aList2);
               aCSI.Perform();
-#if OCC_VERSION_LARGE > 0x07010001
              if (aCSI.HasErrors() || aCSI.DS().Interferences().Extent() > 0) {
-#else
-             if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0) {
-#endif
                 StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
               }
             }
@@ -286,11 +270,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(LOGBOOK& log) const
           aList1.Append(aShape);
           aCSI.SetArguments(aList1);
           aCSI.Perform();
-#if OCC_VERSION_LARGE > 0x07010001
          if (aCSI.HasErrors() || aCSI.DS().Interferences().Extent() > 0) {
-#else
-         if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0) {
-#endif
             StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
           }
         }
@@ -320,11 +300,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(LOGBOOK& log) const
             aList2.Append(aTool);
             aCSI.SetArguments(aList2);
             aCSI.Perform();
-#if OCC_VERSION_LARGE > 0x07010001
            if (aCSI.HasErrors() || aCSI.DS().Interferences().Extent() > 0) {
-#else
-           if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0) {
-#endif
               StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
             }
           }
@@ -347,11 +323,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(LOGBOOK& log) const
 
   aFunction->SetValue(aShape);
 
-#if OCC_VERSION_MAJOR < 7
-  log.SetTouched(Label());
-#else
   log->SetTouched(Label());
-#endif
 
   return 1;
 }
@@ -454,12 +426,10 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
           // This allows to avoid adding empty compounds,
           // resulting from COMMON on two non-intersecting shapes.
           if (aStepResult.ShapeType() == TopAbs_COMPOUND) {
-#if OCC_VERSION_MAJOR >= 7
             if ((aValue1.ShapeType() == TopAbs_FACE || aValue1.ShapeType() == TopAbs_SHELL) &&
                 (aValue2.ShapeType() == TopAbs_FACE || aValue2.ShapeType() == TopAbs_SHELL)) {
               aStepResult = makeCompoundShellFromFaces(aStepResult);
             }
-#endif
             TopoDS_Iterator aCompIter (aStepResult);
             for (; aCompIter.More(); aCompIter.Next()) {
               // add shape in a result
@@ -517,12 +487,10 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
         // This allows to avoid adding empty compounds,
         // resulting from CUT of parts
         if (aCut.ShapeType() == TopAbs_COMPOUND) {
-#if OCC_VERSION_MAJOR >= 7
           if (itSub1.Value().ShapeType() == TopAbs_FACE ||
               itSub1.Value().ShapeType() == TopAbs_SHELL) {
             aCut = makeCompoundShellFromFaces(aCut);
           }
-#endif
           TopoDS_Iterator aCompIter (aCut);
           for (; aCompIter.More(); aCompIter.Next()) {
             // add shape in a result
@@ -550,7 +518,6 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
 
   // perform FUSE operation
   else if (theType == BOOLEAN_FUSE) {
-#if OCC_VERSION_MAJOR >= 7
     Standard_Boolean isFaces = Standard_False;
     TopTools_ListOfShape listShape1, listShape2;
     GEOMUtils::AddSimpleShapes(theShape1, listShape1);
@@ -568,7 +535,6 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
         }
       }
     }
-#endif
 
     // Perform
     BRepAlgoAPI_Fuse BO (theShape1, theShape2);
@@ -576,10 +542,8 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
       StdFail_NotDone::Raise("Fuse operation can not be performed on the given shapes");
     }
     aShape = BO.Shape();
-#if OCC_VERSION_MAJOR >= 7
     if (isFaces)
       aShape = makeCompoundShellFromFaces(aShape);
-#endif
   }
 
   // perform SECTION operation
@@ -739,4 +703,4 @@ GetCreationInformation(std::string&             theOperationName,
   return true;
 }
 
-OCCT_IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_BooleanDriver,GEOM_BaseDriver);
+IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_BooleanDriver,GEOM_BaseDriver);