TEST_LIB_DIRS="${TEST_LIB_DIRS} ${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
TEST_LIB_DIRS="${TEST_LIB_DIRS} ${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/PyQt4"
TEST_SIPS_DIRS="${TEST_SIPS_DIRS} ${SIPDIR} ${SIPDIR}/sip"
- TEST_SIPS_DIRS="${TEST_SIPS_DIRS} ${SIPDIR}/share ${SIPDIR}/share/sip"
+ TEST_SIPS_DIRS="${TEST_SIPS_DIRS} ${SIPDIR}/share ${SIPDIR}/share/sip ${SIPDIR}/share/sip/PyQt4"
fi
if test "x${PYTHONHOME}" != "x" ; then
TEST_LIB_DIRS="${TEST_LIB_DIRS} ${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
./src/SPlot2d/Makefile \
./src/SUPERVGraph/Makefile \
./src/QxGraph/Makefile \
+ ./src/QxScene/Makefile \
./src/LightApp/Makefile \
./src/ResExporter/Makefile \
./src/TOOLSGUI/Makefile \
#endif
#endif
+#include <QxScene_ViewManager.h>
+#include <QxScene_ViewModel.h>
+#include <QxScene_ViewWindow.h>
+
#ifndef DISABLE_OCCVIEWER
#include <OCCViewer_ViewManager.h>
#ifndef DISABLE_SALOMEOBJECT
createActionForViewer( NewQxGraphViewId, newWinMenu, QString::number( 4 ), Qt::ALT+Qt::Key_C );
#endif
+ createActionForViewer( NewQxSceneViewId, newWinMenu, QString::number( 5 ), Qt::ALT+Qt::Key_S );
+
createAction( RenameId, tr( "TOT_RENAME" ), QIcon(), tr( "MEN_DESK_RENAME" ), tr( "PRP_RENAME" ),
Qt::SHIFT+Qt::Key_R, desk, false, this, SLOT( onRenameWindow() ) );
createMenu( RenameId, windowMenu, -1 );
type = QxGraph_Viewer::Type();
break;
#endif
+ case NewQxSceneViewId:
+ type = QxScene_Viewer::Type();
+ break;
}
if ( !type.isEmpty() )
if( a )
a->setEnabled( activeStudy() );
#endif
+ a = action( NewQxSceneViewId );
+ if( a )
+ a->setEnabled( activeStudy() );
}
/*!
}
}
#endif
+ if( vmType == QxScene_Viewer::Type() )
+ {
+ viewMgr = new QxScene_ViewManager( activeStudy(), desktop() );
+ QxScene_Viewer* vm = new QxScene_Viewer();
+ viewMgr->setViewModel( vm );
+ QxScene_ViewWindow* wnd = dynamic_cast<QxScene_ViewWindow*>( viewMgr->getActiveView() );
+ }
//#ifndef DISABLE_SUPERVGRAPHVIEWER
// if( vmType == SUPERVGraph_Viewer::Type() )
// {
CloseId, CloseAllId, GroupAllId,
PreferencesId, MRUId, ModulesListId,
NewGLViewId, NewPlot2dId, NewOCCViewId, NewVTKViewId, NewQxGraphViewId,
- StyleId,
+ NewQxSceneViewId, StyleId,
UserID };
protected:
else
libLightApp_la_CPPFLAGS += -DDISABLE_PLOT2DVIEWER
endif
+libLightApp_la_CPPFLAGS+= -I$(srcdir)/../QxScene
+
if ENABLE_OCCVIEWER
libLightApp_la_CPPFLAGS += -I$(srcdir)/../OCCViewer
else !ENABLE_OCCVIEWER
if ENABLE_QXGRAPHVIEWER
libLightApp_la_LIBADD += ../QxGraph/libQxGraph.la
endif
+ libLightApp_la_LIBADD+= ../QxScene/libQxScene.la
<parameter name="GLViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="OCCViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="VTKViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="QxSceneViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="PyConsole" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="SalomeApp" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="OB" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="Background" value="144, 208, 211" />
<parameter name="Title" value="63, 213, 255" />
</section>
+ <section name="QxSceneViewer" >
+ <!-- QxGraph viewer preferences -->
+ <parameter name="Background" value="144, 208, 211" />
+ <parameter name="Title" value="63, 213, 255" />
+ <parameter name="NodeBody" value="255, 249, 147" />
+ </section>
</document>
msgid "LightApp_Application::NEW_WINDOW_4"
msgstr "&QxGraph view"
+msgid "LightApp_Application::NEW_WINDOW_5"
+msgstr "Qx&Scene view"
+
msgid "LightApp_Application::INF_CANCELLED"
msgstr "Module activation cancelled"
<source>NEW_WINDOW_4</source>
<translation>&QxGraph view</translation>
</message>
+ <message>
+ <source>NEW_WINDOW_5</source>
+ <translation>Qx&Scene view</translation>
+ </message>
<message>
<source>OBJ_BROWSER_NAME</source>
<translation>Object</translation>
if ENABLE_QXGRAPHVIEWER
SUBDIRS += QxGraph
endif
-SUBDIRS += LightApp ResExporter
+SUBDIRS += QxScene LightApp ResExporter
if GUI_ENABLE_CORBA
SUBDIRS += TOOLSGUI Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT
--- /dev/null
+#ifndef __DEBTRACE_HXX__
+#define __DEBTRACE_HXX__
+
+#include <iostream>
+
+#ifdef _DEVDEBUG_
+#define DEBTRACE(msg) {std::cerr<<std::flush<<__FILE__<<" ["<<__LINE__<<"] : "<<msg<<std::endl<<std::flush;}
+#else
+#define DEBTRACE(msg)
+#endif
+
+#endif
--- /dev/null
+# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+lib_LTLIBRARIES = libQxScene.la
+
+salomeinclude_HEADERS= \
+ QxScene_ViewWindow.h \
+ QxScene_ViewManager.h \
+ QxScene_ViewModel.h \
+ QxScene_Def.h \
+ QxScene.h
+
+dist_libQxScene_la_SOURCES= \
+ QxScene_ViewWindow.cxx \
+ QxScene_ViewManager.cxx \
+ QxScene_ViewModel.cxx
+
+MOC_FILES= \
+ QxScene_ViewWindow_moc.cxx \
+ QxScene_ViewManager_moc.cxx \
+ QxScene_ViewModel_moc.cxx
+
+nodist_libQxScene_la_SOURCES= $(MOC_FILES)
+
+dist_salomeres_DATA= \
+ resources/qx_view_fitall.png \
+ resources/qx_view_fitarea.png \
+ resources/qx_view_glpan.png \
+ resources/qx_view_pan.png \
+ resources/qx_view_reset.png \
+ resources/qx_view_zoom.png
+
+# --- warnings:
+# QxSceneViewer prefix must be coherent with type defined in QxScene_ViewModel.h
+# (for translator loading)
+# coherence also needed in LightApp.xml and SalomeApp.xml
+
+nodist_salomeres_DATA= \
+ QxSceneViewer_images.qm \
+ QxSceneViewer_msg_en.qm
+
+libQxScene_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) \
+ -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
+libQxScene_la_LDFLAGS=$(QT_MT_LIBS) ../SUIT/libsuit.la
--- /dev/null
+// SALOME QxScene : build Supervisor viewer into desktop
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifdef WNT
+#ifdef QXSCENE_EXPORTS
+#define QXSCENE_EXPORT __declspec(dllexport)
+#else
+#define QXSCENE_EXPORT __declspec(dllimport)
+#endif
+#else
+#define QXSCENE_EXPORT
+#endif
+
+#ifdef WNT
+#pragma warning ( disable:4251 )
+#endif
--- /dev/null
+// SALOME QxScene : build Supervisor viewer into desktop
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef QXSCENE_DEF_H
+#define QXSCENE_DEF_H
+
+#define DEF_BACK_COLOR QColor(144, 208, 211)
+#define RECTANGLE_BODY QColor(255,249,147)
+
+#define GRAPH_WIDTH 1250
+#define GRAPH_HEIGHT 950
+
+#define GRAPH_MARGIN 50
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "QxScene_ViewManager.h"
+
+#define _DEVDEBUG_
+#include "DebTrace.hxx"
+
+/*!
+ Constructor
+*/
+QxScene_ViewManager::QxScene_ViewManager( SUIT_Study* theStudy,
+ SUIT_Desktop* theDesktop,
+ SUIT_ViewModel* theViewModel )
+ : SUIT_ViewManager( theStudy, theDesktop, theViewModel )
+{
+ DEBTRACE("QxScene_ViewManager::QxScene_ViewManager");
+ setTitle( tr( "QXSCENE_VIEW_TITLE" ) );
+}
+
+/*!
+ Destructor
+*/
+QxScene_ViewManager::~QxScene_ViewManager()
+{
+ DEBTRACE("QxScene_ViewManager::~QxScene_ViewManager");
+}
+
+
+/*!
+ Adds new view
+ \param theView - view to be added
+*/
+bool QxScene_ViewManager::insertView( SUIT_ViewWindow* theView )
+{
+ DEBTRACE("QxScene_ViewManager::insertView");
+ bool res = SUIT_ViewManager::insertView( theView );
+ return res;
+}
+
+/*!
+ Creates new view
+*/
+void QxScene_ViewManager::createView()
+{
+ DEBTRACE("QxScene_ViewManager::createView");
+ createViewWindow();
+}
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef QXSCENE_VIEWMANAGER_H
+#define QXSCENE_VIEWMANAGER_H
+
+#include "QxScene.h"
+
+#include "QxScene_ViewModel.h"
+#include "SUIT_ViewManager.h"
+
+class SUIT_Desktop;
+
+class QXSCENE_EXPORT QxScene_ViewManager : public SUIT_ViewManager
+{
+ Q_OBJECT
+
+public:
+ QxScene_ViewManager( SUIT_Study* theStudy, SUIT_Desktop* theDesktop, SUIT_ViewModel* theViewModel = 0 );
+ ~QxScene_ViewManager();
+
+protected:
+ bool insertView(SUIT_ViewWindow* theView);
+
+public slots:
+ void createView();
+
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include "QxScene_ViewModel.h"
+#include "QxScene_ViewWindow.h"
+#include "QxScene_ViewManager.h"
+#include "QxScene_Def.h"
+
+#include "SUIT_Desktop.h"
+#include "SUIT_ViewWindow.h"
+#include "SUIT_Session.h"
+
+#include <qcolordialog.h>
+#include <QMenu>
+#include <QToolBar>
+
+#define _DEVDEBUG_
+#include "DebTrace.hxx"
+
+/*!
+ Constructor
+*/
+QxScene_Viewer::QxScene_Viewer()
+ :SUIT_ViewModel()
+{
+ DEBTRACE("QxScene_Viewer::QxScene_Viewer");
+}
+
+/*!
+ Destructor
+*/
+QxScene_Viewer::~QxScene_Viewer()
+{
+ DEBTRACE("QxScene_Viewer::~QxScene_Viewer");
+}
+
+void QxScene_Viewer::setViewManager( SUIT_ViewManager* mgr)
+{
+ DEBTRACE("QxScene_Viewer::setViewManager");
+ SUIT_ViewModel::setViewManager( mgr );
+}
+
+/*!
+ Start initialization of view window
+ \param view - view window to be initialized
+*/
+void QxScene_Viewer::initView( QxScene_ViewWindow* view )
+{
+ DEBTRACE("QxScene_Viewer::initView");
+ if ( view )
+ {
+ view->initLayout();
+
+ /*
+ // test add items into the current canvas view
+ */
+ }
+}
+
+/*!
+ Creates new view window
+ \param theDesktop - main window of application
+*/
+SUIT_ViewWindow* QxScene_Viewer::createView(SUIT_Desktop* theDesktop)
+{
+ DEBTRACE("QxScene_Viewer::createView");
+ QxScene_ViewWindow* aRes = new QxScene_ViewWindow( theDesktop, this );
+ initView( aRes );
+ return aRes;
+}
+
+/*!
+ Builds popup for QxScene viewer
+*/
+void QxScene_Viewer::contextMenuPopup(QMenu* thePopup)
+{
+ DEBTRACE("QxScene_Viewer::contextMenuPopup");
+}
+
+/*!
+ SLOT: called if background color is to be changed changed, passes new color to current canvas view
+*/
+void QxScene_Viewer::onChangeBgColor()
+{
+ QxScene_ViewWindow* aView = (QxScene_ViewWindow*)(myViewManager->getActiveView());
+ if( !aView )
+ return;
+ QColor aColorActive = aView->backgroundColor();
+
+ QColor selColor = QColorDialog::getColor( aColorActive, aView);
+ if ( selColor.isValid() )
+ aView->setBackgroundColor(selColor);
+}
+
+/*!
+ SLOT: called when popup item "Show toolbar" is activated, shows toolbar of active view window
+*/
+void QxScene_Viewer::onShowToolbar() {
+ QxScene_ViewWindow* aView = (QxScene_ViewWindow*)(myViewManager->getActiveView());
+ if ( aView )
+ aView->getToolBar()->show();
+}
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef QXSCENE_VIEWMODEL_H
+#define QXSCENE_VIEWMODEL_H
+
+#include "QxScene.h"
+
+#include "SUIT_ViewModel.h"
+
+class QxScene_ViewWindow;
+
+class QXSCENE_EXPORT QxScene_Viewer: public SUIT_ViewModel
+{
+ Q_OBJECT
+
+ public:
+ static QString Type() { return "QxSceneViewer"; }
+
+ QxScene_Viewer();
+ virtual ~QxScene_Viewer();
+
+ virtual void setViewManager( SUIT_ViewManager* );
+ virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
+ virtual QString getType() const { return Type(); }
+
+ virtual void contextMenuPopup(QMenu*);
+
+ protected:
+ void initView(QxScene_ViewWindow* view);
+
+ protected slots:
+ void onShowToolbar();
+ void onChangeBgColor();
+
+ private:
+};
+
+#endif
--- /dev/null
+// SALOME QxScene : build Supervisor viewer into desktop
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "QxScene_ViewWindow.h"
+#include "QxScene_Def.h"
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_Desktop.h>
+
+#include <QtxAction.h>
+#include <QtxMultiAction.h>
+#include <QtxActionToolMgr.h>
+
+//QT Include
+#include <QToolBar>
+#include <QGraphicsRectItem>
+
+#define _DEVDEBUG_
+#include "DebTrace.hxx"
+
+using namespace std;
+
+/*!
+ Constructor
+*/
+QxScene_ViewWindow::QxScene_ViewWindow( SUIT_Desktop* theDesktop, QxScene_Viewer* theModel)
+ : SUIT_ViewWindow( theDesktop )
+{
+ DEBTRACE("Construct QxScene_ViewWindow");
+ myViewModel = theModel;
+ _scene = 0;
+ _sceneView = 0;
+}
+
+/*!
+ Initialization
+*/
+void QxScene_ViewWindow::initLayout()
+{
+ DEBTRACE("QxScene_ViewWindow::initLayout");
+ createActions();
+ createToolBar();
+
+ // --- QGraphics test
+
+// _scene = new QGraphicsScene();
+// _sceneView = new QGraphicsView(this);
+// setCentralWidget(_sceneView);
+// _sceneView->setScene(_scene);
+// QGraphicsRectItem *rect = _scene->addRect(QRectF(0, 0, 100, 100));
+// _sceneView->show();
+}
+
+/*!
+ Creates actions of QxScene view window
+*/
+void QxScene_ViewWindow::createActions()
+{
+ DEBTRACE("QxScene_ViewWindow::createActions");
+ QtxActionToolMgr* mgr = toolMgr();
+ QtxAction* aAction;
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+
+ // 2. Scaling operations
+
+ // 2.1. Fit All
+ aAction = new QtxAction( tr( "MNU_FITALL" ),
+ aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_FITALL" ) ),
+ tr( "MNU_FITALL" ),
+ 0, this);
+ aAction->setStatusTip( tr( "DSC_FITALL" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewFitAll() ) );
+ mgr->registerAction( aAction, FitAllId );
+
+ // 2.2. Fit Rect
+ aAction = new QtxAction( tr( "MNU_FITRECT" ),
+ aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_FITAREA" ) ),
+ tr( "MNU_FITRECT" ),
+ 0, this);
+ aAction->setStatusTip( tr( "DSC_FITRECT" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewFitArea() ) );
+ mgr->registerAction( aAction, FitRectId );
+
+ // 2.3. Zoom
+ aAction = new QtxAction( tr( "MNU_ZOOM_VIEW" ),
+ aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_ZOOM" ) ),
+ tr( "MNU_ZOOM_VIEW" ),
+ 0, this);
+ aAction->setStatusTip( tr( "DSC_ZOOM_VIEW" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewZoom() ) );
+ mgr->registerAction( aAction, ZoomId );
+
+ // 2.4. Create multi-action for scaling operations
+ QtxMultiAction* aScaleAction = new QtxMultiAction( this );
+ aScaleAction->insertAction( mgr->action( FitAllId ) );
+ aScaleAction->insertAction( mgr->action( FitRectId ) );
+ aScaleAction->insertAction( mgr->action( ZoomId ) );
+ mgr->registerAction( aScaleAction, ScaleOpId );
+
+ // 3. Moving operations
+
+ // 3.1. Panning
+ aAction = new QtxAction( tr( "MNU_PAN_VIEW" ),
+ aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_PAN" ) ),
+ tr( "MNU_PAN_VIEW" ),
+ 0, this);
+ aAction->setStatusTip( tr( "DSC_PAN_VIEW" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewPan() ) );
+ mgr->registerAction( aAction, PanId );
+
+ // 3.2. Global Panning
+ aAction = new QtxAction( tr( "MNU_GLOBALPAN_VIEW" ),
+ aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_GLOBALPAN" ) ),
+ tr( "MNU_GLOBALPAN_VIEW" ),
+ 0, this);
+ aAction->setStatusTip( tr( "DSC_GLOBALPAN_VIEW" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewGlobalPan() ) );
+ mgr->registerAction( aAction, GlobalPanId );
+
+ // 3.3. Create multi-action for moving operations
+ QtxMultiAction* aPanAction = new QtxMultiAction( this );
+ aPanAction->insertAction( mgr->action( PanId ) );
+ aPanAction->insertAction( mgr->action( GlobalPanId ) );
+ mgr->registerAction( aPanAction, MoveOpId );
+
+ // reset
+ aAction = new QtxAction( tr( "MNU_RESET_VIEW" ),
+ aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_RESET" ) ),
+ tr( "MNU_RESET_VIEW" ),
+ 0, this);
+ aAction->setStatusTip( tr( "DSC_RESET_VIEW" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewReset() ) );
+ mgr->registerAction( aAction, ResetId );
+}
+
+/*!
+ Creates toolbar of QxScene view window
+*/
+void QxScene_ViewWindow::createToolBar()
+{
+ DEBTRACE("QxScene_ViewWindow::createToolBar");
+ QtxActionToolMgr* mgr = toolMgr();
+ myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+ mgr->append( ScaleOpId, myToolBar );
+ mgr->append( MoveOpId, myToolBar );
+ mgr->append( ResetId, myToolBar );
+}
+
+/*!
+ \brief Get view window's toolbar.
+ \return toolbar
+*/
+QToolBar* QxScene_ViewWindow::getToolBar()
+{
+ DEBTRACE("QxScene_ViewWindow::getToolBar");
+ return toolMgr()->toolBar( myToolBar );
+}
+
+/*!
+ Destructor
+*/
+QxScene_ViewWindow::~QxScene_ViewWindow()
+{
+ DEBTRACE("destructor QxScene_ViewWindow");
+
+}
+
+/*!
+ Reset the active view
+*/
+void QxScene_ViewWindow::onViewReset()
+{
+ DEBTRACE( "QxScene_ViewWindow::onViewReset" );
+}
+
+/*!
+ Sets a new center of the active view
+*/
+void QxScene_ViewWindow::onViewGlobalPan()
+{
+ DEBTRACE( "QxScene_ViewWindow::onViewGlobalPan" );
+}
+
+/*!
+ Zooms the active view
+*/
+void QxScene_ViewWindow::onViewZoom()
+{
+ DEBTRACE( "QxScene_ViewWindow::onViewZoom" );
+}
+
+/*!
+ Moves the active view
+*/
+void QxScene_ViewWindow::onViewPan()
+{
+ DEBTRACE( "QxScene_ViewWindow::onViewPan" );
+}
+
+/*!
+ Fits all obejcts within a rectangular area of the active view
+*/
+void QxScene_ViewWindow::onViewFitArea()
+{
+ DEBTRACE( "QxScene_ViewWindow::onViewFitArea" );
+}
+
+/*!
+ Fits all objects in the active view
+*/
+void QxScene_ViewWindow::onViewFitAll()
+{
+ DEBTRACE( "QxScene_ViewWindow::onViewFitAll" );
+}
+
+/*!
+ Set background of the viewport
+*/
+void QxScene_ViewWindow::setBackgroundColor( const QColor& color )
+{
+ DEBTRACE("QxScene_ViewWindow::setBackgroundColor");
+}
+
+/*!
+ Returns background of the viewport
+*/
+QColor QxScene_ViewWindow::backgroundColor() const
+{
+ DEBTRACE("QxScene_ViewWindow::backgroundColor");
+}
+
+/*!
+ Custom resize event handler
+*/
+void QxScene_ViewWindow::resizeEvent( QResizeEvent* theEvent )
+{
+ DEBTRACE("QxScene_ViewWindow::resizeEvent");
+}
+
+/*!
+ Get resource manager
+*/
+SUIT_ResourceMgr* QxScene_ViewWindow::resMgr() const
+{
+ DEBTRACE("QxScene_ViewWindow::resMgr");
+ return SUIT_Session::session()->resourceMgr();
+}
+
--- /dev/null
+// SALOME QxScene : build Supervisor viewer into desktop
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef QXSCENE_VIEWWINDOW_H
+#define QXSCENE_VIEWWINDOW_H
+
+#include "QxScene.h"
+#include "QxScene_ViewModel.h"
+
+#include "SUIT_ViewWindow.h"
+
+#include "QtxAction.h"
+
+#include <qaction.h>
+
+#include <QGraphicsScene>
+#include <QGraphicsView>
+
+#ifdef WIN32
+#pragma warning ( disable:4251 )
+#endif
+
+class SUIT_ResourceMgr;
+
+class QXSCENE_EXPORT QxScene_ViewWindow : public SUIT_ViewWindow {
+ Q_OBJECT
+
+ public:
+ //! Actions ID
+ enum { FitAllId, FitRectId, ZoomId, ScaleOpId, PanId, GlobalPanId, MoveOpId, ResetId };
+
+ QxScene_ViewWindow(SUIT_Desktop* theDesktop, QxScene_Viewer* theModel);
+ virtual ~QxScene_ViewWindow();
+
+ void setBackgroundColor( const QColor& );
+ QColor backgroundColor() const;
+
+ QToolBar* getToolBar();
+
+ SUIT_ResourceMgr* resMgr() const;
+
+ QxScene_Viewer* getViewModel() const { return myViewModel; }
+ void setViewModel(QxScene_Viewer* theViewModel) { myViewModel = theViewModel; }
+
+ virtual void initLayout();
+
+ void contextPopupEvent(QContextMenuEvent* theEvent) { emit contextMenuRequested( theEvent); }
+
+ void setScene(QGraphicsScene* scene) { _scene = scene; }
+ QGraphicsScene* getScene() { return _scene; }
+ void setSceneView(QGraphicsView* sceneView){ _sceneView = sceneView; }
+ QGraphicsView* getSceneView() { return _sceneView; }
+
+ public slots:
+ void onViewFitAll();
+ void onViewFitArea();
+ void onViewZoom();
+ void onViewPan();
+ void onViewGlobalPan();
+ void onViewReset();
+
+ protected:
+ void resizeEvent( QResizeEvent* theEvent );
+
+ QGraphicsScene* _scene;
+ QGraphicsView* _sceneView;
+
+ private:
+ void createActions();
+ void createToolBar();
+
+ int myToolBar;
+
+ QxScene_Viewer* myViewModel;
+};
+
+#ifdef WIN32
+#pragma warning ( default:4251 )
+#endif
+
+#endif
--- /dev/null
+<!DOCTYPE TS><TS>
+<context>
+ <name>@default</name>
+ <message>
+ <source>ICON_QXSCENE_RESET</source>
+ <translation>qx_view_reset.png</translation>
+ </message>
+ <message>
+ <source>ICON_QXSCENE_ZOOM</source>
+ <translation>qx_view_zoom.png</translation>
+ </message>
+ <message>
+ <source>ICON_QXSCENE_GLOBALPAN</source>
+ <translation>qx_view_glpan.png</translation>
+ </message>
+ <message>
+ <source>ICON_QXSCENE_PAN</source>
+ <translation>qx_view_pan.png</translation>
+ </message>
+ <message>
+ <source>ICON_QXSCENE_FITALL</source>
+ <translation>qx_view_fitall.png</translation>
+ </message>
+ <message>
+ <source>ICON_QXSCENE_FITAREA</source>
+ <translation>qx_view_fitarea.png</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<!DOCTYPE TS><TS>
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_CHANGE_BACKGROUND</source>
+ <translation>Change background...</translation>
+ </message>
+ <message>
+ <source>MNU_PAN_VIEW</source>
+ <translation>Panning</translation>
+ </message>
+ <message>
+ <source>DSC_PAN_VIEW</source>
+ <translation>Panning the view</translation>
+ </message>
+ <message>
+ <source>MNU_RESET_VIEW</source>
+ <translation>Reset</translation>
+ </message>
+ <message>
+ <source>DSC_RESET_VIEW</source>
+ <translation>Reset View Point</translation>
+ </message>
+ <message>
+ <source>LBL_TOOLBAR_LABEL</source>
+ <translation>View Operations</translation>
+ </message>
+</context>
+<context>
+ <name>QxScene_ViewManager</name>
+ <message>
+ <source>QXSCENE_VIEW_TITLE</source>
+ <translation>QGraphics scene:%M - viewer:%V</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File: QxScene_images.po
+// Created: 03/02/2007
+// Author: Margarita Karpunina
+// Copyright (C) CEA 2007
+
+
+msgid "ICON_QXSCENE_FITALL"
+msgstr "qx_view_fitall.png"
+
+msgid "ICON_QXSCENE_FITAREA"
+msgstr "qx_view_fitarea.png"
+
+msgid "ICON_QXSCENE_ZOOM"
+msgstr "qx_view_zoom.png"
+
+msgid "ICON_QXSCENE_PAN"
+msgstr "qx_view_pan.png"
+
+msgid "ICON_QXSCENE_GLOBALPAN"
+msgstr "qx_view_glpan.png"
+
+msgid "ICON_QXSCENE_RESET"
+msgstr "qx_view_reset.png"
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File: QxScene_msg_en.po
+// Created: 03/02/2007
+// Author: Margarita Karpunina
+// Copyright (C) CEA 2007
+
+msgid "LBL_TOOLBAR_LABEL"
+msgstr "View Operations"
+
+msgid "DSC_RESET_VIEW"
+msgstr "Reset View Point"
+
+msgid "MNU_RESET_VIEW"
+msgstr "Reset"
+
+msgid "DSC_PAN_VIEW"
+msgstr "Panning the view"
+
+msgid "MNU_PAN_VIEW"
+msgstr "Panning"
+
+msgid "MEN_CHANGE_BACKGROUND"
+msgstr "Change background..."
<parameter name="GLViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="OCCViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="VTKViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="QxSceneViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="SVTK" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="PyConsole" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="LightApp" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="Title" value="63, 213, 255" />
<parameter name="NodeBody" value="255, 249, 147" />
</section>
+ <section name="QxSceneViewer" >
+ <!-- QxGraph viewer preferences -->
+ <parameter name="Background" value="144, 208, 211" />
+ <parameter name="Title" value="63, 213, 255" />
+ <parameter name="NodeBody" value="255, 249, 147" />
+ </section>
<section name="FileDlg" >
<!-- "Open/Save File" dialog box preferences-->
<parameter name="QuickDirList" value="${DATA_DIR}" />