#include <OCCViewer_ViewWindow.h>
#include <Plot2d_ViewManager.h>
#include <Plot2d_ViewWindow.h>
+#include <QxScene_ViewManager.h>
+#include <QxScene_ViewWindow.h>
/*!
\brief Get the currently active application.
return ProcessEvent( new TCreateView( type ) );
}
+/*!
+ \fn QGraphicsScene* SalomePyQt::initQxScene()
+ \brief: create a scene, a view in central widget
+ \return a scene or NULL
+*/
+
+class TinitQxScene: public SALOME_Event
+{
+public:
+ typedef QGraphicsScene* TResult;
+ TResult myResult;
+
+ TinitQxScene(): myResult(NULL) {
+ }
+
+ virtual void Execute() {
+ LightApp_Application* app = getApplication();
+ if ( app ) {
+ QxScene_ViewManager* aVM = dynamic_cast<QxScene_ViewManager*>( app->getViewManager( "QxSceneViewer", true ) );
+ if ( aVM ) {
+ QxScene_ViewWindow* view = dynamic_cast<QxScene_ViewWindow*>( aVM->getActiveView() );
+
+ QGraphicsScene* scene = new QGraphicsScene(view);
+ QGraphicsView * gView = new QGraphicsView();
+
+ view->setScene(scene);
+ view->setSceneView(gView);
+ view->setCentralWidget(gView);
+
+ gView->setScene(scene);
+ gView->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
+ gView->show();
+
+ myResult = scene;
+ }
+ }
+ }
+};
+
+QGraphicsScene* SalomePyQt::initQxScene() {
+ return ProcessEvent( new TinitQxScene() );
+}
+
+/*!
+ \fn QMainWindow* SalomePyQt::getQxMainWindow( const bool create );
+ \brief: get the active QMainWindow or created one
+ \return a QMainWindow or NULL
+*/
+
+class TgetQxMainWindow: public SALOME_Event
+{
+public:
+ typedef QMainWindow* TResult;
+ TResult myResult;
+ const bool _create;
+
+ TgetQxMainWindow(const bool create): _create(create), myResult(NULL) {
+ }
+
+ virtual void Execute() {
+ LightApp_Application* app = getApplication();
+ if ( app ) {
+ QxScene_ViewManager* aVM = dynamic_cast<QxScene_ViewManager*>( app->getViewManager( "QxSceneViewer", _create ) );
+ if ( aVM ) {
+ QxScene_ViewWindow* view = dynamic_cast<QxScene_ViewWindow*>( aVM->getActiveView() );
+ myResult = view;
+ }
+ }
+ }
+};
+
+QMainWindow* SalomePyQt::getQxMainWindow( const bool create ) {
+ return ProcessEvent( new TgetQxMainWindow(create) );
+}
+
/*!
\fn bool SalomePyQt::closeView( const int id )
\brief Close view
class QWidget;
class QAction;
class QtxActionGroup;
+class QGraphicsScene;
+class QMainWindow;
class SALOME_Selection : public QObject
{
static QAction* createAction( const int, const QString&,
const QString& = QString(), const QString& = QString(),
const QString& = QString(), const int = 0, const bool = false );
-
+
static QtxActionGroup* createActionGroup( const int, const bool = true );
static QAction* action( const int );
static void message( const QString&, bool = true );
static void clearMessages();
-
+
static QList<int> getViews();
static int getActiveView();
static QString getViewType( const int );
static bool closeView( const int );
static int cloneView( const int );
static bool isViewVisible( const int id );
-
+ static QGraphicsScene* initQxScene();
+ static QMainWindow* getQxMainWindow( const bool create );
+
static bool groupAllViews();
static bool splitView( const int, const Orientation, const Action );
static bool moveView( const int, const int, const bool );
static bool closeView( const int ) /ReleaseGIL/ ;
static int cloneView( const int ) /ReleaseGIL/ ;
static bool isViewVisible( const int id ) /ReleaseGIL/ ;
-
+ static QGraphicsScene* initQxScene() /ReleaseGIL/ ;
+ static QMainWindow* getQxMainWindow( const bool ) /ReleaseGIL/ ;
static bool groupAllViews() /ReleaseGIL/ ;
static bool splitView( const int, Orientation, Action ) /ReleaseGIL/ ;
static bool moveView( const int, const int, const bool ) /ReleaseGIL/ ;