Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef OCCVIEWER_VIEWPORT3D_H
00024 #define OCCVIEWER_VIEWPORT3D_H
00025
00026 #include "OCCViewer_ViewPort.h"
00027
00028 #include <V3d_View.hxx>
00029
00030 class QColor;
00031 class QRect;
00032
00033 class Handle(V3d_Viewer);
00034
00035 #ifdef WIN32
00036 #pragma warning ( disable:4251 )
00037 #endif
00038
00039 class OCCVIEWER_EXPORT OCCViewer_ViewPort3d: public OCCViewer_ViewPort
00040 {
00041 Q_OBJECT
00042
00043 friend class OCCViewer_ViewTransformer;
00044
00045 public:
00046 OCCViewer_ViewPort3d( QWidget*, const Handle(V3d_Viewer)&, V3d_TypeOfView = V3d_ORTHOGRAPHIC );
00047 virtual ~OCCViewer_ViewPort3d();
00048
00049 public:
00050 Handle(V3d_View) getView() const;
00051 Handle(V3d_View) setView( const Handle(V3d_View)& );
00052 Handle(V3d_Viewer) getViewer() const;
00053
00054 void setAnimationMode(bool theDegenerated);
00055
00056 virtual void setBackgroundColor( const QColor& color);
00057 virtual QColor backgroundColor() const;
00058
00059
00060 virtual bool syncronize( const OCCViewer_ViewPort3d* );
00061
00062 double getZSize() const;
00063 void setZSize( double );
00064
00065 virtual void onUpdate();
00066
00067
00068 virtual void reset();
00069 virtual void pan( int , int );
00070 virtual void setCenter( int , int );
00071 virtual void fitRect( const QRect& );
00072 virtual void startZoomAtPoint( int, int );
00073 virtual void zoom( int, int, int, int );
00074 virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true );
00075 virtual void rotateXY( double );
00076
00077 virtual void startRotation( int, int, int, const gp_Pnt& );
00078 virtual void rotate( int, int, int, const gp_Pnt& );
00079 virtual void endRotation();
00080 bool isBusy() {return myBusy;}
00081
00082 void setAdvancedZoomingEnabled( const bool theState ) { myIsAdvancedZoomingEnabled = theState; }
00083 bool isAdvancedZoomingEnabled() const { return myIsAdvancedZoomingEnabled; }
00084
00085 protected:
00086
00087 virtual void paintEvent( QPaintEvent* );
00088 virtual void resizeEvent( QResizeEvent* );
00089
00090
00091 virtual void attachWindow( const Handle(V3d_View)&, const Handle(Aspect_Window)& );
00092
00093 private:
00094 Handle(V3d_View) activeView() const;
00095 Handle(V3d_View) inactiveView() const;
00096 bool mapView( const Handle(V3d_View)& );
00097 bool setWindow( const Handle(V3d_View)& );
00098 bool mapped( const Handle(V3d_View)& ) const;
00099
00100 private:
00101 Handle(V3d_View) myOrthoView;
00102 Handle(V3d_View) myPerspView;
00103 Handle(V3d_View) myActiveView;
00104 bool myDegenerated;
00105 bool myAnimate;
00106 bool myBusy;
00107 double myScale;
00108 bool myIsAdvancedZoomingEnabled;
00109 };
00110
00111 #ifdef WIN32
00112 #pragma warning ( default:4251 )
00113 #endif
00114
00115 #endif