2 #ifndef XGUI_ViewPort_H
3 #define XGUI_ViewPort_H
5 #include "XGUI_ViewBackground.h"
8 #include <V3d_Viewer.hxx>
9 #include <V3d_View.hxx>
12 class XGUI_ViewWindow;
14 class XGUI_ViewPort : public QWidget
18 XGUI_ViewPort(XGUI_ViewWindow* theParent,
19 const Handle(V3d_Viewer)& theViewer,
20 V3d_TypeOfView theType = V3d_ORTHOGRAPHIC);
23 virtual QPaintEngine* paintEngine() const { return 0; }
25 QImage dumpView(QRect theRect = QRect(), bool toUpdate = true);
27 Handle(V3d_View) getView() const { return activeView(); }
29 void startRotation( int x, int y, int theRotationPointType, const gp_Pnt& theSelectedPoint );
30 void rotate( int, int, int, const gp_Pnt& );
34 void pan( int dx, int dy );
35 void setCenter( int x, int y );
36 void fitRect( const QRect& rect );
37 void startZoomAtPoint( int x, int y );
38 void zoom( int x0, int y0, int x, int y );
39 void fitAll(bool theKeepScale = false, bool theWithZ = true, bool theUpd = true);
41 void setAdvancedZoomingEnabled( const bool theState ) { myIsAdvancedZoomingEnabled = theState; }
42 bool isAdvancedZoomingEnabled() const { return myIsAdvancedZoomingEnabled; }
44 XGUI_ViewBackground background() const { return myBackground; }
45 void setBackground( const XGUI_ViewBackground& bgData );
48 void vpChangeBackground( const XGUI_ViewBackground& );
51 void vpTransformed( );
55 virtual void paintEvent( QPaintEvent* );
56 virtual void resizeEvent( QResizeEvent* );
60 Handle(V3d_View) activeView() const { return myActiveView; }
62 bool mapView( const Handle(V3d_View)& theView);
63 bool setWindow( const Handle(V3d_View)& theView);
64 bool mapped( const Handle(V3d_View)& theView) const;
65 void updateBackground();
66 void attachWindow( const Handle(V3d_View)& theView, const Handle(Aspect_Window)& theWnd);
69 Handle(V3d_View) myOrthoView;
70 Handle(V3d_View) myPerspView;
71 Handle(V3d_View) myActiveView;
73 Handle(Aspect_Window) myWindow;
75 bool myPaintersRedrawing;
76 bool myIsAdvancedZoomingEnabled;
80 XGUI_ViewBackground myBackground;