X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_subMesh_i.cxx;h=92d6034e44a2cc5b3bc0cfcda108b5daa5b1366c;hp=4737a7b0e8eb28a7a8060d80a29beea5b64750e8;hb=6df8817c1a9827149025cc942249d7083f504d3d;hpb=37d2abfafb42447e05a6fae88738dea50724b514 diff --git a/src/SMESH_I/SMESH_subMesh_i.cxx b/src/SMESH_I/SMESH_subMesh_i.cxx index 4737a7b0e..92d6034e4 100644 --- a/src/SMESH_I/SMESH_subMesh_i.cxx +++ b/src/SMESH_I/SMESH_subMesh_i.cxx @@ -96,6 +96,8 @@ typedef list TListOfSubMeshes; bool getSubMeshes(::SMESH_subMesh* theSubMesh, TListOfSubMeshes& theSubMeshList) { + if ( !theSubMesh ) + return false; // "invalid sub-mesh" created by SMESH_Gen_i::CopyMeshWithGeom() size_t size = theSubMeshList.size(); // check all child sub-meshes of one complexity, @@ -582,3 +584,30 @@ SALOMEDS::TMPFile* SMESH_subMesh_i::GetVtkUgStream() SALOMEDS::TMPFile_var SeqFile; return SeqFile._retn(); } + +//======================================================================= +//function : SMESH_Invalid_subMesh_i +//purpose : constructor of "invalid sub-mesh" created by SMESH_Gen_i::CopyMeshWithGeom() +//======================================================================= + +SMESH_Invalid_subMesh_i::SMESH_Invalid_subMesh_i( PortableServer::POA_ptr thePOA, + SMESH_Gen_i* gen_i, + SMESH_Mesh_i* mesh_i, + int localId, + GEOM::GEOM_Object_ptr shape ) + : SALOME::GenericObj_i( thePOA ), + SMESH_subMesh_i( thePOA, gen_i, mesh_i, localId ) +{ + _geom = GEOM::GEOM_Object::_duplicate( shape ); +} + +//======================================================================= +//function : GetSubShape +//purpose : return geomtry which is not a sub-shape of the main shape +//======================================================================= + +GEOM::GEOM_Object_ptr SMESH_Invalid_subMesh_i::GetSubShape() + throw (SALOME::SALOME_Exception) +{ + return GEOM::GEOM_Object::_duplicate( _geom ); +}