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... | |
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
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:
| SALOMEGUI_Swig::SALOMEGUI_Swig | ( | ) |
Constructor.
| SALOMEGUI_Swig::~SALOMEGUI_Swig | ( | ) |
Destructor.
| void SALOMEGUI_Swig::AddIObject | ( | const char * | theEntry | ) |
Add an object to the current selection.
| theEntry | object entry |
References getApplication(), ProcessVoidEvent(), and LightApp_SelectionMgr::setSelectedObjects().
| void SALOMEGUI_Swig::ClearIObjects | ( | ) |
Clear selection (unselect all objects).
References SUIT_SelectionMgr::clearSelected(), getApplication(), and ProcessVoidEvent().
| 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.
| theEntry | object entry |
References LightApp_Study::children(), LightApp_Study::componentDataType(), LightApp_Displayer::Display(), LightApp_Displayer::FindDisplayer(), getActiveStudy(), getApplication(), LightApp_Study::isComponent(), ProcessVoidEvent(), and LightApp_Study::referencedToEntry().
| 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().
| 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.
| theEntry | object 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().
| 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.
| theEntry | object entry |
References LightApp_Study::children(), LightApp_Study::componentDataType(), LightApp_Displayer::Erase(), LightApp_Displayer::FindDisplayer(), getActiveStudy(), getApplication(), LightApp_Study::isComponent(), ProcessVoidEvent(), and LightApp_Study::referencedToEntry().
| void SALOMEGUI_Swig::EraseAll | ( | ) |
Erase all objects from the current view window.
References LightApp_Study::components(), LightApp_Displayer::EraseAll(), LightApp_Displayer::FindDisplayer(), getActiveStudy(), getApplication(), and ProcessVoidEvent().
| void SALOMEGUI_Swig::FitAll | ( | ) |
Fit current view window to display all its contents.
References SUIT_ViewManager::getActiveView(), getApplication(), and ProcessVoidEvent().
| void SALOMEGUI_Swig::FitIObjects | ( | const std::list< std::string > & | entries | ) |
References SUIT_ViewManager::getActiveView(), getApplication(), and ProcessVoidEvent().
| void SALOMEGUI_Swig::FitSelection | ( | ) |
References SUIT_ViewManager::getActiveView(), getApplication(), and ProcessVoidEvent().
| const char * SALOMEGUI_Swig::getActiveStudyName | ( | ) |
Get active study name.
References ProcessEvent().
| const char * SALOMEGUI_Swig::getComponentName | ( | const char * | componentUserName | ) |
Get name of the component by its title (user name)
| componentUserName | component title (user name) |
References ProcessEvent().
| const char * SALOMEGUI_Swig::getComponentUserName | ( | const char * | componentName | ) |
Get title (user name) of the component by its name.
| componentName | component name |
References ProcessEvent().
| const char * SALOMEGUI_Swig::getSelected | ( | int | index | ) |
Get entry of the specified selected item.
| index | selected object index |
References ProcessEvent().
| const char * SALOMEGUI_Swig::getViewParameters | ( | ) |
References ProcessEvent().
| bool SALOMEGUI_Swig::hasDesktop | ( | ) |
| 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.
| theEntry | object entry |
true if the object with given entry is displayed in the current viewer References ProcessEvent().
| void SALOMEGUI_Swig::RemoveIObject | ( | const char * | theEntry | ) |
Remove the object from the selection.
| theEntry | object entry |
References getApplication(), ProcessVoidEvent(), LightApp_SelectionMgr::selectedObjects(), and LightApp_SelectionMgr::setSelectedObjects().
| void SALOMEGUI_Swig::ResetView | ( | ) |
Reset current view window to the default state.
References SUIT_ViewManager::getActiveView(), getApplication(), and ProcessVoidEvent().
| int SALOMEGUI_Swig::SelectedCount | ( | ) |
Get number of selected items.
References ProcessEvent().
| void SALOMEGUI_Swig::setCameraFocalPoint | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
Set camera focal point of the active view.
| 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().
| void SALOMEGUI_Swig::setCameraPosition | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
Set camera position of the active view .
| x | - X coordinate of the camera |
| y | - Y coordinate of the camera |
| z | - Z coordinate of the camera |
References __CameraPosition, and setViewParameter().
| void SALOMEGUI_Swig::setCameraViewUp | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
Set the view up direction for the camera.
| 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().
| void SALOMEGUI_Swig::setViewScale | ( | double | parallelScale, |
| double | x, | ||
| double | y, | ||
| double | z | ||
| ) |
Set view scale.
| parallelScale | - scaling used for a parallel projection. |
| x | - X scale |
| y | - Y scale |
| z | - Z scale |
References __ViewScale, and setViewParameter().
| void SALOMEGUI_Swig::updateObjBrowser | ( | ) |
Update active study's Object Browser.
References getApplication(), and ProcessVoidEvent().
| void SALOMEGUI_Swig::UpdateView | ( | ) |
Update (repaint) current view window.
References SUIT_ViewManager::getActiveView(), getApplication(), SUIT_ViewWindow::getViewManager(), SUIT_ViewManager::getViewModel(), ProcessVoidEvent(), and SALOME_View::Repaint().
| void SALOMEGUI_Swig::ViewBack | ( | ) |
Switch current view window to show the back view.
References __ViewBack, and setView().
| void SALOMEGUI_Swig::ViewBottom | ( | ) |
Switch current view window to show the bottom view.
References __ViewBottom, and setView().
| void SALOMEGUI_Swig::ViewFront | ( | ) |
Switch current view window to show the front view.
References __ViewFront, and setView().
| void SALOMEGUI_Swig::ViewLeft | ( | ) |
Switch current view window to show the left view.
References __ViewLeft, and setView().
| void SALOMEGUI_Swig::ViewRight | ( | ) |
Switch current view window to show the right view.
References __ViewRight, and setView().
| void SALOMEGUI_Swig::ViewTop | ( | ) |