Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/kernel.git] / src / OCCViewer / OCCViewer_ViewFrame.h
1 //  File      : OCCViewer_ViewFrame.h
2 //  Created   : Wed Mar 20 10:53:24 2002
3 //  Author    : Nicolas REJNERI
4 //  Project   : SALOME
5 //  Module    : OCCViewer
6 //  Copyright : Open CASCADE 2002
7 //  $Header$
8
9 #ifndef OCCViewer_ViewFrame_H
10 #define OCCViewer_ViewFrame_H
11
12 #include "OCCViewer_ViewPort.h"
13 #include "QAD_ViewFrame.h"
14
15 class OCCViewer_Viewer3d;
16 class QAD_EXPORT OCCViewer_ViewFrame : public QAD_ViewFrame
17 {
18   Q_OBJECT
19
20  public:
21   OCCViewer_ViewFrame(QWidget* parent, const QString& title);
22   OCCViewer_ViewFrame(QWidget* parent = 0);
23   virtual ~OCCViewer_ViewFrame();
24
25  protected:
26   virtual void      initViewPort();
27   void              initialize();
28   void              cleanup();
29
30  public:
31   ViewType          getTypeView() const{ return VIEW_OCC;};
32   QWidget*          getViewWidget();
33   void              setViewPort(OCCViewer_ViewPort* view);
34   OCCViewer_ViewPort*       getViewPort() const;
35
36   void              setViewer(OCCViewer_Viewer3d* viewer);
37   OCCViewer_Viewer3d*     getViewer() const;
38
39   void              setVisible( bool isVisible = true );
40
41   void              setBackgroundColor( const QColor& );
42   QColor            backgroundColor() const;
43
44   void              setCursor( const QCursor& );
45   QCursor           cursor() const;
46
47   void              SetSelectionMode( int mode ) {};
48
49   void              SetTrihedronSize( int dim );
50
51   /*  popup management */
52   void              setPopupServer( QAD_Application* );
53
54
55   /*  interactive object management */
56   void              highlight( const Handle(SALOME_InteractiveObject)& IObject, 
57                                bool highlight, bool update = true );
58   void              unHighlightAll();
59   void              rename( const Handle(SALOME_InteractiveObject)& IObject,
60                             QString newName );
61   bool              isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
62   bool              isVisible( const Handle(SALOME_InteractiveObject)& IObject );
63
64   /*  undo/redo management */
65   void              undo(SALOMEDS::Study_var aStudy,
66                          const char* StudyFrameEntry);
67   void              redo(SALOMEDS::Study_var aStudy,
68                          const char* StudyFrameEntry);
69
70   /* selection */
71   Handle(SALOME_InteractiveObject) FindIObject(const char* Entry);
72
73   /* display */         
74   void           Display(const Handle(SALOME_InteractiveObject)& IObject, bool update = true);
75   void           DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject);
76   void           Erase(const Handle(SALOME_InteractiveObject)& IObject, bool update = true);
77   void           DisplayAll();
78   void           EraseAll();
79   void           Repaint();
80
81  protected:     
82   void              closeEvent(QCloseEvent* e);
83   void              resizeEvent(QResizeEvent* e);
84   void              keyPressEvent( QKeyEvent *k );
85
86  signals:
87   void              vfTransformationStarted ( OCCViewer_ViewPort::OperationType );
88   void              vfTransformationFinished( OCCViewer_ViewPort::OperationType );
89   void              vfDrawExternal(QPainter* painter);
90   void              vfMousePress(QMouseEvent*);
91   void              vfMouseRelease(QMouseEvent*);
92   void              vfMouseMove(QMouseEvent*);
93   void              vfMouseDoubleClick(QMouseEvent*);
94   void              vfKeyPress(QKeyEvent*);
95   void              vfKeyRelease(QKeyEvent*);
96   void              vfResize(QResizeEvent*);
97   void              vfPrint(QPaintEvent*);
98   void              vfViewClosing(QCloseEvent*);
99   void              vfMoved (QMoveEvent*);
100
101   public slots:
102
103   void           onViewPan(); 
104   void           onViewZoom();
105   void           onViewFitAll();
106   void           onViewFitArea();
107   void           onViewGlobalPan(); 
108   void           onViewRotate();
109   void           onViewReset();     
110   void           onViewFront(); 
111   void           onViewBack(); 
112   void           onViewRight(); 
113   void           onViewLeft();     
114   void           onViewBottom();
115   void           onViewTop();
116   void           onViewTrihedron(); 
117  
118  protected:
119   OCCViewer_Viewer3d*      myViewer;     // my owner
120   OCCViewer_ViewPort*      myViewPort; // child viewport
121 };
122
123 #endif
124