From: rnv Date: Wed, 6 Oct 2010 11:14:51 +0000 (+0000) Subject: Fix for the Bug IPAL22045 TC5.1.5: Dump python doesn't restore GEOM-012 result X-Git-Tag: V5_1_5rc1~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b7b5b3b6afc2d831c46c9693d144546917aba3fb;p=modules%2Fgeom.git Fix for the Bug IPAL22045 TC5.1.5: Dump python doesn't restore GEOM-012 result --- diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index 202a02f44..93eb4535e 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -435,60 +435,6 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidShells return MakeShape(theShapes, GEOM_SOLID, SOLID_SHELLS, "MakeSolid"); } -//============================================================================= -/*! - * MakeSolidShell - */ -//============================================================================= -Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidShell (Handle(GEOM_Object) theShell) -{ - SetErrorCode(KO); - - if (theShell.IsNull()) return NULL; - - //Add a new Solid object - Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GetDocID(), GEOM_SOLID); - - //Add a new Solid function for creation of a solid from a shell - Handle(GEOM_Function) aFunction = - aSolid->AddFunction(GEOMImpl_ShapeDriver::GetID(), SOLID_SHELL); - if (aFunction.IsNull()) return NULL; - - //Check if the function is set correctly - if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL; - - GEOMImpl_IShapes aCI (aFunction); - - Handle(GEOM_Function) aRefShell = theShell->GetLastFunction(); - - if (aRefShell.IsNull()) return NULL; - - aCI.SetBase(aRefShell); - - //Compute the Solid value - try { -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 - OCC_CATCH_SIGNALS; -#endif - if (!GetSolver()->ComputeFunction(aFunction)) { - SetErrorCode("Solid driver failed"); - return NULL; - } - } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); - return NULL; - } - - //Make a Python command - GEOM::TPythonDump(aFunction) << aSolid - << " = geompy.MakeSolid(" << theShell << ")"; - - SetErrorCode(OK); - return aSolid; -} - //============================================================================= /*! * MakeCompound diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx index c776217c9..23dbccb53 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx @@ -67,8 +67,6 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations Standard_EXPORT Handle(GEOM_Object) MakeShell (std::list theShapes); - Standard_EXPORT Handle(GEOM_Object) MakeSolidShell (Handle(GEOM_Object) theShell); - Standard_EXPORT Handle(GEOM_Object) MakeSolidShells (std::list theShells); Standard_EXPORT Handle(GEOM_Object) MakeCompound (std::list theShapes); diff --git a/src/GEOM_I/GEOM_IShapesOperations_i.cc b/src/GEOM_I/GEOM_IShapesOperations_i.cc index f6ff7d0e2..07c9943a9 100644 --- a/src/GEOM_I/GEOM_IShapesOperations_i.cc +++ b/src/GEOM_I/GEOM_IShapesOperations_i.cc @@ -229,8 +229,11 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShell Handle(GEOM_Object) aShell = GetObjectImpl(theShell); if (aShell.IsNull()) return aGEOMObject._retn(); + std::list aShapes; + aShapes.push_back(aShell); + //Create the Solid - Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShell(aShell); + Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShells(aShapes); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();