PythonDump for SMESH Controls / Filter

This commit is contained in:
apo 2005-03-30 10:18:40 +00:00
parent e5c454adf0
commit d77ffa61b6
3 changed files with 92 additions and 32 deletions

View File

@ -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<Criterion> Criteria;
void SetPredicate( in Predicate thePredicate );
void SetMesh( in SMESH_Mesh theMesh );
long_array GetElementsId( in SMESH_Mesh theMesh );
ElementType GetElementType();
Predicate GetPredicate();

View File

@ -411,6 +411,11 @@ Functor_i::Functor_i():
SMESH_Gen_i::GetPOA()->activate_object( this );
}
Functor_i::~Functor_i()
{
TPythonDump()<<this<<".Destroy()";
}
void Functor_i::SetMesh( SMESH_Mesh_ptr theMesh )
{
myFunctorPtr->SetMesh( MeshPtr2SMDSMesh( theMesh ) );
@ -1287,6 +1292,13 @@ FilterManager_i::FilterManager_i()
SMESH_Gen_i::GetPOA()->activate_object( this );
}
FilterManager_i::~FilterManager_i()
{
TPythonDump()<<this<<".Destroy()";
}
MinimumAngle_ptr FilterManager_i::CreateMinimumAngle()
{
SMESH::MinimumAngle_i* aServant = new SMESH::MinimumAngle_i();
@ -1565,6 +1577,11 @@ Filter_i::~Filter_i()
{
if ( myPredicate )
myPredicate->Destroy();
if(!CORBA::is_nil(myMesh))
myMesh->Destroy();
TPythonDump()<<this<<".Destroy()";
}
//=======================================================================
@ -1599,12 +1616,25 @@ SMESH::ElementType Filter_i::GetElementType()
// name : Filter_i::SetMesh
// Purpose : Set mesh
//=======================================================================
void Filter_i::SetMesh( SMESH_Mesh_ptr theMesh )
void
Filter_i::
SetMesh( SMESH_Mesh_ptr theMesh )
{
if(myPredicate){
myPredicate->SetMesh( theMesh );
TPythonDump()<<this<<".SetMesh("<<theMesh<<")";
}
if(!CORBA::is_nil(theMesh))
theMesh->Register();
if(!CORBA::is_nil(myMesh))
myMesh->Destroy();
myMesh = theMesh;
TPythonDump()<<this<<".SetMesh("<<theMesh<<")";
}
SMESH::long_array*
Filter_i::
GetIDs()
{
return GetElementsId(myMesh);
}
//=======================================================================
@ -1634,16 +1664,15 @@ SMESH::long_array*
Filter_i::
GetElementsId( SMESH_Mesh_ptr theMesh )
{
Controls::Filter::TIdSequence aSequence;
GetElementsId(myPredicate,theMesh,aSequence);
SMESH::long_array_var anArray = new SMESH::long_array;
long i = 0, iEnd = aSequence.size();
anArray->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()<<this<<".Destroy()";
}
//=======================================================================

View File

@ -125,6 +125,7 @@ namespace SMESH
protected:
Functor_i();
~Functor_i();
protected:
Controls::FunctorPtr myFunctorPtr;
};
@ -629,32 +630,57 @@ namespace SMESH
{
public:
Filter_i();
virtual ~Filter_i();
~Filter_i();
void SetPredicate( Predicate_ptr );
void SetMesh( SMESH_Mesh_ptr );
static
void GetElementsId( Predicate_i*,
const SMDS_Mesh*,
Controls::Filter::TIdSequence& );
static
void GetElementsId( Predicate_i*,
SMESH_Mesh_ptr,
Controls::Filter::TIdSequence& );
virtual
void
SetPredicate( Predicate_ptr );
long_array* GetElementsId( SMESH_Mesh_ptr );
ElementType GetElementType();
virtual
void
SetMesh( SMESH_Mesh_ptr );
virtual
SMESH::long_array*
GetIDs();
CORBA::Boolean GetCriteria( SMESH::Filter::Criteria_out theCriteria );
CORBA::Boolean SetCriteria( const SMESH::Filter::Criteria& theCriteria );
static
void
GetElementsId( Predicate_i*,
const SMDS_Mesh*,
Controls::Filter::TIdSequence& );
static
void
GetElementsId( Predicate_i*,
SMESH_Mesh_ptr,
Controls::Filter::TIdSequence& );
Predicate_ptr GetPredicate();
virtual
long_array*
GetElementsId( SMESH_Mesh_ptr );
virtual
ElementType
GetElementType();
virtual
CORBA::Boolean
GetCriteria( SMESH::Filter::Criteria_out theCriteria );
virtual
CORBA::Boolean
SetCriteria( const SMESH::Filter::Criteria& theCriteria );
virtual
Predicate_ptr
GetPredicate();
Predicate_i* GetPredicate_i();
private:
Controls::Filter myFilter;
Predicate_i* myPredicate;
SMESH_Mesh_var myMesh;
};
@ -704,6 +730,8 @@ namespace SMESH
{
public:
FilterManager_i();
~FilterManager_i();
MinimumAngle_ptr CreateMinimumAngle();
AspectRatio_ptr CreateAspectRatio();
AspectRatio3D_ptr CreateAspectRatio3D();