From 3c2674a6d91ad33888a69c050f5a9b9ef98bf3da Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 25 Mar 2005 13:05:29 +0000 Subject: [PATCH] task "Dump Python". Puslish submesh when assigning a local hypothesis --- src/SMESH_I/SMESH_Gen_i_1.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 4e50171a6..2b5593e58 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -773,7 +773,19 @@ bool SMESH_Gen_i::AddHypothesisToShape(SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_var aMeshOrSubMesh = GetMeshOrSubmeshByShape( theStudy, theMesh, theShape ); if ( aMeshOrSubMesh->_is_nil() ) - return false; + { + // publish submesh + TopoDS_Shape aShape = GeomObjectToShape( theShape ); + SMESH_Mesh_i* mesh_i = objectToServant( theMesh ); + if ( !aShape.IsNull() && mesh_i && mesh_i->GetImpl().GetMeshDS() ) { + SMESHDS_Mesh* meshDS = mesh_i->GetImpl().GetMeshDS(); + int shapeID = meshDS->ShapeToIndex( aShape ); + SMESH::SMESH_subMesh_var aSubMesh = mesh_i->getSubMesh(shapeID); + aMeshOrSubMesh = PublishSubMesh( theStudy, theMesh, aSubMesh, theShape ); + } + if ( aMeshOrSubMesh->_is_nil() ) + return false; + } //Find or Create Applied Hypothesis root bool aIsAlgo = !SMESH::SMESH_Algo::_narrow( theHyp )->_is_nil(); -- 2.39.2