Back to index

salome-gui  6.5.0
OCCViewer_ViewFrame.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #ifndef OCCVIEWER_VIEWFRAME_H
00024 #define OCCVIEWER_VIEWFRAME_H
00025 
00026 #include "OCCViewer.h"
00027 #include "OCCViewer_ViewWindow.h"
00028 
00029 #include <gp_Pln.hxx>
00030 
00031 class SUIT_Desktop;
00032 class OCCViewer_Viewer;
00033 class QGridLayout;
00034 
00035 class OCCVIEWER_EXPORT OCCViewer_ViewFrame : public OCCViewer_ViewWindow  
00036 {
00037   Q_OBJECT
00038 public:
00039   enum { MAIN_VIEW, BOTTOM_RIGHT=MAIN_VIEW, BOTTOM_LEFT, TOP_LEFT, TOP_RIGHT };
00040 
00041   OCCViewer_ViewFrame(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel);
00042   virtual ~OCCViewer_ViewFrame();
00043 
00044   OCCViewer_ViewWindow*   getView( const int ) const;
00045 
00046   virtual OCCViewer_ViewPort3d* getViewPort() { return getView(MAIN_VIEW)->getViewPort(); }
00047   OCCViewer_ViewPort3d* getViewPort(int theView);
00048 
00049   virtual void performRestoring( const viewAspect& theAspect) { getView(MAIN_VIEW)->performRestoring(theAspect); }
00050   virtual void initLayout() {}
00051 
00052   virtual void updateEnabledDrawMode();
00053   virtual void setCuttingPlane( bool on, const double x = 0 , const double y = 0 , const double z = 0,
00054                                 const double dx = 0, const double dy = 0, const double dz = 1);
00055 
00056   virtual void setCuttingPlane( bool on, const gp_Pln thePln );
00057 
00058   virtual bool isCuttingPlane() { return getView(MAIN_VIEW)->isCuttingPlane(); }
00059 
00060   virtual QString getVisualParameters();
00061   virtual void setVisualParameters( const QString& parameters );
00062 
00063   virtual void initSketchers() { getView(MAIN_VIEW)->initSketchers(); }
00064   virtual OCCViewer_ViewSketcher* getSketcher( const int i)  { return getView(MAIN_VIEW)->getSketcher(i); }
00065   virtual void activateSketching( int i ) { getView(MAIN_VIEW)->activateSketching(i); }
00066 
00067   virtual int  interactionStyle() const { return getView(MAIN_VIEW)->interactionStyle(); }
00068   virtual void setInteractionStyle( const int i );
00069 
00070   virtual int  zoomingStyle() const { return getView(MAIN_VIEW)->zoomingStyle(); }
00071   virtual void setZoomingStyle( const int );
00072 
00073   virtual void setViewManager( SUIT_ViewManager* );
00074 
00075   virtual bool eventFilter(QObject* watched, QEvent* e) { return SUIT_ViewWindow::eventFilter(watched, e); }
00076 
00077   virtual QColor backgroundColor() const;                 // obsolete
00078   virtual void   setBackgroundColor( const QColor& );     // obsolete
00079 
00080   virtual Qtx::BackgroundData background() const;
00081   virtual void                setBackground( const Qtx::BackgroundData& );
00082 
00083   virtual void   setDropDownButtons( bool );
00084 
00085 public slots:
00086   virtual void onFrontView() { getView(MAIN_VIEW)->onFrontView(); }
00087   virtual void onViewFitAll();
00088   virtual void onBackView() { getView(MAIN_VIEW)->onBackView(); }
00089   virtual void onTopView() { getView(MAIN_VIEW)->onTopView(); }
00090   virtual void onBottomView() { getView(MAIN_VIEW)->onBottomView(); }
00091   virtual void onLeftView() { getView(MAIN_VIEW)->onLeftView(); }
00092   virtual void onRightView() { getView(MAIN_VIEW)->onRightView(); }
00093   virtual void onClockWiseView() { getView(MAIN_VIEW)->onClockWiseView(); }
00094   virtual void onAntiClockWiseView() { getView(MAIN_VIEW)->onAntiClockWiseView(); }
00095   virtual void onResetView() { getView(MAIN_VIEW)->onResetView(); }
00096   virtual void onFitAll();
00097   virtual void activateZoom() {}
00098   virtual void activateWindowFit() {}
00099   virtual void activateRotation() {}
00100   virtual void activatePanning() {}
00101   virtual void activateGlobalPanning() {}
00102   virtual void onSetRotationPoint( bool on ) {}
00103   virtual void onAxialScale() {}
00104   virtual void onAmbientToogle() {}
00105   virtual void onMemorizeView() {}
00106   virtual void onRestoreView() {}
00107   virtual void onSwitchInteractionStyle( bool on ) {}
00108 
00109   virtual void activateSetRotationGravity() {}
00110   virtual void activateSetRotationSelected( double theX, double theY, double theZ ) {}
00111   virtual void activateStartPointSelection() {}
00112   virtual void updateGravityCoords() {}
00113    
00114   void onMaximizedView( OCCViewer_ViewWindow*, bool );
00115 
00116   virtual void onDumpView();
00117 
00118 protected:
00119   virtual QImage dumpView();
00120   virtual bool   dumpViewToFormat( const QImage&, const QString&, const QString& );
00121 
00122 private slots:
00123   void onContextMenuRequested(QContextMenuEvent*);
00124 
00125 private:
00126   void connectViewSignals(OCCViewer_ViewWindow* theView);
00127 
00128 
00129   QList<OCCViewer_ViewWindow*> myViews;
00130   QGridLayout* myLayout;
00131 
00132   OCCViewer_ViewWindow* myPopupRequestedView;
00133 };
00134 
00135 #endif