1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SALOME QxScene : build Supervisor viewer into desktop
24 #ifndef QXSCENE_VIEWWINDOW_H
25 #define QXSCENE_VIEWWINDOW_H
28 #include "QxScene_ViewModel.h"
30 #include "SUIT_ViewWindow.h"
32 #include "QtxAction.h"
36 #include <QGraphicsScene>
37 #include <QGraphicsView>
40 #pragma warning ( disable:4251 )
43 class SUIT_ResourceMgr;
45 class QXSCENE_EXPORT QxScene_ViewWindow : public SUIT_ViewWindow {
50 enum { FitAllId, FitRectId, ZoomId, ScaleOpId, PanId, GlobalPanId, MoveOpId, ResetId };
52 QxScene_ViewWindow(SUIT_Desktop* theDesktop, QxScene_Viewer* theModel);
53 virtual ~QxScene_ViewWindow();
55 void setBackgroundColor( const QColor& );
56 QColor backgroundColor() const;
58 QToolBar* getToolBar();
60 SUIT_ResourceMgr* resMgr() const;
62 QxScene_Viewer* getViewModel() const { return myViewModel; }
63 void setViewModel(QxScene_Viewer* theViewModel) { myViewModel = theViewModel; }
65 virtual void initLayout();
67 void contextPopupEvent(QContextMenuEvent* theEvent) { emit contextMenuRequested( theEvent); }
69 void setScene(QGraphicsScene* scene) { _scene = scene; }
70 QGraphicsScene* getScene() { return _scene; }
71 void setSceneView(QGraphicsView* sceneView){ _sceneView = sceneView; }
72 QGraphicsView* getSceneView() { return _sceneView; }
73 virtual bool closeRequested();
76 void tryClose(bool &isClosed, QxScene_ViewWindow* window);
83 void onViewGlobalPan();
87 void resizeEvent( QResizeEvent* theEvent );
89 QGraphicsScene* _scene;
90 QGraphicsView* _sceneView;
98 QxScene_Viewer* myViewModel;
102 #pragma warning ( default:4251 )