X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMImpl%2FGEOMImpl_IBlocksOperations.cxx;h=6a4428082015eadee67477f341e9e91d44d0d44a;hb=d3582bad2ba00bbf625d06e8cfbff999d7c38880;hp=db35fe4a489a5cfcca33657da1776e1a651ca14c;hpb=31b91717e01915431d5658a7054af18a7b7044d5;p=modules%2Fgeom.git diff --git a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx index db35fe4a4..6a4428082 100644 --- a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 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 @@ -46,10 +46,7 @@ #include #include -#include - #include "utilities.h" -#include #include #include @@ -249,8 +246,8 @@ static Standard_Boolean IsQuadrangle(const TopoDS_Face &theFace, * 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"); } @@ -281,7 +278,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad 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 = @@ -315,9 +312,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -342,7 +338,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad2Edges 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 = @@ -371,9 +367,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad2Edges return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -400,7 +395,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad4Vertices 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 = @@ -434,9 +429,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad4Vertices return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -465,7 +459,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeHexa 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 = @@ -504,9 +498,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeHexa return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -532,7 +525,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeHexa2Faces 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 = @@ -561,9 +554,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeHexa2Faces return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -588,7 +580,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeBlockCompound 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 = @@ -615,9 +607,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeBlockCompound return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -865,9 +856,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetEdge 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; } @@ -926,9 +916,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetEdgeNearPoint 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; } @@ -1067,9 +1056,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByPoints 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; } @@ -1190,9 +1178,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByEdges 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; } @@ -1258,9 +1245,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetOppositeFace 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; } @@ -1448,9 +1434,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceNearPoint 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; } @@ -1576,9 +1561,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByNormale 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; } @@ -1701,9 +1685,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetShapesNearPoint 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; } @@ -1769,9 +1752,8 @@ Standard_Boolean GEOMImpl_IBlocksOperations::IsCompoundOfBlocks } } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return isCompOfBlocks; } @@ -2089,7 +2071,7 @@ Standard_Boolean HasAnyConnection (const Standard_Integer theBlockIndex, */ //============================================================================= TCollection_AsciiString GEOMImpl_IBlocksOperations::PrintBCErrors - (Handle(GEOM_Object) theCompound, + (Handle(GEOM_Object) /*theCompound*/, const std::list& theErrors) { TCollection_AsciiString aDescr; @@ -2430,7 +2412,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::RemoveExtraEdges 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 = @@ -2451,9 +2433,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::RemoveExtraEdges return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -2482,7 +2463,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::UnionFaces 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 = @@ -2502,9 +2483,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::UnionFaces return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -2532,7 +2512,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::CheckAndImprove 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 = @@ -2556,9 +2536,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::CheckAndImprove return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -2628,9 +2607,8 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IBlocksOperations::ExplodeCompound } } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return aBlocks; } @@ -2813,9 +2791,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetBlockNearPoint 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; } @@ -2928,9 +2905,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetBlockByParts 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; } @@ -3054,9 +3030,8 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IBlocksOperations::GetBlocksByPart } } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -3091,7 +3066,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeMultiTransformation1D 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 = @@ -3114,9 +3089,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeMultiTransformation1D return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; } @@ -3150,7 +3124,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeMultiTransformation2D 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 = @@ -3176,9 +3150,8 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeMultiTransformation2D return NULL; } } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); + catch (Standard_Failure& aFail) { + SetErrorCode(aFail.GetMessageString()); return NULL; }