X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_2smeshpy.cxx;h=f5595c08aaa65e5298d0e8903ba69778bddf47ce;hp=929da0dcf43bc2518b5e946ff3dd1d90e88374f8;hb=9ab3722c1b5f134261069e4a7fefe6b9c10820a9;hpb=2ec7f35acedb4734ca755bd095a5504440e875f8 diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 929da0dcf..f5595c08a 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -372,7 +372,7 @@ namespace { */ //================================================================================ - void StructToList( Handle( _pyCommand)& theCommand ) + void StructToList( Handle( _pyCommand)& theCommand, const bool checkMethod=true ) { static TStringSet methodsAcceptingList; if ( methodsAcceptingList.empty() ) { @@ -386,11 +386,11 @@ namespace { "ExtrusionSweepObject2D","ExtrusionSweepObject2DMakeGroups", "Translate","TranslateMakeGroups","TranslateMakeMesh", "TranslateObject","TranslateObjectMakeGroups", "TranslateObjectMakeMesh", - "ExtrusionAlongPathX","ExtrusionAlongPathObjX" + "ExtrusionAlongPathX","ExtrusionAlongPathObjX","SplitHexahedraIntoPrisms" ,"" }; // <- mark of the end methodsAcceptingList.Insert( methodNames ); } - if ( methodsAcceptingList.Contains( theCommand->GetMethod() )) + if ( !checkMethod || methodsAcceptingList.Contains( theCommand->GetMethod() )) { for ( int i = theCommand->GetNbArgs(); i > 0; --i ) { @@ -1963,9 +1963,9 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand ) TCollection_AsciiString newMethod = method; newMethod.Remove( 7, 6 ); theCommand->SetMethod( newMethod ); - // make the 1st arg be the last one (or last but one for ExportMED()) + // make the 1st arg be the last one (or last but three for ExportMED()) _pyID partID = theCommand->GetArg( 1 ); - int nbArgs = theCommand->GetNbArgs() - (newMethod == "ExportMED"); + int nbArgs = theCommand->GetNbArgs() - 3 * (newMethod == "ExportMED"); for ( int i = 2; i <= nbArgs; ++i ) theCommand->SetArg( i-1, theCommand->GetArg( i )); theCommand->SetArg( nbArgs, partID ); @@ -2075,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 @@ -2375,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", @@ -2631,6 +2632,8 @@ Handle(_pyHypothesis) _pyHypothesis::NewHypothesis( const Handle(_pyCommand)& th hyp->SetConvMethodAndType( "SetGrid", "Cartesian_3D"); for ( int iArg = 0; iArg < 4; ++iArg ) hyp->setCreationArg( iArg+1, "[]"); + hyp->AddAccumulativeMethod( "SetGrid" ); + hyp->AddAccumulativeMethod( "SetGridSpacing" ); } else { @@ -3089,9 +3092,11 @@ void _pyComplexParamHypo::Process( const Handle(_pyCommand)& theCommand) { // CartesianParameters3D hyp - if ( theCommand->GetMethod() == "SetSizeThreshold" ) + if ( theCommand->GetMethod() == "SetSizeThreshold" || + theCommand->GetMethod() == "SetToAddEdges" ) { - setCreationArg( 4, theCommand->GetArg( 1 )); + int iEdges = ( theCommand->GetMethod().Value( 4 ) == 'T' ); + setCreationArg( 4+iEdges, theCommand->GetArg( 1 )); myArgCommands.push_back( theCommand ); return; } @@ -3113,7 +3118,9 @@ void _pyComplexParamHypo::Process( const Handle(_pyCommand)& theCommand) myCurCrMethod->myArgs[ iArg ] += "]"; } myArgCommands.push_back( theCommand ); - rememberCmdOfParameter( theCommand ); + //rememberCmdOfParameter( theCommand ); -- these commands are marked as + // accumulative, else, if the creation + // is not converted, commands for axes 1 and 2 are lost return; } } @@ -3154,13 +3161,23 @@ void _pyComplexParamHypo::Flush() for ( ; cmd != myUnusedCommands.end(); ++cmd ) if ((*cmd)->GetMethod() == "SetObjectEntry" ) (*cmd)->Clear(); + + if ( GetAlgoType() == "Cartesian_3D" ) + { + _pyID algo = myCreationCmd->GetObject(); + for ( cmd = myProcessedCmds.begin(); cmd != myProcessedCmds.end(); ++cmd ) + { + StructToList( *cmd, /*checkMethod=*/false ); + (*cmd)->SetObject( algo ); + } + } } } //================================================================================ /*! * \brief Convert methods of 1D hypotheses to my own methods - * \param theCommand - The called hypothesis method + * \param theCommand - The called hypothesis method */ //================================================================================