-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include <GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx>
#include <BlockFix_CheckTool.hxx>
-#include <Basics_OCCTVersion.hxx>
-
#include "utilities.h"
-#include <OpUtil.hxx>
#include <Utils_ExceptHandlers.hxx>
#include <TFunction_DriverTable.hxx>
#include <TFunction_Driver.hxx>
-#include <TFunction_Logbook.hxx>
#include <TDataStd_Integer.hxx>
#include <TDF_Tool.hxx>
* constructor:
*/
//=============================================================================
-GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations");
}
theEdge3.IsNull() || theEdge4.IsNull()) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Face function
Handle(GEOM_Function) aFunction =
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
if (theEdge1.IsNull() || theEdge2.IsNull()) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Face function
Handle(GEOM_Function) aFunction =
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
thePnt3.IsNull() || thePnt4.IsNull()) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Face function
Handle(GEOM_Function) aFunction =
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
theFace5.IsNull() || theFace6.IsNull()) return NULL;
//Add a new Solid object
- Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GetDocID(), GEOM_BLOCK);
+ Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GEOM_BLOCK);
//Add a new Block function
Handle(GEOM_Function) aFunction =
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
if (theFace1.IsNull() || theFace2.IsNull()) return NULL;
//Add a new Solid object
- Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GetDocID(), GEOM_BLOCK);
+ Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GEOM_BLOCK);
//Add a new Block function
Handle(GEOM_Function) aFunction =
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
if (theCompound.IsNull()) return NULL;
//Add a new object
- Handle(GEOM_Object) aBlockComp = GetEngine()->AddObject(GetDocID(), GEOM_COMPOUND);
+ Handle(GEOM_Object) aBlockComp = GetEngine()->AddObject(GEOM_COMPOUND);
//Add a new BlocksComp function
Handle(GEOM_Function) aFunction =
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
anArray->SetValue(1, anIndices.FindIndex(anEdge));
aResult = GetEngine()->AddSubShape(theShape, anArray);
}
- } catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ } catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
anArray->SetValue(1, anIndices.FindIndex(aShape));
aResult = GetEngine()->AddSubShape(theShape, anArray);
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
aResult = GetEngine()->AddSubShape(theShape, anArray);
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
aResult = GetEngine()->AddSubShape(theShape, anArray);
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
anArray->SetValue(1, anIndices.FindIndex(aShape));
aResult = GetEngine()->AddSubShape(theShape, anArray);
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
aResult = GetEngine()->AddSubShape(theShape, anArray);
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
aResult = GetEngine()->AddSubShape(theShape, anArray);
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
aResult = GetEngine()->AddSubShape(theShape, anArray);
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
}
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return isCompOfBlocks;
}
*/
//=============================================================================
TCollection_AsciiString GEOMImpl_IBlocksOperations::PrintBCErrors
- (Handle(GEOM_Object) theCompound,
+ (Handle(GEOM_Object) /*theCompound*/,
const std::list<BCError>& theErrors)
{
TCollection_AsciiString aDescr;
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a function
Handle(GEOM_Function) aFunction =
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a function
Handle(GEOM_Function) aFunction =
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a function
Handle(GEOM_Function) aFunction =
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
}
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return aBlocks;
}
aResult = GetEngine()->AddSubShape(theCompound, anArray);
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
anArray->SetValue(1, anIndices.FindIndex(aShape));
aResult = GetEngine()->AddSubShape(theCompound, anArray);
}
- } catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ } catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
}
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}