1 // SALOME OCCViewer : build OCC Viewer into Salome desktop
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : OCCViewer_ViewPort3d.h
25 // Author : Nicolas REJNERI
29 #ifndef OCCViewer_ViewPort3d_H
30 #define OCCViewer_ViewPort3d_H
32 #include "OCCViewer_ViewPort.h"
33 #include "OCCViewer_VService.h"
37 // Open CASCADE Includes
38 #include <Standard.hxx>
39 #include <V3d_View.hxx>
40 #include <V3d_Viewer.hxx>
47 #include <qapplication.h>
49 class QAD_EXPORT OCCViewer_ViewPort3d: public OCCViewer_ViewPort
54 OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_Viewer)& viewer,
55 V3d_TypeOfView viewType = V3d_ORTHOGRAPHIC,
56 OCCViewer_ViewPort* prevView = 0,
57 const QRect* magnify = 0 );
58 ~OCCViewer_ViewPort3d();
60 /* view 3D management */
61 Handle (V3d_View) setView( const Handle( V3d_View )& );
62 Handle (V3d_View) getView() const;
63 Handle (V3d_Viewer) getViewer() const;
64 V3d_TypeOfView setViewType( V3d_TypeOfView type );
66 /* popup management */
69 /* view transformations */
70 void activateGlobalPanning();
71 void fitAll( bool withZ = true );
74 void incrementalPan ( const int incrX, const int incrY );
75 void incrementalZoom ( const int incr );
76 void incrementalRotate( const int incrX, const int incrY );
79 void setBackgroundColor( const QColor& color);
80 QColor backgroundColor() const;
83 void onChangeBackgroundColor();
86 void paintEvent(QPaintEvent *ev);
91 void pan(int dx, int dy);
92 void setCenter(int x, int y);
93 void fitWindow( const QRect& rect);
94 void zoom(int x0, int y0, int x, int y);
95 void startRotation(int x0, int y0);
96 void rotate(int x, int y);
100 Handle (V3d_View) myActiveView;