Back to index

salome-gui  6.5.0
Classes | Enumerations | Functions
SALOMEGUI_Swig.cxx File Reference
#include "SALOMEGUI_Swig.hxx"
#include <SUIT_Session.h>
#include <SUIT_Desktop.h>
#include <SUIT_ViewWindow.h>
#include <SUIT_ViewManager.h>
#include <SUIT_DataObjectIterator.h>
#include <CAM_DataModel.h>
#include <LightApp_Application.h>
#include <LightApp_Displayer.h>
#include <LightApp_Study.h>
#include <LightApp_Module.h>
#include <LightApp_DataObject.h>
#include <LightApp_SelectionMgr.h>
#include <LightApp_DataOwner.h>
#include <SALOME_Prs.h>
#include <SOCC_ViewModel.h>
#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
#include <SOCC_ViewWindow.h>
#include <SPlot2d_ViewWindow.h>
#include <SALOME_Event.h>
#include <SALOME_ListIO.hxx>
#include <SALOME_InteractiveObject.hxx>
#include <SALOME_ListIteratorOfListIO.hxx>

Go to the source code of this file.

Classes

class  THasDesktopEvent
class  TGetActiveStudyIdEvent
class  TGetActiveStudyNameEvent
class  TGetComponentNameEvent
class  TGetSelectedEvent
class  TIsInViewerEvent

Enumerations

enum  {
  __ViewTop, __ViewBottom, __ViewLeft, __ViewRight,
  __ViewFront, __ViewBack
}
 View operation type. More...

Functions

static LightApp_ApplicationgetApplication ()
 Get active application object.
static LightApp_Study * getActiveStudy ()
 Get active study object.
static void setView (int view)
 Change the view of the current view window.

Enumeration Type Documentation

anonymous enum

View operation type.

Enumerator:
__ViewTop 

view top side

__ViewBottom 

view bottom side

__ViewLeft 

view left side

__ViewRight 

view right side

__ViewFront 

view front side

__ViewBack 

view back side

Definition at line 714 of file SALOMEGUI_Swig.cxx.


Function Documentation

static LightApp_Study* getActiveStudy ( ) [static]

Get active study object.

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

Definition at line 118 of file SALOMEGUI_Swig.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 active application object.

Returns:
active application or 0 if there is no any

Definition at line 106 of file SALOMEGUI_Swig.cxx.

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

Here is the caller graph for this function:

PyObject * setView ( int  type) [static]

Change the view of the current view window.

Set view type for the current VTK viewer.

Parameters:
viewview operation type

If there is no active VTK viewer, nothing happens.

Parameters:
typeview type
Returns:
nothing (Py_None)

Definition at line 728 of file SALOMEGUI_Swig.cxx.

{
  class TEvent: public SALOME_Event
  {
  private:
    int myView;
  public:
    TEvent( int view ) : myView( view ) {}
    virtual void Execute()
    {
      if ( LightApp_Application* anApp = getApplication() ) {
        SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
        if ( window ) {
          if ( dynamic_cast<SVTK_ViewWindow*>( window ) ) {
            switch( myView ) {
            case __ViewTop:
              (dynamic_cast<SVTK_ViewWindow*>( window ))->onTopView(); break;
            case __ViewBottom:
              (dynamic_cast<SVTK_ViewWindow*>( window ))->onBottomView(); break;
            case __ViewLeft:
              (dynamic_cast<SVTK_ViewWindow*>( window ))->onLeftView(); break;
            case __ViewRight:
              (dynamic_cast<SVTK_ViewWindow*>( window ))->onRightView(); break;
            case __ViewFront:
              (dynamic_cast<SVTK_ViewWindow*>( window ))->onFrontView(); break;
            case __ViewBack:
              (dynamic_cast<SVTK_ViewWindow*>( window ))->onBackView(); break;
            default:
              break;
            }
          }
          else if ( dynamic_cast<OCCViewer_ViewWindow*>( window ) ) {
            switch( myView ) {
            case __ViewTop:
              (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onTopView(); break;
            case __ViewBottom:
              (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onBottomView(); break;
            case __ViewLeft:
              (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onLeftView(); break;
            case __ViewRight:
              (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onRightView(); break;
            case __ViewFront:
              (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onFrontView(); break;
            case __ViewBack:
              (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onBackView(); break;
            default:
              break;
            }
          }
        }
      }
    }
  };
  ProcessVoidEvent( new TEvent( view ) );
}

Here is the call graph for this function:

Here is the caller graph for this function: