Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (bool)
 Update active study's Object Browser. More...
 
int getActiveStudyId ()
 Get active study identifier. 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 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

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::~SALOMEGUI_Swig ( )

Member Function Documentation

void SALOMEGUI_Swig::AddIObject ( const char *  theEntry)
void SALOMEGUI_Swig::ClearIObjects ( )
void SALOMEGUI_Swig::Display ( const char *  theEntry)
void SALOMEGUI_Swig::Erase ( const char *  theEntry)
void SALOMEGUI_Swig::FitAll ( )
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().

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

References ProcessEvent().

const char * SALOMEGUI_Swig::getViewParameters ( )

References ProcessEvent().

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

References ProcessEvent().

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::RemoveIObject ( const char *  theEntry)
void SALOMEGUI_Swig::ResetView ( )
int SALOMEGUI_Swig::SelectedCount ( )
Returns
number of selected items in the active study

References ProcessEvent().

void SALOMEGUI_Swig::setCameraFocalPoint ( double  x,
double  y,
double  z 
)
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().

void SALOMEGUI_Swig::setCameraPosition ( double  x,
double  y,
double  z 
)
Parameters
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 
)
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().

void SALOMEGUI_Swig::setViewScale ( double  parallelScale,
double  x,
double  y,
double  z 
)
Parameters
parallelScale- scaling used for a parallel projection.
x- X scale
y- Y scale
z- Z scale

References __ViewScale, and setViewParameter().

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

References getApplication(), and ProcessVoidEvent().

void SALOMEGUI_Swig::ViewBack ( )

References __ViewBack, and setView().

void SALOMEGUI_Swig::ViewBottom ( )

References __ViewBottom, and setView().

void SALOMEGUI_Swig::ViewFront ( )

References __ViewFront, and setView().

void SALOMEGUI_Swig::ViewLeft ( )

References __ViewLeft, and setView().

void SALOMEGUI_Swig::ViewRight ( )

References __ViewRight, and setView().

void SALOMEGUI_Swig::ViewTop ( )

References __ViewTop, and setView().


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