]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_ViewPort.h
Salome HOME
d3f6eddf1d3c123cbda1fd4ceb598000ed24c4a0
[modules/shaper.git] / src / XGUI / XGUI_ViewPort.h
1
2 #ifndef XGUI_ViewPort_H
3 #define XGUI_ViewPort_H
4
5 #include <QWidget>
6 #include <V3d_Viewer.hxx>
7 #include <V3d_View.hxx>
8
9 class XGUI_ViewWindow;
10
11 class XGUI_ViewPort : public QWidget
12 {
13     Q_OBJECT
14 public:
15     XGUI_ViewPort(XGUI_ViewWindow* theParent, 
16                   const Handle(V3d_Viewer)& theViewer, 
17                   V3d_TypeOfView theType = V3d_ORTHOGRAPHIC);
18     ~XGUI_ViewPort();
19
20     virtual QPaintEngine* paintEngine() const { return 0; }
21
22     QImage dumpView(QRect theRect = QRect(), bool toUpdate = true);
23
24     Handle(V3d_View) getView() const { return activeView(); }
25
26 signals:
27   //void                  vpChangeBackground( const Qtx::BackgroundData& );
28     void                  vpClosed();
29     void                  vpMapped();
30
31
32 protected:
33     virtual void          paintEvent( QPaintEvent* );
34     virtual void          resizeEvent( QResizeEvent* );
35
36
37 private:
38     Handle(V3d_View)      activeView() const { return myActiveView; }
39
40     bool mapView( const Handle(V3d_View)& theView);
41     bool setWindow( const Handle(V3d_View)& theView);
42     bool mapped( const Handle(V3d_View)& theView) const;
43     void updateBackground();
44     void attachWindow( const Handle(V3d_View)& theView, const Handle(Aspect_Window)& theWnd);
45
46
47     Handle(V3d_View) myOrthoView;
48     Handle(V3d_View) myPerspView;
49     Handle(V3d_View) myActiveView;
50
51     Handle(Aspect_Window) myWindow;
52   
53     bool myPaintersRedrawing;
54 };
55
56
57 #endif