1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
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
23 // SUIT_ViewWindow.h: interface for the SUIT_ViewWindow class.
25 #ifndef SUIT_VIEWWINDOW_H
26 #define SUIT_VIEWWINDOW_H
29 #include "SUIT_CameraProperties.h"
31 #include <QMainWindow>
36 class SUIT_ViewManager;
37 class QtxActionToolMgr;
41 class SUIT_EXPORT SUIT_ViewWindow: public QMainWindow
47 SUIT_ViewWindow( SUIT_Desktop* );
48 virtual ~SUIT_ViewWindow();
50 virtual void setViewManager( SUIT_ViewManager* );
51 SUIT_ViewManager* getViewManager() const;
55 virtual QImage dumpView();
56 virtual bool dumpViewToPSFormat(const QString& fileName);
57 bool dumpViewToFormat( const QString& fileName, const QString& format );
59 bool onAccelAction( int );
61 bool closable() const;
62 bool setClosable( const bool );
64 virtual QString getVisualParameters();
65 virtual void setVisualParameters( const QString& parameters );
67 void setDestructiveClose( const bool );
71 QtxActionToolMgr* toolMgr() const;
73 virtual void setDropDownButtons( bool );
74 bool dropDownButtons() const;
76 virtual SUIT_CameraProperties cameraProperties();
79 virtual void onDumpView();
82 void tryClosing( SUIT_ViewWindow* );
83 void closing( SUIT_ViewWindow* );
84 void mousePressed( SUIT_ViewWindow*, QMouseEvent* );
85 void mouseReleased( SUIT_ViewWindow*, QMouseEvent* );
86 void mouseDoubleClicked( SUIT_ViewWindow*, QMouseEvent* );
87 void mouseMoving( SUIT_ViewWindow*, QMouseEvent* );
88 void wheeling( SUIT_ViewWindow*, QWheelEvent* );
89 void keyPressed( SUIT_ViewWindow*, QKeyEvent* );
90 void keyReleased( SUIT_ViewWindow*, QKeyEvent* );
91 void contextMenuRequested( QContextMenuEvent *e );
92 void viewModified( SUIT_ViewWindow* );
95 void closeEvent( QCloseEvent* );
96 virtual void contextMenuEvent( QContextMenuEvent* );
97 virtual QString filter(bool includePS = false) const;
98 virtual bool action( const int );
99 virtual bool dumpViewToFormat( const QImage&, const QString& fileName, const QString& format );
101 virtual QAction* synchronizeAction();
102 static void synchronizeView( SUIT_ViewWindow* viewWindow, int id );
104 SUIT_Desktop* myDesktop;
105 SUIT_ViewManager* myManager;
108 void updateSyncViews();
109 void onSynchronizeView(bool);
110 virtual void synchronize( SUIT_ViewWindow* );
111 void emitViewModified();
114 typedef QMap< int, QList<QtxMultiAction*> > ActionsMap;
116 QtxActionToolMgr* myToolMgr;
118 ActionsMap myMultiActions;
119 QAction* mySyncAction;
122 #endif // SUIT_VIEWWINDOW_H