X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMImpl%2FGEOMImpl_HealingDriver.cxx;h=b196c1928d79377b7363774e4ebad64bcc9c4263;hb=e067674b75266d9f67a2c474d8dc901d9f65fe48;hp=fab57241a61731153ec96b7e589dea27593da6ec;hpb=2735fef8fc422fd39a59490e6bb22f2a650d5f5e;p=modules%2Fgeom.git diff --git a/src/GEOMImpl/GEOMImpl_HealingDriver.cxx b/src/GEOMImpl/GEOMImpl_HealingDriver.cxx index fab57241a..b196c1928 100644 --- a/src/GEOMImpl/GEOMImpl_HealingDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_HealingDriver.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -63,16 +64,16 @@ //======================================================================= //function : raiseNotDoneExeption -//purpose : global function: forms error message and raises exeption +//purpose : global function: forms error message and raises exception //======================================================================= void raiseNotDoneExeption( const int theErrorStatus ) { switch ( theErrorStatus ) { - case ShHealOper_NotError: StdFail_NotDone::Raise( "ShHealOper_NotError_msg" ); - case ShHealOper_InvalidParameters: StdFail_NotDone::Raise( "ShHealOper_InvalidParameters_msg" ); + case ShHealOper_NotError: StdFail_NotDone::Raise( "ShHealOper_NotError_msg" ); break; + case ShHealOper_InvalidParameters: StdFail_NotDone::Raise( "ShHealOper_InvalidParameters_msg" ); break; case ShHealOper_ErrorExecution: - default: StdFail_NotDone::Raise( "ShHealOper_ErrorExecution_msg" ); + default: StdFail_NotDone::Raise( "ShHealOper_ErrorExecution_msg" ); break; } } @@ -98,7 +99,7 @@ GEOMImpl_HealingDriver::GEOMImpl_HealingDriver() //function : Execute //purpose : //======================================================================= -Standard_Integer GEOMImpl_HealingDriver::Execute(TFunction_Logbook& log) const +Standard_Integer GEOMImpl_HealingDriver::Execute(Handle(TFunction_Logbook)& log) const { if (Label().IsNull()) return 0; Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label()); @@ -163,7 +164,7 @@ Standard_Integer GEOMImpl_HealingDriver::Execute(TFunction_Logbook& log) const aFunction->SetValue(aShape); - log.SetTouched(Label()); + log->SetTouched(Label()); return 1; } @@ -610,7 +611,7 @@ Standard_Boolean GEOMImpl_HealingDriver::AddPointOnEdge (GEOMImpl_IHealing* the //function : ChangeOrientation //purpose : //======================================================================= -Standard_Boolean GEOMImpl_HealingDriver::ChangeOrientation (GEOMImpl_IHealing* theHI, +Standard_Boolean GEOMImpl_HealingDriver::ChangeOrientation (GEOMImpl_IHealing* /*theHI*/, const TopoDS_Shape& theOriginalShape, TopoDS_Shape& theOutShape) const { @@ -645,8 +646,14 @@ void GEOMImpl_HealingDriver::LimitTolerance (GEOMImpl_IHealing* theHI, // 1. Make a copy to prevent the original shape changes. TopoDS_Shape aShapeCopy; { - TColStd_IndexedDataMapOfTransientTransient aMapTShapes; - TNaming_CopyShape::CopyTool(theOriginalShape, aMapTShapes, aShapeCopy); + BRepBuilderAPI_Copy aMC (theOriginalShape); + if (aMC.IsDone()) { + aShapeCopy = aMC.Shape(); + } + else { + TColStd_IndexedDataMapOfTransientTransient aMapTShapes; + TNaming_CopyShape::CopyTool(theOriginalShape, aMapTShapes, aShapeCopy); + } } // 2. Limit tolerance. @@ -1048,7 +1055,7 @@ GetCreationInformation(std::string& theOperationName, AddParam( theParams, "Operation", op ); for ( int iP = aParams->Lower(), nbP = aParams->Upper(); iP <= nbP; ++iP ) { - const TCollection_ExtendedString& par = aParams->Value(i); + const TCollection_ExtendedString& par = aParams->Value(iP); TCollection_AsciiString parAscii( par ); if ( par.Search( op ) == 1 && parAscii.Value( op.Length() + 1 ) == '.' ) { @@ -1157,6 +1164,4 @@ void GEOMImpl_HealingDriver::SaveStatistics( const ShHealOper_Tool& healer, bool *stats = healer.GetStatistics(); } -IMPLEMENT_STANDARD_HANDLE (GEOMImpl_HealingDriver,GEOM_BaseDriver); - -IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_HealingDriver,GEOM_BaseDriver); +IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_HealingDriver,GEOM_BaseDriver)