Back to index

salome-gui  6.5.0
Classes | Functions | Variables
SalomePyQt.cxx File Reference
#include <SALOME_PYQT_ModuleLight.h>
#include <SALOME_PYQT_DataModelLight.h>
#include "SalomePyQt.h"
#include <QApplication>
#include <QMenuBar>
#include <QMenu>
#include <QImage>
#include <QStringList>
#include <QAction>
#include <SALOME_Event.h>
#include <QtxActionMenuMgr.h>
#include <QtxActionGroup.h>
#include <QtxWorkstack.h>
#include <QtxTreeView.h>
#include <SUIT_Session.h>
#include <SUIT_Desktop.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_Tools.h>
#include <SUIT_ViewManager.h>
#include <SUIT_ViewWindow.h>
#include <SUIT_DataBrowser.h>
#include <STD_TabDesktop.h>
#include <LightApp_Application.h>
#include <LightApp_Study.h>
#include <LightApp_SelectionMgr.h>
#include <LogWindow.h>
#include <OCCViewer_ViewWindow.h>
#include <Plot2d_ViewManager.h>
#include <Plot2d_ViewWindow.h>

Go to the source code of this file.

Classes

class  TGetDesktopEvent
class  TGetMainFrameEvent
class  TGetMainMenuBarEvent
class  TGetPopupMenuEvent
class  TGetObjectBrowserEvent
class  TGetStudyIdEvent
class  TGetSelectionEvent
class  TPutInfoEvent
class  TGetActiveComponentEvent
class  TGetActivePyModuleEvent
class  TActivateModuleEvent
class  TIsModifiedEvent
 SalomePyQt::isModified() More...
class  TGetSettingEvent
class  TGetIntSettingEvent
class  TGetDblSettingEvent
class  TGetBoolSettingEvent
class  TGetStrSettingEvent
class  TGetColorSettingEvent
class  THasColorSettingEvent
class  TGetFileNameEvent
class  TGetOpenFileNamesEvent
class  TGetExistingDirectoryEvent
class  TLoadIconEvent
class  TDumpViewEvent
class  TDefMenuGroupEvent
class  CrTool
class  TCreateToolEvent
class  CrMenu
class  TCreateMenuEvent
class  TCreateSepEvent
class  TCreateActionEvent
struct  TcreateActionGroupEvent
class  TActionEvent
class  TActionIdEvent
class  TAddGlobalPrefEvent
class  TAddPrefEvent
class  TAddPrefParamEvent
class  TPrefPropEvent
class  TGetViews
class  TGetActiveView
class  TGetViewType
class  TSetViewTitle
class  TGetViewTitle
class  TFindViews
class  TActivateView
class  TCreateView
class  TCreateViewWg
class  TCloseView
class  TCloneView
class  TIsViewVisible
class  TIsViewClosable
class  TGroupAllViews
class  TSplitView
class  TMoveView
class  TNeighbourViews
class  TCreateEmptyObjectEvent
 SalomePyQt::createObject(parent) Create empty data object. More...
class  TCreateObjectEvent
 SalomePyQt::createObject( name, icon, tooltip, parent ) Create data object with name, icon and tooltip. More...
class  TSetNameEvent
 SalomePyQt::setName(obj,name) Set object name. More...
class  TSetIconEvent
 SalomePyQt::setIcon(obj,icon) Set object icon. More...
class  TSetToolTipEvent
 SalomePyQt::setToolTip(obj,tooltip) Set object tool tip. More...
class  TSetRefEvent
 SalomePyQt::setReference(obj,refEntry) Set entry to referenced object. More...
class  TSetColorEvent
 SalomePyQt::setColor(obj,color) Set object color. More...
class  TGetNameEvent
 SalomePyQt::getName(obj) Return name of object. More...
class  TGetToolTipEvent
 SalomePyQt::getToolTip(obj) Return tool tip of object. More...
class  TGetRefEvent
 SalomePyQt::getReference(obj) Return entry of the referenced object (if any) More...
class  TGetColorEvent
 SalomePyQt::getColor(obj) Return the color of the object. More...
class  TRemoveChildEvent
 SalomePyQt::removeChild(obj) Remove childrens from object. More...
class  TRemoveObjectEvent
 SalomePyQt::removeObject(obj) Remove object. More...
class  TGetChildrenEvent
 SalomePyQt::getChildren(obj) Return the list of the child objects if rec == true then function get all sub children. More...

Functions

static LightApp_ApplicationgetApplication ()
 Get the currently active application.
static LightApp_Study * getActiveStudy ()
 Get the currently active study.
static SALOME_PYQT_ModuleLightgetActiveModule ()
 Get the currently active module.
static QString getMenuName (const QString &menuId)
 Get menu item title.
static SUIT_ViewWindowgetWnd (const int id)
 Gets window with specified identifier.

Variables

static QMap
< LightApp_Application
*, SALOME_Selection * > 
SelMap
 Map of created selection objects.
static const char * DEFAULT_SECTION = "SalomePyQt"
 Default resource file section name.

Function Documentation

Get the currently active module.

This function returns correct result only if Python-based module is currently active. Otherwize, 0 is returned.

Definition at line 97 of file SalomePyQt.cxx.

{
  SALOME_PYQT_ModuleLight* module = 0;
  if ( LightApp_Application* anApp = getApplication() ) {
    module = SALOME_PYQT_ModuleLight::getInitModule();
    if ( !module )
      module = dynamic_cast<SALOME_PYQT_ModuleLight*>( anApp->activeModule() );
  }
  return module;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static LightApp_Study* getActiveStudy ( ) [static]

Get the currently active study.

Returns:
active study or 0 if there is no study opened

Definition at line 84 of file SalomePyQt.cxx.

{
  if ( getApplication() )
    return dynamic_cast<LightApp_Study*>( getApplication()->activeStudy() );
  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static LightApp_Application* getApplication ( ) [static]

Get the currently active application.

Returns:
active application object or 0 if there is no any

Definition at line 72 of file SalomePyQt.cxx.

{
  if ( SUIT_Session::session() )
    return dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
  return 0;
}

Here is the caller graph for this function:

static QString getMenuName ( const QString &  menuId) [static]

Get menu item title.

Parameters:
menuIdmenu identifier
Returns:
menu title (localized)

Definition at line 355 of file SalomePyQt.cxx.

{
  QStringList contexts;
  contexts << "SalomeApp_Application" << "LightApp_Application" << "STD_TabDesktop" <<
    "STD_MDIDesktop" << "STD_Application" << "SUIT_Application" << "";
  QString menuName = menuId;
  for ( int i = 0; i < contexts.count() && menuName == menuId; i++ )
    menuName = QApplication::translate( contexts[i].toLatin1().data(), menuId.toLatin1().data() );
  return menuName;
}

Here is the caller graph for this function:

static SUIT_ViewWindow* getWnd ( const int  id) [static]

Gets window with specified identifier.

Parameters:
idwindow identifier
Returns:
pointer on the window

Definition at line 2227 of file SalomePyQt.cxx.

{
  SUIT_ViewWindow* resWnd = 0;

  LightApp_Application* app = getApplication();
  if ( app )
  {
    ViewManagerList vmlist = app->viewManagers();
    foreach( SUIT_ViewManager* vm, vmlist )
    {
      QVector<SUIT_ViewWindow*> vwlist = vm->getViews();
      foreach ( SUIT_ViewWindow* vw, vwlist )
      {
        if ( id == vw->getId() )
        {
          resWnd = vw;
          break;
        }
      }
    }
  }

  return resWnd;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const char* DEFAULT_SECTION = "SalomePyQt" [static]

Default resource file section name.

Definition at line 690 of file SalomePyQt.cxx.

Map of created selection objects.

Definition at line 117 of file SalomePyQt.cxx.