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 );
40 void setAdvancedZoomingEnabled( const bool theState ) { myIsAdvancedZoomingEnabled = theState; }
41 bool isAdvancedZoomingEnabled() const { return myIsAdvancedZoomingEnabled; }
43 XGUI_ViewBackground background() const { return myBackground; }
44 void setBackground( const XGUI_ViewBackground& bgData );
47 void vpChangeBackground( const XGUI_ViewBackground& );
50 void vpTransformed( );
54 virtual void paintEvent( QPaintEvent* );
55 virtual void resizeEvent( QResizeEvent* );
59 Handle(V3d_View) activeView() const { return myActiveView; }
61 bool mapView( const Handle(V3d_View)& theView);
62 bool setWindow( const Handle(V3d_View)& theView);
63 bool mapped( const Handle(V3d_View)& theView) const;
64 void updateBackground();
65 void attachWindow( const Handle(V3d_View)& theView, const Handle(Aspect_Window)& theWnd);
68 Handle(V3d_View) myOrthoView;
69 Handle(V3d_View) myPerspView;
70 Handle(V3d_View) myActiveView;
72 Handle(Aspect_Window) myWindow;
74 bool myPaintersRedrawing;
75 bool myIsAdvancedZoomingEnabled;
79 XGUI_ViewBackground myBackground;