else
aTag++;
- aMeshSO = publish (theStudy, theMesh, father, aTag, "ICON_SMESH_TREE_MESH" );
+ aMeshSO = publish (theStudy, theMesh, father, aTag, "ICON_SMESH_TREE_MESH_WARN" );
if ( aMeshSO->_is_nil() )
return aMeshSO._retn();
}
SetName( aRootSO, aRootName );
// Add new submesh to corresponding sub-tree
- aSubMeshSO = publish (theStudy, theSubMesh, aRootSO, 0, "ICON_SMESH_TREE_MESH");
+ aSubMeshSO = publish (theStudy, theSubMesh, aRootSO, 0, "ICON_SMESH_TREE_MESH_WARN");
if ( aSubMeshSO->_is_nil() )
return aSubMeshSO._retn();
}
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<SMESH_Mesh_i>( 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();