Salome HOME
0020749: EDF 1291 SMESH : Create 2D Mesh from 3D improvement tag_Before_ViscLayers_PrototypeVersion
authoreap <eap@opencascade.com>
Tue, 30 Nov 2010 17:43:56 +0000 (17:43 +0000)
committereap <eap@opencascade.com>
Tue, 30 Nov 2010 17:43:56 +0000 (17:43 +0000)
    wrap MakeBoundaryMesh()

src/SMESH_I/SMESH_2smeshpy.cxx

index dfb378f245374942c3cbcde707e2a473220d9af9..fd62cbd2f572178b3b8457304c8cef40aacbdc91 100644 (file)
@@ -247,7 +247,8 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
 
   // SMESH_Mesh method?
   map< _pyID, Handle(_pyMesh) >::iterator id_mesh = myMeshes.find( objID );
-  if ( id_mesh != myMeshes.end() ) {
+  if ( id_mesh != myMeshes.end() )
+  {
     // check for mesh editor object
     if ( aCommand->GetMethod() == "GetMeshEditor" ) { // MeshEditor creation
       _pyID editorID = aCommand->GetResultValue();
@@ -268,7 +269,8 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
 
   // SMESH_MeshEditor method?
   map< _pyID, Handle(_pyMeshEditor) >::iterator id_editor = myMeshEditors.find( objID );
-  if ( id_editor != myMeshEditors.end() ) {
+  if ( id_editor != myMeshEditors.end() )
+  {
     id_editor->second->Process( aCommand );
     TCollection_AsciiString processedCommand = aCommand->GetString();
     // some commands of SMESH_MeshEditor create meshes
@@ -277,6 +279,15 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
       aCommand->GetString() = processedCommand; // discard changes made by _pyMesh
       myMeshes.insert( make_pair( mesh->GetID(), mesh ));
     }
+    if ( aCommand->GetMethod() == "MakeBoundaryMesh") {
+      _pyID meshID = aCommand->GetResultValue(0);
+      if ( !myMeshes.count( meshID ) )
+      {
+        Handle(_pyMesh) mesh = new _pyMesh( aCommand, meshID );
+        aCommand->GetString() = processedCommand; // discard changes made by _pyMesh
+        myMeshes.insert( make_pair( meshID, mesh ));
+      }
+    }
     return aCommand;
   }
   // SMESH_Hypothesis method?
@@ -1125,7 +1136,7 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand)
       "SewBorderToSide","SewSideElements","ChangeElemNodes","GetLastCreatedNodes",
       "GetLastCreatedElems",
       "MirrorMakeMesh","MirrorObjectMakeMesh","TranslateMakeMesh",
-      "TranslateObjectMakeMesh","RotateMakeMesh","RotateObjectMakeMesh"
+      "TranslateObjectMakeMesh","RotateMakeMesh","RotateObjectMakeMesh","MakeBoundaryMesh"
       ,"" }; // <- mark of the end
     sameMethods.Insert( names );
   }