1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // SALOME QxScene : build Supervisor viewer into desktop
22 #ifndef QXSCENE_VIEWWINDOW_H
23 #define QXSCENE_VIEWWINDOW_H
26 #include "QxScene_ViewModel.h"
28 #include "SUIT_ViewWindow.h"
30 #include "QtxAction.h"
34 #include <QGraphicsScene>
35 #include <QGraphicsView>
38 #pragma warning ( disable:4251 )
41 class SUIT_ResourceMgr;
43 class QXSCENE_EXPORT QxScene_ViewWindow : public SUIT_ViewWindow {
48 enum { FitAllId, FitRectId, ZoomId, ScaleOpId, PanId, GlobalPanId, MoveOpId, ResetId };
50 QxScene_ViewWindow(SUIT_Desktop* theDesktop, QxScene_Viewer* theModel);
51 virtual ~QxScene_ViewWindow();
53 void setBackgroundColor( const QColor& );
54 QColor backgroundColor() const;
56 QToolBar* getToolBar();
58 SUIT_ResourceMgr* resMgr() const;
60 QxScene_Viewer* getViewModel() const { return myViewModel; }
61 void setViewModel(QxScene_Viewer* theViewModel) { myViewModel = theViewModel; }
63 virtual void initLayout();
65 void contextPopupEvent(QContextMenuEvent* theEvent) { emit contextMenuRequested( theEvent); }
67 void setScene(QGraphicsScene* scene) { _scene = scene; }
68 QGraphicsScene* getScene() { return _scene; }
69 void setSceneView(QGraphicsView* sceneView){ _sceneView = sceneView; }
70 QGraphicsView* getSceneView() { return _sceneView; }
71 virtual bool closeRequested();
74 void tryClose(bool &isClosed, QxScene_ViewWindow* window);
81 void onViewGlobalPan();
85 void resizeEvent( QResizeEvent* theEvent );
87 QGraphicsScene* _scene;
88 QGraphicsView* _sceneView;
96 QxScene_Viewer* myViewModel;
100 #pragma warning ( default:4251 )