Version: 9.15.0
SALOMEGUI_Swig Class Reference

Python interface module for SALOME GUI. More...

#include <SALOMEGUI_Swig.hxx>

Public Member Functions

 SALOMEGUI_Swig ()
 Constructor. More...
 
 ~SALOMEGUI_Swig ()
 Destructor. More...
 
bool hasDesktop ()
 Check GUI availability. More...
 
void updateObjBrowser ()
 Update active study's Object Browser. More...
 
const char * getActiveStudyName ()
 Get active study name. More...
 
const char * getComponentName (const char *)
 Get name of the component by its title (user name) More...
 
const char * getComponentUserName (const char *)
 Get title (user name) of the component by its name. More...
 
int SelectedCount ()
 Get number of selected items. More...
 
const char * getSelected (int i)
 Get entry of the specified selected item. More...
 
void AddIObject (const char *)
 Add an object to the current selection. More...
 
void RemoveIObject (const char *)
 Remove the object from the selection. More...
 
void ClearIObjects ()
 Clear selection (unselect all objects). More...
 
void Display (const char *)
 Display an object in the current view window. More...
 
void DisplayOnly (const char *)
 Displays an object in the current view window and erases all other ones. More...
 
void Erase (const char *)
 Erase an object in the current view window. More...
 
void DisplayAll ()
 Display all active module's presentable child objects in the current view window. More...
 
void EraseAll ()
 Erase all objects from the current view window. More...
 
bool IsInCurrentView (const char *)
 Check it the object is displayed in the current view window. More...
 
void UpdateView ()
 Update (repaint) current view window. More...
 
void FitAll ()
 Fit current view window to display all its contents. More...
 
void FitSelection ()
 
void FitIObjects (const std::list< std::string > &)
 
void ResetView ()
 Reset current view window to the default state. More...
 
void ViewTop ()
 Switch current view window to show the top view. More...
 
void ViewBottom ()
 Switch current view window to show the bottom view. More...
 
void ViewLeft ()
 Switch current view window to show the left view. More...
 
void ViewRight ()
 Switch current view window to show the right view. More...
 
void ViewFront ()
 Switch current view window to show the front view. More...
 
void ViewBack ()
 Switch current view window to show the back view. More...
 
const char * getViewParameters ()
 
void setCameraPosition (double x, double y, double z)
 Set camera position of the active view . More...
 
void setCameraFocalPoint (double x, double y, double z)
 Set camera focal point of the active view. More...
 
void setCameraViewUp (double x, double y, double z)
 Set the view up direction for the camera. More...
 
void setViewScale (double parallelScale, double x, double y, double z)
 Set view scale. More...
 

Detailed Description

Python interface module for SALOME GUI.

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

  • in IAPP embedded Python interpretor (SALOME_Session_Server executable)
  • in inline Python nodes in Supervisor (in SALOME_Container executable)
  • in stand-alone Python console outside any executable

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 ( )

Constructor.

◆ ~SALOMEGUI_Swig()

SALOMEGUI_Swig::~SALOMEGUI_Swig ( )

Destructor.

Member Function Documentation

◆ AddIObject()

void SALOMEGUI_Swig::AddIObject ( const char *  theEntry)

Add an object to the current selection.

Parameters
theEntryobject entry

References getApplication(), ProcessVoidEvent(), and LightApp_SelectionMgr::setSelectedObjects().

◆ ClearIObjects()

void SALOMEGUI_Swig::ClearIObjects ( )

Clear selection (unselect all objects).

References SUIT_SelectionMgr::clearSelected(), getApplication(), and ProcessVoidEvent().

◆ Display()

void SALOMEGUI_Swig::Display ( const char *  theEntry)

Display an object in the current view window.

The presentable object should be previously created and displayed in this viewer.

Parameters
theEntryobject entry

References LightApp_Study::children(), LightApp_Study::componentDataType(), LightApp_Displayer::Display(), LightApp_Displayer::FindDisplayer(), getActiveStudy(), getApplication(), LightApp_Study::isComponent(), ProcessVoidEvent(), and LightApp_Study::referencedToEntry().

◆ DisplayAll()

void SALOMEGUI_Swig::DisplayAll ( )

Display all active module's presentable child objects in the current view window.

The presentable objects should be previously created and displayed in this viewer.

References LightApp_Study::centry(), LightApp_Study::children(), LightApp_Study::components(), LightApp_Displayer::Display(), LightApp_Displayer::FindDisplayer(), getActiveStudy(), getApplication(), ProcessVoidEvent(), and LightApp_Study::referencedToEntry().

◆ DisplayOnly()

void SALOMEGUI_Swig::DisplayOnly ( const char *  theEntry)

Displays an object in the current view window and erases all other ones.

The presentable object should be previously created and displayed in this viewer.

Parameters
theEntryobject entry

References LightApp_Study::children(), LightApp_Study::componentDataType(), LightApp_Study::components(), LightApp_Displayer::Display(), LightApp_Displayer::EraseAll(), LightApp_Displayer::FindDisplayer(), getActiveStudy(), getApplication(), LightApp_Study::isComponent(), ProcessVoidEvent(), and LightApp_Study::referencedToEntry().

◆ Erase()

void SALOMEGUI_Swig::Erase ( const char *  theEntry)

Erase an object in the current view window.

The presentable object should be previously created and displayed in this viewer.

Parameters
theEntryobject entry

References LightApp_Study::children(), LightApp_Study::componentDataType(), LightApp_Displayer::Erase(), LightApp_Displayer::FindDisplayer(), getActiveStudy(), getApplication(), LightApp_Study::isComponent(), ProcessVoidEvent(), and LightApp_Study::referencedToEntry().

◆ EraseAll()

void SALOMEGUI_Swig::EraseAll ( )

◆ FitAll()

void SALOMEGUI_Swig::FitAll ( )

Fit current view window to display all its contents.

References SUIT_ViewManager::getActiveView(), getApplication(), and ProcessVoidEvent().

◆ FitIObjects()

void SALOMEGUI_Swig::FitIObjects ( const std::list< std::string > &  entries)

◆ FitSelection()

void SALOMEGUI_Swig::FitSelection ( )

◆ getActiveStudyName()

const char * SALOMEGUI_Swig::getActiveStudyName ( )

Get active study name.

Returns
active study's name or null string if there is no active study

References ProcessEvent().

◆ getComponentName()

const char * SALOMEGUI_Swig::getComponentName ( const char *  componentUserName)

Get name of the component by its title (user name)

Parameters
componentUserNamecomponent title (user name)
Returns
component name or null string if component title is invalid

References ProcessEvent().

◆ getComponentUserName()

const char * SALOMEGUI_Swig::getComponentUserName ( const char *  componentName)

Get title (user name) of the component by its name.

Parameters
componentNamecomponent name
Returns
component title or null string if component name is invalid

References ProcessEvent().

◆ getSelected()

const char * SALOMEGUI_Swig::getSelected ( int  index)

Get entry of the specified selected item.

Parameters
indexselected object index
Returns
selected object entry (null string if index is invalid)

References ProcessEvent().

◆ getViewParameters()

const char * SALOMEGUI_Swig::getViewParameters ( )

References ProcessEvent().

◆ hasDesktop()

bool SALOMEGUI_Swig::hasDesktop ( )

Check GUI availability.

Returns
true if GUI is available

References ProcessEvent().

◆ IsInCurrentView()

bool SALOMEGUI_Swig::IsInCurrentView ( const char *  theEntry)

Check it the object is displayed in the current view window.

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().

◆ RemoveIObject()

void SALOMEGUI_Swig::RemoveIObject ( const char *  theEntry)

Remove the object from the selection.

Parameters
theEntryobject entry

References getApplication(), ProcessVoidEvent(), LightApp_SelectionMgr::selectedObjects(), and LightApp_SelectionMgr::setSelectedObjects().

◆ ResetView()

void SALOMEGUI_Swig::ResetView ( )

Reset current view window to the default state.

References SUIT_ViewManager::getActiveView(), getApplication(), and ProcessVoidEvent().

◆ SelectedCount()

int SALOMEGUI_Swig::SelectedCount ( )

Get number of selected items.

Returns
number of selected items in the active study

References ProcessEvent().

◆ setCameraFocalPoint()

void SALOMEGUI_Swig::setCameraFocalPoint ( double  x,
double  y,
double  z 
)

Set camera focal point of the active view.

Parameters
x- X coordinate of the focal point
y- Y coordinate of the focal point
z- Z coordinate of the focal point

References __CameraFocalPoint, and setViewParameter().

◆ setCameraPosition()

void SALOMEGUI_Swig::setCameraPosition ( double  x,
double  y,
double  z 
)

Set camera position of the active view .

Parameters
x- X coordinate of the camera
y- Y coordinate of the camera
z- Z coordinate of the camera

References __CameraPosition, and setViewParameter().

◆ setCameraViewUp()

void SALOMEGUI_Swig::setCameraViewUp ( double  x,
double  y,
double  z 
)

Set the view up direction for the camera.

Parameters
x- X component of the direction vector
y- Y component of the direction vector
z- Z component of the direction vector

References __CameraViewUp, and setViewParameter().

◆ setViewScale()

void SALOMEGUI_Swig::setViewScale ( double  parallelScale,
double  x,
double  y,
double  z 
)

Set view scale.

Parameters
parallelScale- scaling used for a parallel projection.
x- X scale
y- Y scale
z- Z scale

References __ViewScale, and setViewParameter().

◆ updateObjBrowser()

void SALOMEGUI_Swig::updateObjBrowser ( )

Update active study's Object Browser.

References getApplication(), and ProcessVoidEvent().

◆ UpdateView()

◆ ViewBack()

void SALOMEGUI_Swig::ViewBack ( )

Switch current view window to show the back view.

References __ViewBack, and setView().

◆ ViewBottom()

void SALOMEGUI_Swig::ViewBottom ( )

Switch current view window to show the bottom view.

References __ViewBottom, and setView().

◆ ViewFront()

void SALOMEGUI_Swig::ViewFront ( )

Switch current view window to show the front view.

References __ViewFront, and setView().

◆ ViewLeft()

void SALOMEGUI_Swig::ViewLeft ( )

Switch current view window to show the left view.

References __ViewLeft, and setView().

◆ ViewRight()

void SALOMEGUI_Swig::ViewRight ( )

Switch current view window to show the right view.

References __ViewRight, and setView().

◆ ViewTop()

void SALOMEGUI_Swig::ViewTop ( )

Switch current view window to show the top view.

References __ViewTop, and setView().


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