Salome HOME
0022107: EDF 2502 SMESH: Publish the result of show bad mesh in a group
authoreap <eap@opencascade.com>
Tue, 21 May 2013 09:06:43 +0000 (09:06 +0000)
committereap <eap@opencascade.com>
Tue, 21 May 2013 09:06:43 +0000 (09:06 +0000)
+  // 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 );

src/SMESH_I/SMESH_Gen_i.cxx
src/SMESH_I/SMESH_Gen_i.hxx

index e01f4a48a52e5ba997bb0cdebd690b6259c245be..82428ef94a977277cb7c1fdfe646eedbac8e9078 100644 (file)
 #include <map>
 #include <fstream>
 #include <cstdio>
-#include <stdlib.h>
+#include <cstdlib>
 
 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<SMESH_Mesh_i*>( 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
index 798670f6bf54a72a9c060b7ebcba846f0b117980..bbd544fabf3334b7d708ae85d9d4d0da325050e0 100644 (file)
@@ -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 )