1 // Copyright (C) 2007-2012 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
23 #ifndef OCCVIEWER_VIEWFRAME_H
24 #define OCCVIEWER_VIEWFRAME_H
26 #include "OCCViewer.h"
27 #include "OCCViewer_ViewWindow.h"
32 class OCCViewer_Viewer;
35 class OCCVIEWER_EXPORT OCCViewer_ViewFrame : public OCCViewer_ViewWindow
39 enum { MAIN_VIEW, BOTTOM_RIGHT=MAIN_VIEW, BOTTOM_LEFT, TOP_LEFT, TOP_RIGHT };
41 OCCViewer_ViewFrame(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel);
42 virtual ~OCCViewer_ViewFrame();
44 OCCViewer_ViewWindow* getView( const int ) const;
46 virtual OCCViewer_ViewPort3d* getViewPort() { return getView(MAIN_VIEW)->getViewPort(); }
47 OCCViewer_ViewPort3d* getViewPort(int theView);
49 virtual void performRestoring( const viewAspect& theAspect) { getView(MAIN_VIEW)->performRestoring(theAspect); }
50 virtual void initLayout() {}
52 virtual void updateEnabledDrawMode();
53 virtual void setCuttingPlane( bool on, const double x = 0 , const double y = 0 , const double z = 0,
54 const double dx = 0, const double dy = 0, const double dz = 1);
56 virtual void setCuttingPlane( bool on, const gp_Pln thePln );
58 virtual bool isCuttingPlane() { return getView(MAIN_VIEW)->isCuttingPlane(); }
60 virtual QString getVisualParameters();
61 virtual void setVisualParameters( const QString& parameters );
63 virtual void initSketchers() { getView(MAIN_VIEW)->initSketchers(); }
64 virtual OCCViewer_ViewSketcher* getSketcher( const int i) { return getView(MAIN_VIEW)->getSketcher(i); }
65 virtual void activateSketching( int i ) { getView(MAIN_VIEW)->activateSketching(i); }
67 virtual int interactionStyle() const { return getView(MAIN_VIEW)->interactionStyle(); }
68 virtual void setInteractionStyle( const int i );
70 virtual int zoomingStyle() const { return getView(MAIN_VIEW)->zoomingStyle(); }
71 virtual void setZoomingStyle( const int );
73 virtual void setViewManager( SUIT_ViewManager* );
75 virtual bool eventFilter(QObject* watched, QEvent* e) { return SUIT_ViewWindow::eventFilter(watched, e); }
77 virtual QColor backgroundColor() const; // obsolete
78 virtual void setBackgroundColor( const QColor& ); // obsolete
80 virtual Qtx::BackgroundData background() const;
81 virtual void setBackground( const Qtx::BackgroundData& );
83 virtual void setDropDownButtons( bool );
86 virtual void onFrontView() { getView(MAIN_VIEW)->onFrontView(); }
87 virtual void onViewFitAll();
88 virtual void onBackView() { getView(MAIN_VIEW)->onBackView(); }
89 virtual void onTopView() { getView(MAIN_VIEW)->onTopView(); }
90 virtual void onBottomView() { getView(MAIN_VIEW)->onBottomView(); }
91 virtual void onLeftView() { getView(MAIN_VIEW)->onLeftView(); }
92 virtual void onRightView() { getView(MAIN_VIEW)->onRightView(); }
93 virtual void onClockWiseView() { getView(MAIN_VIEW)->onClockWiseView(); }
94 virtual void onAntiClockWiseView() { getView(MAIN_VIEW)->onAntiClockWiseView(); }
95 virtual void onResetView() { getView(MAIN_VIEW)->onResetView(); }
96 virtual void onFitAll();
97 virtual void activateZoom() {}
98 virtual void activateWindowFit() {}
99 virtual void activateRotation() {}
100 virtual void activatePanning() {}
101 virtual void activateGlobalPanning() {}
102 virtual void onSetRotationPoint( bool on ) {}
103 virtual void onAxialScale() {}
104 virtual void onAmbientToogle() {}
105 virtual void onMemorizeView() {}
106 virtual void onRestoreView() {}
107 virtual void onSwitchInteractionStyle( bool on ) {}
109 virtual void activateSetRotationGravity() {}
110 virtual void activateSetRotationSelected( double theX, double theY, double theZ ) {}
111 virtual void activateStartPointSelection() {}
112 virtual void updateGravityCoords() {}
114 void onMaximizedView( OCCViewer_ViewWindow*, bool );
116 virtual void onDumpView();
119 virtual QImage dumpView();
120 virtual bool dumpViewToFormat( const QImage&, const QString&, const QString& );
123 void onContextMenuRequested(QContextMenuEvent*);
126 void connectViewSignals(OCCViewer_ViewWindow* theView);
129 QList<OCCViewer_ViewWindow*> myViews;
130 QGridLayout* myLayout;
132 OCCViewer_ViewWindow* myPopupRequestedView;