X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMImpl%2FGEOMImpl_ILocalOperations.cxx;h=f5485bd273caca2d80ff7254968f4a0e3e561a8f;hb=de644ac6fe44325aaa8ce9c1aa729dd9189eea6e;hp=b3c270ef8b8534eeb4c8cc99be67ab8807810f5a;hpb=6f000dfe28cad33bcf7053913e1a2f24b3fa3e33;p=modules%2Fgeom.git diff --git a/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx b/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx index b3c270ef8..f5485bd27 100644 --- a/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx @@ -1,4 +1,4 @@ -// 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 @@ -45,15 +45,11 @@ #include #include -#include - #include "utilities.h" -#include #include #include #include -#include #include #include @@ -68,8 +64,8 @@ * constructor: */ //============================================================================= -GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations"); } @@ -96,7 +92,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletAll SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -122,9 +118,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletAll return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -147,7 +142,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletEdges SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -181,9 +176,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletEdges return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -214,7 +208,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletEdgesR1R2 SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -249,9 +243,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletEdgesR1R2 return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -283,7 +276,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletFaces SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -317,9 +310,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletFaces return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -350,7 +342,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletFacesR1R2 SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -385,9 +377,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletFacesR1R2 return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -418,7 +409,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFillet2D SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet2D = GetEngine()->AddObject(GetDocID(), GEOM_FILLET_2D); + Handle(GEOM_Object) aFillet2D = GetEngine()->AddObject(GEOM_FILLET_2D); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -452,9 +443,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFillet2D return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -486,7 +476,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFillet1D SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet1D = GetEngine()->AddObject(GetDocID(), GEOM_FILLET_1D); + Handle(GEOM_Object) aFillet1D = GetEngine()->AddObject(GEOM_FILLET_1D); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -521,9 +511,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFillet1D return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -554,7 +543,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferAll (Handle(GEOM_Objec SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -580,9 +569,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferAll (Handle(GEOM_Objec return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -606,7 +594,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdge SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -635,9 +623,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdge return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -662,7 +649,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdgeAD SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -691,9 +678,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdgeAD return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -717,7 +703,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferFaces SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -752,9 +738,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferFaces return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -786,7 +771,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferFacesAD SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -821,9 +806,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferFacesAD return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -855,7 +839,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdges SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -891,9 +875,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdges return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -925,7 +908,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdgesAD SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -961,9 +944,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdgesAD return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -996,7 +978,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeArchimede (Handle(GEOM_Object SetErrorCode(KO); //Add a new Archimede object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_ARCHIMEDE); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_ARCHIMEDE); //Add a new Archimede function Handle(GEOM_Function) aFunction = aChamfer->AddFunction(GEOMImpl_ArchimedeDriver::GetID(), ARCHIMEDE_TYPE); @@ -1023,9 +1005,8 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeArchimede (Handle(GEOM_Object return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -1074,7 +1055,7 @@ Standard_Integer GEOMImpl_ILocalOperations::GetSubShapeIndex (Handle(GEOM_Object if (aGen) { GEOMImpl_IShapesOperations* anIShapesOperations = - aGen->GetIShapesOperations(GetDocID()); + aGen->GetIShapesOperations(); anInd = anIShapesOperations->GetSubShapeIndex(theShape, theSubShape); SetErrorCode(anIShapesOperations->GetErrorCode()); }