mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-14 02:30:35 +05:00
Fix for the Bug IPAL22045 TC5.1.5: Dump python doesn't restore GEOM-012 result
This commit is contained in:
parent
9bf18f0325
commit
b7b5b3b6af
@ -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
|
||||
|
@ -67,8 +67,6 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeShell (std::list<Handle(GEOM_Object)> theShapes);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeSolidShell (Handle(GEOM_Object) theShell);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeSolidShells (std::list<Handle(GEOM_Object)> theShells);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeCompound (std::list<Handle(GEOM_Object)> theShapes);
|
||||
|
@ -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<Handle(GEOM_Object)> 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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user