Back to index

salome-gui  6.5.0
Signals | Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes
SALOME_Selection Class Reference

The class represents selection which can be used in Python. More...

#include <SalomePyQt.h>

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

List of all members.

Signals

void currentSelectionChanged ()

Public Member Functions

 ~SALOME_Selection ()
 Destructor.
void Clear ()
 Clear the selection.
void ClearIObjects ()
 Clear the selection.
void ClearFilters ()
 Removes all selection filters.

Static Public Member Functions

static SALOME_SelectionGetSelection (LightApp_Application *)
 Get the selection object for the specified application.

Private Slots

void onSelMgrDestroyed ()
 Called when selection manager is destroyed (usually when the study is closed).

Private Member Functions

 SALOME_Selection (QObject *)
 Constructor.

Private Attributes

LightApp_SelectionMgr * mySelMgr

Detailed Description

The class represents selection which can be used in Python.

Definition at line 47 of file SalomePyQt.h.


Constructor & Destructor Documentation

Destructor.

Definition at line 154 of file SalomePyQt.cxx.

{
  LightApp_Application* app = 0;
  QMap<LightApp_Application*, SALOME_Selection*>::Iterator it;
  for ( it = SelMap.begin(); it != SelMap.end() && !app; ++it ) {
    if ( it.value() == this ) app = it.key();
  }
  if ( app ) SelMap.remove( app );
}

Constructor.

Parameters:
pparent object

Definition at line 141 of file SalomePyQt.cxx.

                                               : QObject( 0 ), mySelMgr( 0 )
{
  LightApp_Application* app = dynamic_cast<LightApp_Application*>( p );
  if ( app ) {
    mySelMgr = app->selectionMgr();
    connect( mySelMgr, SIGNAL( selectionChanged() ), this, SIGNAL( currentSelectionChanged() ) );
    connect( mySelMgr, SIGNAL( destroyed() ),        this, SLOT  ( onSelMgrDestroyed() ) );
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

Clear the selection.

Definition at line 176 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event {
    LightApp_SelectionMgr* mySelMgr;
  public:
    TEvent( LightApp_SelectionMgr* selMgr ) 
      : mySelMgr( selMgr ) {}
    virtual void Execute() {
      if ( mySelMgr )
        mySelMgr->clearSelected();
    }
  };
  ProcessVoidEvent( new TEvent( mySelMgr ) );
}

Here is the call graph for this function:

Here is the caller graph for this function:

Removes all selection filters.

Definition at line 202 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event {
    LightApp_SelectionMgr* mySelMgr;
  public:
    TEvent( LightApp_SelectionMgr* selMgr ) 
      : mySelMgr( selMgr ) {}
    virtual void Execute() {
      if ( mySelMgr )
        mySelMgr->clearFilters();
    }
  };
  ProcessVoidEvent( new TEvent( mySelMgr ) );
}

Here is the call graph for this function:

Clear the selection.

Definition at line 194 of file SalomePyQt.cxx.

{
  Clear();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Get the selection object for the specified application.

Finds or creates the selection object (one per study).

Parameters:
appapplication object
Returns:
selection object or 0 if app is invalid

Definition at line 127 of file SalomePyQt.cxx.

{
  SALOME_Selection* sel = 0;
  if ( app && SelMap.find( app ) != SelMap.end() )
    sel = SelMap[ app ];
  else 
    sel = SelMap[ app ] = new SALOME_Selection( app );
  return sel;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Called when selection manager is destroyed (usually when the study is closed).

Definition at line 168 of file SalomePyQt.cxx.

{
  mySelMgr = 0;
}

Here is the caller graph for this function:


Member Data Documentation

LightApp_SelectionMgr* SALOME_Selection::mySelMgr [private]

Definition at line 66 of file SalomePyQt.h.


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