/*!
* Filter
*/
- interface Filter: SALOME::GenericObj
+ interface Filter: SALOME::GenericObj, SMESH_IDSource
{
/*!
* Structure containing information about one criterion
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();
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 ) );
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();
{
if ( myPredicate )
myPredicate->Destroy();
+
+ if(!CORBA::is_nil(myMesh))
+ myMesh->Destroy();
+
+ TPythonDump()<<this<<".Destroy()";
}
//=======================================================================
// 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);
}
//=======================================================================
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();
}
FilterLibrary_i::~FilterLibrary_i()
{
delete myFileName;
+ TPythonDump()<<this<<".Destroy()";
}
//=======================================================================
protected:
Functor_i();
+ ~Functor_i();
protected:
Controls::FunctorPtr myFunctorPtr;
};
{
public:
Filter_i();
- virtual ~Filter_i();
+ ~Filter_i();
- void SetPredicate( Predicate_ptr );
- void SetMesh( SMESH_Mesh_ptr );
+ virtual
+ void
+ SetPredicate( Predicate_ptr );
+
+ virtual
+ void
+ SetMesh( SMESH_Mesh_ptr );
+
+ virtual
+ SMESH::long_array*
+ GetIDs();
static
- void GetElementsId( Predicate_i*,
- const SMDS_Mesh*,
- Controls::Filter::TIdSequence& );
+ void
+ GetElementsId( Predicate_i*,
+ const SMDS_Mesh*,
+ Controls::Filter::TIdSequence& );
static
- void GetElementsId( Predicate_i*,
- SMESH_Mesh_ptr,
- Controls::Filter::TIdSequence& );
+ void
+ GetElementsId( Predicate_i*,
+ SMESH_Mesh_ptr,
+ Controls::Filter::TIdSequence& );
+
+ virtual
+ long_array*
+ GetElementsId( SMESH_Mesh_ptr );
- long_array* GetElementsId( SMESH_Mesh_ptr );
- ElementType GetElementType();
+ virtual
+ ElementType
+ GetElementType();
- CORBA::Boolean GetCriteria( SMESH::Filter::Criteria_out theCriteria );
- CORBA::Boolean SetCriteria( const SMESH::Filter::Criteria& theCriteria );
+ virtual
+ CORBA::Boolean
+ GetCriteria( SMESH::Filter::Criteria_out theCriteria );
+
+ virtual
+ CORBA::Boolean
+ SetCriteria( const SMESH::Filter::Criteria& theCriteria );
- Predicate_ptr GetPredicate();
+ virtual
+ Predicate_ptr
+ GetPredicate();
+
Predicate_i* GetPredicate_i();
private:
Controls::Filter myFilter;
Predicate_i* myPredicate;
+ SMESH_Mesh_var myMesh;
};
{
public:
FilterManager_i();
+ ~FilterManager_i();
+
MinimumAngle_ptr CreateMinimumAngle();
AspectRatio_ptr CreateAspectRatio();
AspectRatio3D_ptr CreateAspectRatio3D();