Salome HOME
Merge from V6_2_BR 23/12/2010
[modules/smesh.git] / src / SMESH_I / SMESH_2smeshpy.cxx
index dfb378f245374942c3cbcde707e2a473220d9af9..26a480a4e02e927e437389f03c73a783ba0caab1 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?
@@ -352,7 +363,7 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
     myMeshes.insert( make_pair( mesh->GetID(), mesh ));
     return;
   }
-  if ( method == "CreateMeshesFromUNV" || method == "CreateMeshesFromSTL")
+  if ( method == "CreateMeshesFromUNV" || method == "CreateMeshesFromSTL" || method == "CopyMesh" )
   {
     Handle(_pyMesh) mesh = new _pyMesh( theCommand, theCommand->GetResultValue() );
     myMeshes.insert( make_pair( mesh->GetID(), mesh ));
@@ -1118,14 +1129,15 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand)
       "ConvertToQuadratic","ConvertFromQuadratic","RenumberNodes","RenumberElements",
       "RotationSweep","RotationSweepObject","RotationSweepObject1D","RotationSweepObject2D",
       "ExtrusionSweep","AdvancedExtrusion","ExtrusionSweepObject","ExtrusionSweepObject1D","ExtrusionSweepObject2D",
-      "ExtrusionAlongPath","ExtrusionAlongPathObject","ExtrusionAlongPathObject1D","ExtrusionAlongPathObject2D",
+      "ExtrusionAlongPath","ExtrusionAlongPathObject","ExtrusionAlongPathX",
+      "ExtrusionAlongPathObject1D","ExtrusionAlongPathObject2D",
       "Mirror","MirrorObject","Translate","TranslateObject","Rotate","RotateObject",
       "FindCoincidentNodes",/*"FindCoincidentNodesOnPart",*/"MergeNodes","FindEqualElements",
       "MergeElements","MergeEqualElements","SewFreeBorders","SewConformFreeBorders",
       "SewBorderToSide","SewSideElements","ChangeElemNodes","GetLastCreatedNodes",
       "GetLastCreatedElems",
       "MirrorMakeMesh","MirrorObjectMakeMesh","TranslateMakeMesh",
-      "TranslateObjectMakeMesh","RotateMakeMesh","RotateObjectMakeMesh"
+      "TranslateObjectMakeMesh","RotateMakeMesh","RotateObjectMakeMesh","MakeBoundaryMesh"
       ,"" }; // <- mark of the end
     sameMethods.Insert( names );
   }
@@ -1166,6 +1178,13 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand)
     }
   }
 
+  // set "ExtrusionAlongPathX()" instead of "ExtrusionAlongPathObjX()"
+  if ( !isPyMeshMethod && method == "ExtrusionAlongPathObjX")
+  {
+    isPyMeshMethod=true;
+    theCommand->SetMethod("ExtrusionAlongPathX");
+  }
+
   // set "FindCoincidentNodesOnPart()" instead of "FindCoincidentNodesOnPartBut()"
   if ( !isPyMeshMethod && method == "FindCoincidentNodesOnPartBut")
   {