Salome HOME
22316: EDF 2719 SMESH: Split hexas into prisms
[modules/smesh.git] / src / SMESH_I / SMESH_2smeshpy.cxx
index 870112bf9699d16da01511c0ed947e0518a5b50f..15e2a183fa74e83e5740de8cc75e1f6decb76c93 100644 (file)
@@ -44,7 +44,7 @@
 
 #include <LDOMParser.hxx>
 
-#ifdef WNT
+#ifdef WIN32
 #include <windows.h>
 #else
 #include <unistd.h>
@@ -201,6 +201,9 @@ namespace {
     _AString comment;
 
     _pyID obj = cmd->GetObject();
+    if ( obj.Search( "print " ) == 1 )
+      return; // print statement
+
     if ( !obj.IsEmpty() && obj.Value( obj.Length() ) == ')' )
       // remove an accessor method
       obj = _pyCommand( obj ).GetObject();
@@ -383,7 +386,7 @@ namespace {
         "ExtrusionSweepObject2D","ExtrusionSweepObject2DMakeGroups",
         "Translate","TranslateMakeGroups","TranslateMakeMesh",
         "TranslateObject","TranslateObjectMakeGroups", "TranslateObjectMakeMesh",
-        "ExtrusionAlongPathX","ExtrusionAlongPathObjX"
+        "ExtrusionAlongPathX","ExtrusionAlongPathObjX","SplitHexahedraIntoPrisms"
         ,"" }; // <- mark of the end
       methodsAcceptingList.Insert( methodNames );
     }
@@ -2072,6 +2075,7 @@ bool _pyMesh::NeedMeshAccess( const Handle(_pyCommand)& theCommand )
         "GetSubMeshElementsId","GetSubMeshNodesId","GetSubMeshElementType","Dump","GetNodeXYZ",
         "GetNodeInverseElements","GetShapeID","GetShapeIDForElem","GetElemNbNodes",
         "GetElemNode","IsMediumNode","IsMediumNodeOfAnyElem","ElemNbEdges","ElemNbFaces",
+        "GetElemFaceNodes", "GetFaceNormal", "FindElementByNodes",
         "IsPoly","IsQuadratic","BaryCenter","GetHypothesisList", "SetAutoColor", "GetAutoColor",
         "Clear", "ConvertToStandalone", "GetMeshOrder", "SetMeshOrder"
         ,"" }; // <- mark of end
@@ -2372,7 +2376,7 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand)
       "GetLastCreatedElems",
       "MirrorMakeMesh","MirrorObjectMakeMesh","TranslateMakeMesh","TranslateObjectMakeMesh",
       "Scale","ScaleMakeMesh","RotateMakeMesh","RotateObjectMakeMesh","MakeBoundaryMesh",
-      "MakeBoundaryElements", "SplitVolumesIntoTetra",
+      "MakeBoundaryElements", "SplitVolumesIntoTetra","SplitHexahedraIntoPrisms",
       "DoubleElements","DoubleNodes","DoubleNode","DoubleNodeGroup","DoubleNodeGroups",
       "DoubleNodeElem","DoubleNodeElemInRegion","DoubleNodeElemGroup",
       "DoubleNodeElemGroupInRegion","DoubleNodeElemGroups","DoubleNodeElemGroupsInRegion",
@@ -4246,10 +4250,13 @@ bool _pySelfEraser::CanClear()
   {
     int nbCalls = 0;
     std::list< Handle(_pyCommand) >& cmds = GetProcessedCmds();
-    std::list< Handle(_pyCommand) >::const_iterator cmd = cmds.begin();
-    for ( ; cmd != cmds.end(); ++cmd )
+    std::list< Handle(_pyCommand) >::iterator cmd = cmds.begin();
+    for ( ; cmd != cmds.end();  )
       // check of cmd emptiness is not enough as object can change
-      nbCalls += ( ( *cmd )->GetString().Search( GetID() ) > 0 );
+      if (( *cmd )->GetString().Search( GetID() ) > 0 )
+        ++nbCalls, ++cmd;
+      else
+        cmd = cmds.erase( cmd ); // save the cmd from clearing
 
     toErase = ( nbCalls < 1 );
   }