From: eap Date: Tue, 30 Nov 2010 17:43:56 +0000 (+0000) Subject: 0020749: EDF 1291 SMESH : Create 2D Mesh from 3D improvement X-Git-Tag: tag_Before_ViscLayers_PrototypeVersion X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=ee8e92f681be21e562a408355e9835a7012aefcc;hp=d628c6bca59a6d7130d7c83231e4c6a2de77761f;p=modules%2Fsmesh.git 0020749: EDF 1291 SMESH : Create 2D Mesh from 3D improvement wrap MakeBoundaryMesh() --- diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index dfb378f24..fd62cbd2f 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -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 ); }