mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-04-15 21:21:21 +05:00
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()
This commit is contained in:
parent
eea7a3b824
commit
069418257e
@ -384,6 +384,17 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
|
|||||||
aCommand->SetArg( 2, Type );
|
aCommand->SetArg( 2, Type );
|
||||||
aCommand->SetArg( 3, Compare );
|
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 ""
|
if ( ThresholdStr.Length() != 2 ) // not '' or ""
|
||||||
aCommand->SetArg( 4, ThresholdStr );
|
aCommand->SetArg( 4, ThresholdStr );
|
||||||
else if ( ThresholdID.Length() != 2 )
|
else if ( ThresholdID.Length() != 2 )
|
||||||
@ -980,6 +991,11 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand )
|
|||||||
else if ( method == "CreateGroupFromFilter" ) // --> GroupOnFilter()
|
else if ( method == "CreateGroupFromFilter" ) // --> GroupOnFilter()
|
||||||
{
|
{
|
||||||
theCommand->SetMethod( "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" )
|
else if ( method == "GetIdsFromFilter" )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user