From: eap Date: Tue, 21 May 2013 09:06:43 +0000 (+0000) Subject: 0022107: EDF 2502 SMESH: Publish the result of show bad mesh in a group X-Git-Tag: V7_3_0a1~433 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=dcd520f5767288f7b8035094a2e45b33aa74243b 0022107: EDF 2502 SMESH: Publish the result of show bad mesh in a group + // Create groups of elements preventing computation of a sub-shape + SMESH::ListOfGroups* MakeGroupsOfBadInputElements( SMESH::SMESH_Mesh_ptr theMesh, + CORBA::Short theSubShapeID, + const char* theGroupName) + throw ( SALOME::SALOME_Exception ); --- diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index e01f4a48a..82428ef94 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -124,7 +124,7 @@ #include #include #include -#include +#include using namespace std; using SMESH::TPythonDump; @@ -1441,7 +1441,6 @@ SMESH::compute_error_array* SMESH_Gen_i::GetComputeErrors( SMESH::SMESH_Mesh_ptr return error_array._retn(); } -// //================================================================================ /*! * \brief Return mesh elements preventing computation of a subshape @@ -1527,6 +1526,40 @@ SMESH_Gen_i::GetBadInputElements( SMESH::SMESH_Mesh_ptr theMesh, return result._retn(); } +//================================================================================ +/*! + * \brief Create a group of elements preventing computation of a sub-shape + */ +//================================================================================ + +SMESH::ListOfGroups* +SMESH_Gen_i::MakeGroupsOfBadInputElements( SMESH::SMESH_Mesh_ptr theMesh, + CORBA::Short theSubShapeID, + const char* theGroupName ) + throw ( SALOME::SALOME_Exception ) +{ + Unexpect aCatch(SALOME_SalomeException); + + SMESH::ListOfGroups_var groups; + + if ( CORBA::is_nil( theMesh ) ) + THROW_SALOME_CORBA_EXCEPTION( "bad Mesh reference",SALOME::BAD_PARAM ); + + try { + if ( SMESH_Mesh_i* meshServant = SMESH::DownCast( theMesh )) + { + groups = meshServant->MakeGroupsOfBadInputElements( theSubShapeID, theGroupName ); + TPythonDump() << groups << " = " << this + << ".MakeGroupsOfBadInputElements( " + << theMesh << ", " << theSubShapeID << ", '" << theGroupName << "' )"; + } + } + catch ( SALOME_Exception& S_ex ) { + INFOS( "catch exception "<< S_ex.what() ); + } + return groups._retn(); +} + //================================================================================ /*! * \brief Returns errors of hypotheses definintion diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index 798670f6b..bbd544fab 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -326,6 +326,12 @@ public: CORBA::Short theSubShapeID ) throw ( SALOME::SALOME_Exception ); + // Create groups of elements preventing computation of a sub-shape + SMESH::ListOfGroups* MakeGroupsOfBadInputElements( SMESH::SMESH_Mesh_ptr theMesh, + CORBA::Short theSubShapeID, + const char* theGroupName) + throw ( SALOME::SALOME_Exception ); + // Get sub-shapes unique ID's list SMESH::long_array* GetSubShapesId( GEOM::GEOM_Object_ptr theMainShapeObject, const SMESH::object_array& theListOfSubShape )