1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
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.
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
19 #ifndef OCCVIEWER_VIEWPORT3D_H
20 #define OCCVIEWER_VIEWPORT3D_H
22 #include "OCCViewer_ViewPort.h"
26 #include <V3d_View.hxx>
27 #include <V3d_Viewer.hxx>
32 #pragma warning ( disable:4251 )
35 class OCCVIEWER_EXPORT OCCViewer_ViewPort3d: public OCCViewer_ViewPort
39 friend class OCCViewer_ViewTransformer;
42 OCCViewer_ViewPort3d( QWidget*, const Handle(V3d_Viewer)&, V3d_TypeOfView = V3d_ORTHOGRAPHIC );
43 virtual ~OCCViewer_ViewPort3d();
46 Handle(V3d_View) getView() const;
47 Handle(V3d_View) setView( const Handle(V3d_View)& );
48 Handle(V3d_Viewer) getViewer() const;
50 void setAnimationMode(bool theDegenerated);
52 virtual void setBackgroundColor( const QColor& color);
53 virtual QColor backgroundColor() const;
55 // void setActive( V3d_TypeOfView );
56 virtual bool syncronize( const OCCViewer_ViewPort3d* );
58 double getZSize() const;
59 void setZSize( double );
61 virtual void onUpdate();
65 virtual void pan( int , int );
66 virtual void setCenter( int , int );
67 virtual void fitRect( const QRect& );
68 virtual void zoom( int, int, int, int );
69 virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true );
71 void startRotation( int, int, int, const gp_Pnt& );
72 void rotate( int, int, int, const gp_Pnt& );
77 virtual void paintEvent( QPaintEvent* );
78 virtual void resizeEvent( QResizeEvent* );
81 Handle(V3d_View) activeView() const;
82 Handle(V3d_View) inactiveView() const;
83 bool mapView( const Handle(V3d_View)& );
84 bool setWindow( const Handle(V3d_View)& );
85 bool mapped( const Handle(V3d_View)& ) const;
88 Handle(V3d_View) myOrthoView;
89 Handle(V3d_View) myPerspView;
90 Handle(V3d_View) myActiveView;
97 #pragma warning ( default:4251 )