Version: 6.3.1
Public Member Functions

SALOMEGUI_Swig Class Reference

Python interface module for SALOME GUI. More...

#include <SALOMEGUI_Swig.hxx>

Inheritance diagram for SALOMEGUI_Swig:
Inheritance graph

Public Member Functions

 SALOMEGUI_Swig ()
 Constructor.
 ~SALOMEGUI_Swig ()
 Destructor.
bool hasDesktop ()
 Check GUI availability.
void updateObjBrowser (bool)
 Update active study's Object Browser.
int getActiveStudyId ()
 Get active study identifier.
const char * getActiveStudyName ()
 Get active study name.
const char * getComponentName (const char *)
 Get name of the component by its title (user name)
const char * getComponentUserName (const char *)
 Get title (user name) of the component by its name.
int SelectedCount ()
 Get number of selected items.
const char * getSelected (int i)
 Get entry of the specified selected item.
void AddIObject (const char *)
 Add an object to the current selection.
void RemoveIObject (const char *)
 Remove the object from the selection.
void ClearIObjects ()
 Clear selection (unselect all objects).
void Display (const char *)
 Display an object in the current view window.
void DisplayOnly (const char *)
 Displays an object in the current view window and erases all other ones.
void Erase (const char *)
 Erase an object in the current view window.
void DisplayAll ()
 Display all active module's presentable child objects in the current view window.
void EraseAll ()
 Erase all objects from the current view window.
bool IsInCurrentView (const char *)
 Check it the object is displayed in the current view window.
void UpdateView ()
 Update (repaint) current view window.
void FitAll ()
 Fit current view window to display all its contents.
void ResetView ()
 Reset current view window to the default state.
void ViewTop ()
 Switch current view window to show the top view.
void ViewBottom ()
 Switch current view window to show the bottom view.
void ViewLeft ()
 Switch current view window to show the left view.
void ViewRight ()
 Switch current view window to show the right view.
void ViewFront ()
 Switch current view window to show the front view.
void ViewBack ()
 Switch current view window to show the back view.

Detailed Description

This module provides an access to the SALOME GUI implementing set of functions which can be used from Python. This module is implemented using SWIG wrappings for some GUI functionality:

Instance of this class is created every time "import salome" line is typed

SALOME GUI (desktop and other objects) is only available in SALOME_Session_Server. It means that it can not be accessed from the external Python console.

The usage in Python:

  import libSALOME_Swig
  sg = libSALOME_Swig.SALOMEGUI_Swig()
  if sg.hasDesktop():
      selcount = sg.SelectedCount()
      if selcount > 0:
          sg.Erase( sg.getSelected( 0 ) )
      pass

Constructor & Destructor Documentation

SALOMEGUI_Swig::SALOMEGUI_Swig ( )
SALOMEGUI_Swig::~SALOMEGUI_Swig ( )

Member Function Documentation

bool SALOMEGUI_Swig::hasDesktop ( )
Returns:
true if GUI is available

References ProcessEvent().

void SALOMEGUI_Swig::updateObjBrowser ( bool  )
Parameters:
updateSelectionthis parameter is obsolete

References getApplication(), and ProcessVoidEvent().

int SALOMEGUI_Swig::getActiveStudyId ( )
Returns:
active study's ID or 0 if there is no active study

References ProcessEvent().

const char * SALOMEGUI_Swig::getActiveStudyName ( )
Returns:
active study's name or null string if there is no active study

References ProcessEvent().

const char * SALOMEGUI_Swig::getComponentName ( const char *  componentUserName)
Parameters:
componentUserNamecomponent title (user name)
Returns:
component name or null string if component title is invalid

References ProcessEvent().

const char * SALOMEGUI_Swig::getComponentUserName ( const char *  componentName)
Parameters:
componentNamecomponent name
Returns:
component title or null string if component name is invalid

References ProcessEvent().

int SALOMEGUI_Swig::SelectedCount ( )
Returns:
number of selected items in the active study

References ProcessEvent().

const char * SALOMEGUI_Swig::getSelected ( int  index)
Parameters:
indexselected object index
Returns:
selected object entry (null string if index is invalid)

References ProcessEvent().

void SALOMEGUI_Swig::AddIObject ( const char *  theEntry)
void SALOMEGUI_Swig::RemoveIObject ( const char *  theEntry)
void SALOMEGUI_Swig::ClearIObjects ( )
void SALOMEGUI_Swig::Display ( const char *  theEntry)
void SALOMEGUI_Swig::DisplayOnly ( const char *  theEntry)
void SALOMEGUI_Swig::Erase ( const char *  theEntry)
void SALOMEGUI_Swig::DisplayAll ( )
void SALOMEGUI_Swig::EraseAll ( )
bool SALOMEGUI_Swig::IsInCurrentView ( const char *  theEntry)

VSR: For the current moment implemented for OCC and VTK viewers only.

Parameters:
theEntryobject entry
Returns:
true if the object with given entry is displayed in the current viewer

References ProcessEvent().

void SALOMEGUI_Swig::UpdateView ( )
void SALOMEGUI_Swig::FitAll ( )
void SALOMEGUI_Swig::ResetView ( )
void SALOMEGUI_Swig::ViewTop ( )

References __ViewTop, and setView().

void SALOMEGUI_Swig::ViewBottom ( )

References __ViewBottom, and setView().

void SALOMEGUI_Swig::ViewLeft ( )

References __ViewLeft, and setView().

void SALOMEGUI_Swig::ViewRight ( )

References __ViewRight, and setView().

void SALOMEGUI_Swig::ViewFront ( )

References __ViewFront, and setView().

void SALOMEGUI_Swig::ViewBack ( )

References __ViewBack, and setView().

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS