X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_2smeshpy.cxx;h=def823814c7a5d1d431c76a383b5f003bbe53f28;hb=729271103404983b169bb2d30185035c8b76a3ae;hp=07b3d3399823699e3d26274f3b75a5e16b942b1b;hpb=de59ee6d8d84b7618a1692244983865e820f6431;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 07b3d3399..def823814 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2022 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 @@ -458,7 +458,7 @@ namespace { initialized = true; filteredArgs.push_back( "SMESH.MED_V2_1" ); filteredArgs.push_back( "SMESH.MED_V2_2" ); - } + } return std::find( filteredArgs.begin(), filteredArgs.end(), theArg ) != filteredArgs.end(); } } @@ -932,11 +932,13 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand "Geom_POLYHEDRA", "Geom_BALL" }; if ( -1 < iGeom && iGeom < nbTypes ) Threshold = SMESH + types[ iGeom ]; -#ifdef _DEBUG_ - // is types complete? (compilation failure means that enum GeometryType changed) - static_assert( sizeof(types) / sizeof(const char*) == nbTypes, - "Update names of GeometryType's!!!" ); -#endif + + if (SALOME::VerbosityActivated()) + { + // is types complete? (compilation failure means that enum GeometryType changed) + static_assert( sizeof(types) / sizeof(const char*) == nbTypes, + "Update names of GeometryType's!!!" ); + } } if (Type == "SMESH.FT_EntityType") { @@ -953,11 +955,13 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand "Entity_Polyhedra", "Entity_Quad_Polyhedra", "Entity_Ball" }; if ( -1 < iGeom && iGeom < nbTypes ) Threshold = SMESH + types[ iGeom ]; -#ifdef _DEBUG_ - // is 'types' complete? (compilation failure means that enum EntityType changed) - static_assert( sizeof(types) / sizeof(const char*) == nbTypes, - "Update names of EntityType's!!!" ); -#endif + + if (SALOME::VerbosityActivated()) + { + // is 'types' complete? (compilation failure means that enum EntityType changed) + static_assert( sizeof(types) / sizeof(const char*) == nbTypes, + "Update names of EntityType's!!!" ); + } } } if ( ThresholdID.Length() != 2 ) // neither '' nor "" @@ -1013,10 +1017,16 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand ) { Handle(_pyMesh) mesh = new _pyMesh( theCommand ); AddObject( mesh ); + // set mesh name + _pyID id = mesh->GetID(), comma("'"); + if ( myObjectNames.IsBound( id )) + theCommand->SetArg( theCommand->GetNbArgs() + 1, + comma + myObjectNames( id ) + comma); return; } if ( method == "CreateMeshesFromUNV" || method == "CreateMeshesFromSTL" || + method == "CreateDualMesh" || method == "CopyMesh" ) // command result is a mesh { Handle(_pyMesh) mesh = new _pyMesh( theCommand, theCommand->GetResultValue() ); @@ -1822,7 +1832,7 @@ _pyMesh::_pyMesh(const Handle(_pyCommand) theCreationCmd, const _pyID& meshId): const _pyID& meshID = theCreationCmd->GetObject(); addFatherMesh( meshID ); } - + // convert my creation command Handle(_pyCommand) creationCmd = GetCreationCmd(); creationCmd->SetObject( SMESH_2smeshpy::SmeshpyName() ); @@ -2206,7 +2216,8 @@ bool _pyMesh::NeedMeshAccess( const Handle(_pyCommand)& theCommand ) "GetElemNode","IsMediumNode","IsMediumNodeOfAnyElem","ElemNbEdges","ElemNbFaces", "GetElemFaceNodes", "GetFaceNormal", "FindElementByNodes", "IsPoly","IsQuadratic","BaryCenter","GetHypothesisList", "SetAutoColor", "GetAutoColor", - "Clear", "ConvertToStandalone", "GetMeshOrder", "SetMeshOrder" + "Clear", "ConvertToStandalone", "GetMeshOrder", "SetMeshOrder", + "SetNbThreads" ,"" }; // <- mark of end sameMethods.Insert( names ); } @@ -2414,7 +2425,7 @@ void _pyMesh::ClearCommands() list< Handle(_pySubMesh) >::iterator sm = mySubmeshes.begin(); for ( ; sm != mySubmeshes.end(); ++sm ) (*sm)->ClearCommands(); - + list< Handle(_pyGroup) >::iterator gr = myGroups.begin(); for ( ; gr != myGroups.end(); ++gr ) (*gr)->ClearCommands(); @@ -2486,10 +2497,10 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand) static TStringSet sameMethods; if ( sameMethods.empty() ) { const char * names[] = { - "RemoveElements","RemoveNodes","RemoveOrphanNodes", + "RemoveElements","RemoveNodes","RemoveOrphanNodes","RemoveNodeWithReconnection", "AddNode","Add0DElement","AddEdge","AddFace","AddPolygonalFace","AddBall", - "AddVolume","AddPolyhedralVolume","AddPolyhedralVolumeByFaces", - "MoveNode", "MoveClosestNodeToPoint","InverseDiag","DeleteDiag", + "AddVolume","AddPolyhedralVolume","AddPolyhedralVolumeByFaces","AddNodeOnSegment", + "MoveNode", "MoveClosestNodeToPoint","InverseDiag","DeleteDiag","AddNodeOnFace", "Reorient","ReorientObject","Reorient2DBy3D","Reorient2DByNeighbours", "TriToQuad","TriToQuadObject", "QuadTo4Tri", "SplitQuad","SplitQuadObject", "BestSplit","Smooth","SmoothObject","SmoothParametric","SmoothParametricObject", @@ -2574,7 +2585,7 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand) // 1. Remove "MakeGroups" from the Command TCollection_AsciiString aMethod = theCommand->GetMethod(); int nbArgsToAdd = diffLastTwoArgsMethods.Contains(aMethod) ? 2 : 1; - + if(is0DmethObj) pos = pos-2; //Remove "0D" from the Command too aMethod.Trunc(pos-1); @@ -3405,7 +3416,7 @@ void _pyLayerDistributionHypo::Flush() list< Handle(_pyCommand) >::iterator cmd = myArgCommands.begin(); _pyID prevNewName; for ( cmd = myArgCommands.begin(); cmd != myArgCommands.end(); ++cmd ) - { + { const _pyID& hyp1dID = (*cmd)->GetArg( 1 ); if ( hyp1dID.IsEmpty() ) continue; @@ -3429,7 +3440,7 @@ void _pyLayerDistributionHypo::Flush() } newName += "_Distribution"; prevNewName = newName; - + hyp1d->GetCreationCmd()->SetResultValue( newName ); } list< Handle(_pyCommand) >& cmds = theGen->GetCommands(); @@ -4626,7 +4637,7 @@ _pyGroup::_pyGroup(const Handle(_pyCommand)& theCreationCmd, const _pyID & id) //================================================================================ /*! - * \brief Check if "[ group1, group2 ] = mesh.GetGroups()" creation command + * \brief Check if "[ group1, group2 ] = mesh.GetGroups()" creation command * can be cleared */ //================================================================================ @@ -4797,7 +4808,7 @@ void _pyFilter::Process( const Handle(_pyCommand)& theCommand) if ( !myNewID.IsEmpty() ) theCommand->SetObject( myNewID ); - + // Convert the following set of commands into smesh.GetFilterFromCriteria(criteria) // aFilter0x2aaab0487080 = aFilterManager.CreateFilter() // aFilter0x2aaab0487080.SetCriteria(aCriteria) @@ -4840,7 +4851,7 @@ void _pyFilter::Process( const Handle(_pyCommand)& theCommand) void _pyFilter::Flush() { if ( myNewID.IsEmpty() ) return; - + list< Handle(_pyCommand) >::iterator cmd = myArgCmds.begin(); for ( ; cmd != myArgCmds.end(); ++cmd ) if ( !(*cmd)->IsEmpty() ) @@ -4977,7 +4988,7 @@ _pyHypothesisReader::_pyHypothesisReader() // ... // dim="2"> // - // + // // SetEnforcedVertex, // SetEnforcedVertexNamed //