X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i_1.cxx;h=d3c645941bb8bbf65da35314c8e06cc352d73426;hb=ab6b16e673b44c983e261331181bcec90be2e920;hp=dd9c3893f089eff3d11665804f091cd05239d2c8;hpb=e4737e85f0da6d3f90fd08f6be1c2825195fe16f;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index dd9c3893f..d3c645941 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -33,6 +33,8 @@ #include "SMESH_Algo_i.hxx" #include "SMESH_Group_i.hxx" +#include "SMESH.hxx" + #include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog) #include "utilities.h" @@ -46,28 +48,6 @@ static int MYDEBUG = 0; static int MYDEBUG = 0; #endif -// Tags definition =========================================================== -// Top level -long Tag_HypothesisRoot = 1; // hypotheses root -long Tag_AlgorithmsRoot = 2; // algorithms root -// Mesh/Submesh -long Tag_RefOnShape = 1; // references to shape -long Tag_RefOnAppliedHypothesis = 2; // applied hypotheses root -long Tag_RefOnAppliedAlgorithms = 3; // applied algorithms root -// Mesh only -long Tag_SubMeshOnVertex = 4; // sub-meshes roots by type -long Tag_SubMeshOnEdge = 5; // ... -long Tag_SubMeshOnWire = 6; // ... -long Tag_SubMeshOnFace = 7; // ... -long Tag_SubMeshOnShell = 8; // ... -long Tag_SubMeshOnSolid = 9; // ... -long Tag_SubMeshOnCompound = 10; // ... -long Tag_NodeGroups = 11; // Group roots by type -long Tag_EdgeGroups = 12; // ... -long Tag_FaceGroups = 13; // ... -long Tag_VolumeGroups = 14; // ... -// =========================================================================== - //============================================================================= /*! * Get...Tag [ static ] @@ -166,7 +146,10 @@ long SMESH_Gen_i::GetVolumeGroupsTag() bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR) { - if(MYDEBUG) MESSAGE("CanPublishInStudy"); + if(MYDEBUG) MESSAGE("CanPublishInStudy - "<_is_nil() ) return true; @@ -491,7 +474,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr theStudy, 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(); } @@ -613,7 +596,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr theS 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(); } @@ -793,7 +776,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();