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=b8358a7952b272a89bb7b2ad2c9a788a89e3f943;hb=5d68554076bbca0e1e95fb0db215a6c2b84b6c54;hpb=cd3ffac3fabc68b4d1dee2ad199302f04b20d2c8 diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index b8358a795..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() ) { @@ -390,7 +390,7 @@ namespace { ,"" }; // <- 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 ); @@ -3092,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; } @@ -3159,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 */ //================================================================================