Back to index

salome-smesh  6.5.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
_pyFilter Class Reference

A filter sets a human readable name to self. More...

#include <SMESH_2smeshpy.hxx>

Inheritance diagram for _pyFilter:
Inheritance graph
[legend]
Collaboration diagram for _pyFilter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 _pyFilter (const Handle(_pyCommand)&theCreationCmd, const _pyID &newID="")
 Constructor of _pyFilter.
void AddUser (const Handle(_pyObject)&user)
virtual void Process (const Handle(_pyCommand)&theCommand)
 To convert creation of a filter by criteria and to replace an old name by a new one.
virtual void Flush ()
 Set new filter name to the creation command.
virtual bool CanClear ()
 Return true if all my users can be cleared.
virtual void Free ()
const _pyIDGetNewID () const
const Handle (_pyCommand)&GetCreationCmd()
const _pyIDGetID ()
int GetNbCalls () const
bool IsInStudy () const
virtual void SetRemovedFromStudy (const bool isRemoved)
void SetCreationCmd (Handle(_pyCommand) cmd)
int GetCommandNb ()
void AddProcessedCmd (const Handle(_pyCommand)&cmd)
std::list< Handle(_pyCommand) > & GetProcessedCmds ()
virtual const char * AccessorMethod () const
 Return method name giving access to an interaface object wrapped by python class.
virtual void ClearCommands ()
 Clear myCreationCmd and myProcessedCmds.

Static Public Member Functions

static _pyID FatherID (const _pyID &childID)
 Return ID of a father.

Protected Member Functions

 Handle (_pyCommand) myCreationCmd
void setID (const _pyID &theID)
 Set up myID and myIsPublished.

Protected Attributes

_pyID myID
std::list< Handle(_pyCommand) > myProcessedCmds
bool myIsPublished

Private Attributes

_pyID myNewID
_pyID myMesh
std::list< Handle(_pyObject) > myUsers

Detailed Description

A filter sets a human readable name to self.

Definition at line 557 of file SMESH_2smeshpy.hxx.


Constructor & Destructor Documentation

_pyFilter::_pyFilter ( const Handle(_pyCommand)&  theCreationCmd,
const _pyID newID = "" 
)

Constructor of _pyFilter.

Definition at line 3853 of file SMESH_2smeshpy.cxx.

  :_pyObject(theCreationCmd), myNewID( newID )
{
}

Member Function Documentation

const char * _pyObject::AccessorMethod ( ) const [virtual, inherited]

Return method name giving access to an interaface object wrapped by python class.

Return values:
constchar* - method name

Reimplemented in _pyAlgorithm, _pyMesh, and _pyGen.

Definition at line 3623 of file SMESH_2smeshpy.cxx.

{
  return 0;
}
void _pyObject::AddProcessedCmd ( const Handle(_pyCommand)&  cmd) [inline, inherited]

Definition at line 181 of file SMESH_2smeshpy.hxx.

  { if (myProcessedCmds.empty() || myProcessedCmds.back()!=cmd) myProcessedCmds.push_back( cmd );}

Here is the caller graph for this function:

void _pyFilter::AddUser ( const Handle(_pyObject)&  user) [inline]

Definition at line 563 of file SMESH_2smeshpy.hxx.

{ myUsers.push_back( user ); }
bool _pyFilter::CanClear ( ) [virtual]

Return true if all my users can be cleared.

Reimplemented from _pyObject.

Definition at line 3919 of file SMESH_2smeshpy.cxx.

{
  list< Handle(_pyObject) >::iterator obj = myUsers.begin();
  for ( ; obj != myUsers.end(); ++obj )
    if ( !(*obj)->CanClear() )
      return false;

  return true;
}
void _pyObject::ClearCommands ( ) [virtual, inherited]

Clear myCreationCmd and myProcessedCmds.

Reimplemented in _pyHypothesis, _pyMesh, and _pyGen.

Definition at line 3603 of file SMESH_2smeshpy.cxx.

{
  if ( !CanClear() )
    return;

  if ( !myCreationCmd.IsNull() )
    myCreationCmd->Clear();

  list< Handle(_pyCommand) >::iterator cmd = myProcessedCmds.begin();
  for ( ; cmd != myProcessedCmds.end(); ++cmd )
    (*cmd)->Clear();
}

Here is the call graph for this function:

_pyID _pyObject::FatherID ( const _pyID childID) [static, inherited]

Return ID of a father.

Definition at line 3633 of file SMESH_2smeshpy.cxx.

{
  int colPos = childID.SearchFromEnd(':');
  if ( colPos > 0 )
    return childID.SubString( 1, colPos-1 );
  return "";
}

Here is the caller graph for this function:

void _pyFilter::Flush ( ) [virtual]

Set new filter name to the creation command.

Implements _pyObject.

Definition at line 3907 of file SMESH_2smeshpy.cxx.

{
  if ( !myNewID.IsEmpty() && !GetCreationCmd()->IsEmpty() )
    GetCreationCmd()->SetResultValue( myNewID );
}
virtual void _pyFilter::Free ( ) [inline, virtual]

Reimplemented from _pyObject.

Definition at line 567 of file SMESH_2smeshpy.hxx.

{ myUsers.clear(); }
int _pyObject::GetCommandNb ( ) [inline, inherited]

Definition at line 180 of file SMESH_2smeshpy.hxx.

{ return myCreationCmd->GetOrderNb(); }
const _pyID& _pyObject::GetID ( ) [inline, inherited]

Definition at line 173 of file SMESH_2smeshpy.hxx.

{ return myID.IsEmpty() ? myCreationCmd->GetResultValue() : myID; }

Here is the call graph for this function:

Here is the caller graph for this function:

int _pyObject::GetNbCalls ( ) const [inline, inherited]

Definition at line 176 of file SMESH_2smeshpy.hxx.

{ return myProcessedCmds.size(); }

Here is the caller graph for this function:

const _pyID& _pyFilter::GetNewID ( ) const [inline]

Definition at line 568 of file SMESH_2smeshpy.hxx.

{ return myNewID; }
std::list< Handle(_pyCommand) >& _pyObject::GetProcessedCmds ( ) [inline, inherited]

Definition at line 183 of file SMESH_2smeshpy.hxx.

{ return myProcessedCmds; }
_pyObject::Handle ( _pyCommand  ) [protected, inherited]

Reimplemented in _pyMesh, _pyGen, and _pyGen.

Here is the caller graph for this function:

const _pyObject::Handle ( _pyCommand  ) [inline, inherited]

Reimplemented in _pyMesh, _pyGen, and _pyGen.

Definition at line 175 of file SMESH_2smeshpy.hxx.

{ return myCreationCmd; }
bool _pyObject::IsInStudy ( ) const [inline, inherited]

Definition at line 177 of file SMESH_2smeshpy.hxx.

{ return myIsPublished; }

Here is the caller graph for this function:

void _pyFilter::Process ( const Handle(_pyCommand)&  theCommand) [virtual]

To convert creation of a filter by criteria and to replace an old name by a new one.

Reimplemented from _pyObject.

Definition at line 3865 of file SMESH_2smeshpy.cxx.

{
  if ( theCommand->GetObject() == GetID() )
    _pyObject::Process(theCommand); // count commands

  if ( !myNewID.IsEmpty() )
    theCommand->SetObject( myNewID );
    
  // Convert the following set of commands into smesh.GetFilterFromCriteria(criteria)
  // aFilter0x2aaab0487080 = aFilterManager.CreateFilter()
  // aFilter0x2aaab0487080.SetCriteria(aCriteria)
  if ( GetNbCalls() == 1 && // none method was called before this SetCriteria() call
       theCommand->GetMethod() == "SetCriteria")
  {
    // aFilter.SetCriteria(aCriteria) ->
    // aFilter = smesh.GetFilterFromCriteria(criteria)
    if ( myNewID.IsEmpty() )
      theCommand->SetResultValue( GetID() );
    else
      theCommand->SetResultValue( myNewID );
    theCommand->SetObject( SMESH_2smeshpy::GenName() );
    theCommand->SetMethod( "GetFilterFromCriteria" );

    // Clear aFilterManager.CreateFilter()
    GetCreationCmd()->Clear();
  }
  else if ( theCommand->GetMethod() == "SetMesh" )
  {
    if ( myMesh == theCommand->GetArg( 1 ))
      theCommand->Clear();
    else
      myMesh = theCommand->GetArg( 1 );
    theGen->AddMeshAccessorMethod( theCommand );
  }
}

Here is the call graph for this function:

void _pyObject::SetCreationCmd ( Handle(_pyCommand cmd) [inline, inherited]

Definition at line 179 of file SMESH_2smeshpy.hxx.

{ myCreationCmd = cmd; }

Here is the caller graph for this function:

void _pyObject::setID ( const _pyID theID) [protected, inherited]

Set up myID and myIsPublished.

Definition at line 3591 of file SMESH_2smeshpy.cxx.

{
  myID = theID;
  myIsPublished = !theGen->IsNotPublished( GetID() );
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void _pyObject::SetRemovedFromStudy ( const bool  isRemoved) [inline, virtual, inherited]

Reimplemented in _pyMesh.

Definition at line 178 of file SMESH_2smeshpy.hxx.

{ myIsPublished = !isRemoved; }

Member Data Documentation

_pyID _pyObject::myID [protected, inherited]

Definition at line 165 of file SMESH_2smeshpy.hxx.

bool _pyObject::myIsPublished [protected, inherited]

Definition at line 168 of file SMESH_2smeshpy.hxx.

Definition at line 559 of file SMESH_2smeshpy.hxx.

Definition at line 559 of file SMESH_2smeshpy.hxx.

std::list< Handle(_pyCommand) > _pyObject::myProcessedCmds [protected, inherited]

Definition at line 167 of file SMESH_2smeshpy.hxx.

std::list< Handle(_pyObject) > _pyFilter::myUsers [private]

Definition at line 560 of file SMESH_2smeshpy.hxx.


The documentation for this class was generated from the following files: