1 // File : OCCViewer_ViewFrame.h
2 // Created : Wed Mar 20 10:53:24 2002
3 // Author : Nicolas REJNERI
6 // Copyright : Open CASCADE 2002
9 #ifndef OCCViewer_ViewFrame_H
10 #define OCCViewer_ViewFrame_H
12 #include "OCCViewer_ViewPort.h"
13 #include "QAD_ViewFrame.h"
15 class OCCViewer_Viewer3d;
16 class QAD_EXPORT OCCViewer_ViewFrame : public QAD_ViewFrame
21 OCCViewer_ViewFrame(QWidget* parent, const QString& title);
22 OCCViewer_ViewFrame(QWidget* parent = 0);
23 virtual ~OCCViewer_ViewFrame();
26 virtual void initViewPort();
31 ViewType getTypeView() const{ return VIEW_OCC;};
32 QWidget* getViewWidget();
33 void setViewPort(OCCViewer_ViewPort* view);
34 OCCViewer_ViewPort* getViewPort() const;
36 void setViewer(OCCViewer_Viewer3d* viewer);
37 OCCViewer_Viewer3d* getViewer() const;
39 void setVisible( bool isVisible = true );
41 void setBackgroundColor( const QColor& );
42 QColor backgroundColor() const;
44 void setCursor( const QCursor& );
45 QCursor cursor() const;
47 void SetSelectionMode( int mode ) {};
49 void SetTrihedronSize( int dim );
51 /* popup management */
52 void setPopupServer( QAD_Application* );
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,
61 bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
62 bool isVisible( const Handle(SALOME_InteractiveObject)& IObject );
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);
71 Handle(SALOME_InteractiveObject) FindIObject(const char* Entry);
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);
82 void closeEvent(QCloseEvent* e);
83 void resizeEvent(QResizeEvent* e);
84 void keyPressEvent( QKeyEvent *k );
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*);
106 void onViewFitArea();
107 void onViewGlobalPan();
116 void onViewTrihedron();
119 OCCViewer_Viewer3d* myViewer; // my owner
120 OCCViewer_ViewPort* myViewPort; // child viewport