1 #ifndef XGUI_ViewPort_H
2 #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_EXPORT XGUI_ViewPort: public QWidget
18 XGUI_ViewPort(XGUI_ViewWindow* theParent, const Handle(V3d_Viewer)& theViewer,
19 V3d_TypeOfView theType = V3d_ORTHOGRAPHIC);
20 virtual ~XGUI_ViewPort();
22 virtual QPaintEngine* paintEngine() const
27 QImage dumpView(QRect theRect = QRect(), bool toUpdate = true);
29 Handle(V3d_View) getView() const
34 void startRotation(int x, int y, int theRotationPointType, const gp_Pnt& theSelectedPoint);
35 void rotate(int, int, int, const gp_Pnt&);
39 void pan(int dx, int dy);
40 void setCenter(int x, int y);
41 void fitRect(const QRect& rect);
42 void startZoomAtPoint(int x, int y);
43 void zoom(int x0, int y0, int x, int y);
44 void fitAll(bool theKeepScale = false, bool theWithZ = true, bool theUpd = true);
46 void setAdvancedZoomingEnabled(const bool theState)
48 myIsAdvancedZoomingEnabled = theState;
50 bool isAdvancedZoomingEnabled() const
52 return myIsAdvancedZoomingEnabled;
55 XGUI_ViewBackground background() const
60 void setBackground(const XGUI_ViewBackground& bgData);
62 void syncronizeWith( const XGUI_ViewPort* ref );
65 void vpChangeBackground(const XGUI_ViewBackground&);
73 virtual void paintEvent(QPaintEvent*);
74 virtual void resizeEvent(QResizeEvent*);
77 Handle(V3d_View) activeView() const
82 bool mapView(const Handle(V3d_View)& theView);
83 bool setWindow(const Handle(V3d_View)& theView);
84 bool mapped(const Handle(V3d_View)& theView) const;
85 void updateBackground();
86 void attachWindow(const Handle(V3d_View)& theView, const Handle(Aspect_Window)& theWnd);
88 Handle(V3d_View) myOrthoView;Handle(V3d_View) myPerspView;Handle(V3d_View) myActiveView;
90 Handle(Aspect_Window) myWindow;
92 bool myPaintersRedrawing;
93 bool myIsAdvancedZoomingEnabled;
97 XGUI_ViewBackground myBackground;