From d77ffa61b6a1ada7e0c4ca1813fbe47f714faee3 Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 30 Mar 2005 10:18:40 +0000 Subject: [PATCH] PythonDump for SMESH Controls / Filter --- idl/SMESH_Filter.idl | 4 ++- src/SMESH_I/SMESH_Filter_i.cxx | 58 ++++++++++++++++++++++++++-------- src/SMESH_I/SMESH_Filter_i.hxx | 56 ++++++++++++++++++++++++-------- 3 files changed, 89 insertions(+), 29 deletions(-) diff --git a/idl/SMESH_Filter.idl b/idl/SMESH_Filter.idl index 0644362d4..929afb67a 100644 --- a/idl/SMESH_Filter.idl +++ b/idl/SMESH_Filter.idl @@ -278,7 +278,7 @@ module SMESH /*! * Filter */ - interface Filter: SALOME::GenericObj + interface Filter: SALOME::GenericObj, SMESH_IDSource { /*! * Structure containing information about one criterion @@ -312,6 +312,8 @@ module SMESH typedef sequence Criteria; void SetPredicate( in Predicate thePredicate ); + void SetMesh( in SMESH_Mesh theMesh ); + long_array GetElementsId( in SMESH_Mesh theMesh ); ElementType GetElementType(); Predicate GetPredicate(); diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 9374d8d33..a04b5a3c5 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -411,6 +411,11 @@ Functor_i::Functor_i(): SMESH_Gen_i::GetPOA()->activate_object( this ); } +Functor_i::~Functor_i() +{ + TPythonDump()<SetMesh( MeshPtr2SMDSMesh( theMesh ) ); @@ -1287,6 +1292,13 @@ FilterManager_i::FilterManager_i() SMESH_Gen_i::GetPOA()->activate_object( this ); } + +FilterManager_i::~FilterManager_i() +{ + TPythonDump()<Destroy(); + + if(!CORBA::is_nil(myMesh)) + myMesh->Destroy(); + + TPythonDump()<SetMesh( theMesh ); - TPythonDump()<Register(); + + if(!CORBA::is_nil(myMesh)) + myMesh->Destroy(); + + myMesh = theMesh; + TPythonDump()<length( iEnd ); - for ( ; i < iEnd; i++ ) - anArray[ i ] = aSequence[i]; - + if(!CORBA::is_nil(theMesh)){ + Controls::Filter::TIdSequence aSequence; + GetElementsId(myPredicate,theMesh,aSequence); + long i = 0, iEnd = aSequence.size(); + anArray->length( iEnd ); + for ( ; i < iEnd; i++ ) + anArray[ i ] = aSequence[i]; + } return anArray._retn(); } @@ -2399,6 +2428,7 @@ FilterLibrary_i::FilterLibrary_i() FilterLibrary_i::~FilterLibrary_i() { delete myFileName; + TPythonDump()<