]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0021275: EDF 1681 SMESH: Find the number of nodes of any group
authorvsr <vsr@opencascade.com>
Tue, 4 Oct 2011 13:14:47 +0000 (13:14 +0000)
committervsr <vsr@opencascade.com>
Tue, 4 Oct 2011 13:14:47 +0000 (13:14 +0000)
0021359: [CEA] Mesh information

idl/SMESH_Mesh.idl
resources/SalomeApp.xml.in
src/SMESH_I/SMESH_Mesh_i.cxx
src/SMESH_I/SMESH_Mesh_i.hxx

index aedab6bcfecb29be5fcade8f131a9002e947d3c3..927969dbb230cb1325a3ea3e6d8fa8fbb9006ab8 100644 (file)
@@ -306,6 +306,12 @@ module SMESH
     void Clear()
       raises (SALOME::SALOME_Exception);
 
+    /*!
+     *  Get the list of sub-meshes existing in the mesh
+     */
+    submesh_array GetSubMeshes()
+      raises (SALOME::SALOME_Exception);
+
     /*!
      * Remove all nodes and elements of submesh
      */
index 6de641a3f7d9a29e1a53ccf685ad337baea2c7e2..a3feab7a49fe5a049402e138881dd521a273c4c7 100644 (file)
@@ -76,6 +76,7 @@
     <parameter name="auto_groups"                  value="false"/>
     <parameter name="show_result_notification"     value="2"/>
     <parameter name="mesh_elem_info"               value="1"/>
+    <parameter name="info_groups_nodes_limit"      value="100000"/>
     <parameter name="segmentation"                 value="10"/>
     <parameter name="nb_segments_per_edge"         value="15"/>
     <parameter name="quadratic_mode"               value="0"/>
index 17b974e3cccc83da5ea05dd2e6cc19c9008327e4..07d8f2eddabeedfb9eee10ca8626f3e41191bbf7 100644 (file)
@@ -665,6 +665,42 @@ throw(SALOME::SALOME_Exception)
   return aList._retn();
 }
 
+SMESH::submesh_array* SMESH_Mesh_i::GetSubMeshes() throw (SALOME::SALOME_Exception)
+{
+  Unexpect aCatch(SALOME_SalomeException);
+  if (MYDEBUG) MESSAGE("GetSubMeshes");
+
+  SMESH::submesh_array_var aList = new SMESH::submesh_array();
+
+  // Python Dump
+  TPythonDump aPythonDump;
+  if ( !_mapSubMeshIor.empty() )
+    aPythonDump << "[ ";
+
+  try {
+    aList->length( _mapSubMeshIor.size() );
+    int i = 0;
+    map<int, SMESH::SMESH_subMesh_ptr>::iterator it = _mapSubMeshIor.begin();
+    for ( ; it != _mapSubMeshIor.end(); it++ ) {
+      if ( CORBA::is_nil( it->second )) continue;
+      aList[i++] = SMESH::SMESH_subMesh::_duplicate( it->second );
+      // Python Dump
+      if (i > 1) aPythonDump << ", ";
+      aPythonDump << it->second;
+    }
+    aList->length( i );
+  }
+  catch(SALOME_Exception & S_ex) {
+    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
+  }
+
+  // Update Python script
+  if ( !_mapSubMeshIor.empty() )
+    aPythonDump << " ] = " << _this() << ".GetSubMeshes()";
+
+  return aList._retn();
+}
+
 //=============================================================================
 /*!
  *
index d5109faf186fa09bab958ff96a12d177aa979c4f..dcd2bc5373a2a153902443ca27d43266c7533b12 100644 (file)
@@ -88,6 +88,9 @@ public:
   SMESH::ListOfHypothesis* GetHypothesisList(GEOM::GEOM_Object_ptr aSubShapeObject)
     throw (SALOME::SALOME_Exception);
 
+  SMESH::submesh_array* GetSubMeshes()
+    throw (SALOME::SALOME_Exception);
+
   SMESH::SMESH_subMesh_ptr GetSubMesh(GEOM::GEOM_Object_ptr aSubShapeObject, const char* theName)
     throw (SALOME::SALOME_Exception);