From 069418257e6fbdf5f4c5abba219b2e837d50e98c Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 1 Nov 2011 14:53:17 +0000 Subject: [PATCH] 0021014: EDF 1583 SMESH: Improvement of the Python Dump for the creation of groups 1) set SMESH.GeometryType instead of a numerical Threshold in GetCriterion() 2) set a human readable filter name in GroupOnFilter() --- src/SMESH_I/SMESH_2smeshpy.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 80d7a4d79..96e6e422d 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -384,6 +384,17 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand aCommand->SetArg( 2, Type ); aCommand->SetArg( 3, Compare ); + if ( Type == "SMESH.FT_ElemGeomType" && Threshold.IsIntegerValue() ) + { + // set SMESH.GeometryType instead of a numerical Threshold + const char* types[SMESH::Geom_POLYHEDRA+1] = { + "Geom_POINT", "Geom_EDGE", "Geom_TRIANGLE", "Geom_QUADRANGLE", "Geom_POLYGON", + "Geom_TETRA", "Geom_PYRAMID", "Geom_HEXA", "Geom_PENTA", "Geom_POLYHEDRA" + }; + int iGeom = Threshold.IntegerValue(); + if ( -1 < iGeom && iGeom < SMESH::Geom_POLYHEDRA+1 ) + Threshold = SMESH + types[ iGeom ]; + } if ( ThresholdStr.Length() != 2 ) // not '' or "" aCommand->SetArg( 4, ThresholdStr ); else if ( ThresholdID.Length() != 2 ) @@ -980,6 +991,11 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand ) else if ( method == "CreateGroupFromFilter" ) // --> GroupOnFilter() { theCommand->SetMethod( "GroupOnFilter" ); + // GroupOnFilter(typ, name, aFilter0x4743dc0 -> aFilter_1) + _pyID filterID = theCommand->GetArg(3); + Handle(_pyObject) filter = theGen->FindObject( filterID ); + if ( !filter.IsNull() && filter->IsKind(STANDARD_TYPE(_pyFilter))) + filter->Process( theCommand ); } // ---------------------------------------------------------------------- else if ( method == "GetIdsFromFilter" ) -- 2.39.2