1 #ifndef XGUI_ViewPort_H
2 #define XGUI_ViewPort_H
9 #include <V3d_Viewer.hxx>
10 #include <V3d_View.hxx>
13 class XGUI_ViewWindow;
15 class XGUI_EXPORT XGUI_ViewPort : public QWidget
19 XGUI_ViewPort(XGUI_ViewWindow* theParent, const Handle(V3d_Viewer)& theViewer,
20 V3d_TypeOfView theType = V3d_ORTHOGRAPHIC);
21 virtual ~XGUI_ViewPort();
23 virtual QPaintEngine* paintEngine() const
28 QImage dumpView(unsigned char*& theData, QRect theRect = QRect(), bool toUpdate = true);
30 Handle(V3d_View) getView() const
35 void startRotation(int x, int y, int theRotationPointType, const gp_Pnt& theSelectedPoint);
36 void rotate(int, int, int, const gp_Pnt&);
40 void pan(int dx, int dy);
41 void setCenter(int x, int y);
42 void fitRect(const QRect& rect);
43 void startZoomAtPoint(int x, int y);
44 void zoom(int x0, int y0, int x, int y);
45 void fitAll(bool theKeepScale = false, bool theWithZ = true, bool theUpd = true);
47 void setAdvancedZoomingEnabled(const bool theState)
49 myIsAdvancedZoomingEnabled = theState;
51 bool isAdvancedZoomingEnabled() const
53 return myIsAdvancedZoomingEnabled;
56 Qtx::BackgroundData background() const
61 void setBackground(const Qtx::BackgroundData& bgData);
63 void syncronizeWith(const XGUI_ViewPort* ref);
66 void vpChangeBackground(const Qtx::BackgroundData&);
74 virtual void paintEvent(QPaintEvent*);
75 virtual void resizeEvent(QResizeEvent*);
78 Handle(V3d_View) activeView() const
83 bool mapView(const Handle(V3d_View)& theView);
84 bool setWindow(const Handle(V3d_View)& theView);
85 bool mapped(const Handle(V3d_View)& theView) const;
86 void updateBackground();
87 void attachWindow(const Handle(V3d_View)& theView, const Handle(Aspect_Window)& theWnd);
89 Handle(V3d_View) myOrthoView;Handle(V3d_View) myPerspView;Handle(V3d_View) myActiveView;
91 Handle(Aspect_Window) myWindow;
93 bool myPaintersRedrawing;
94 bool myIsAdvancedZoomingEnabled;
98 Qtx::BackgroundData myBackground;