1 // SALOME OCCViewer : build OCC Viewer into Salome desktop
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : OCCViewer_ViewFrame.h
25 // Author : Nicolas REJNERI
29 #ifndef OCCViewer_ViewFrame_H
30 #define OCCViewer_ViewFrame_H
32 #include "OCCViewer_ViewPort.h"
33 #include "QAD_ViewFrame.h"
35 class OCCViewer_Viewer3d;
36 class QAD_EXPORT OCCViewer_ViewFrame : public QAD_ViewFrame
41 OCCViewer_ViewFrame(QWidget* parent, const QString& title);
42 OCCViewer_ViewFrame(QWidget* parent = 0);
43 virtual ~OCCViewer_ViewFrame();
46 virtual void initViewPort();
51 ViewType getTypeView() const{ return VIEW_OCC;};
52 QWidget* getViewWidget();
53 void setViewPort(OCCViewer_ViewPort* view);
54 OCCViewer_ViewPort* getViewPort() const;
56 void setViewer(OCCViewer_Viewer3d* viewer);
57 OCCViewer_Viewer3d* getViewer() const;
59 void setVisible( bool isVisible = true );
61 void setBackgroundColor( const QColor& );
62 QColor backgroundColor() const;
64 void setCursor( const QCursor& );
65 QCursor cursor() const;
67 void SetSelectionMode( int mode ) {};
69 /* popup management */
70 void setPopupServer( QAD_Application* );
73 /* interactive object management */
74 void highlight( const Handle(SALOME_InteractiveObject)& IObject,
75 bool highlight, bool update = true );
76 void unHighlightAll();
77 void rename( const Handle(SALOME_InteractiveObject)& IObject,
79 bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
80 bool isVisible( const Handle(SALOME_InteractiveObject)& IObject );
82 /* undo/redo management */
83 void undo(SALOMEDS::Study_var aStudy,
84 const char* StudyFrameEntry);
85 void redo(SALOMEDS::Study_var aStudy,
86 const char* StudyFrameEntry);
89 Handle(SALOME_InteractiveObject) FindIObject(const char* Entry);
92 void Display(const Handle(SALOME_InteractiveObject)& IObject, bool update = true);
93 void DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject);
94 void Erase(const Handle(SALOME_InteractiveObject)& IObject, bool update = true);
100 void closeEvent(QCloseEvent* e);
101 void resizeEvent(QResizeEvent* e);
102 void keyPressEvent( QKeyEvent *k );
105 void vfTransformationStarted ( OCCViewer_ViewPort::OperationType );
106 void vfTransformationFinished( OCCViewer_ViewPort::OperationType );
107 void vfDrawExternal(QPainter* painter);
108 void vfMousePress(QMouseEvent*);
109 void vfMouseRelease(QMouseEvent*);
110 void vfMouseMove(QMouseEvent*);
111 void vfMouseDoubleClick(QMouseEvent*);
112 void vfKeyPress(QKeyEvent*);
113 void vfKeyRelease(QKeyEvent*);
114 void vfResize(QResizeEvent*);
115 void vfPrint(QPaintEvent*);
116 void vfViewClosing(QCloseEvent*);
117 void vfMoved (QMoveEvent*);
124 void onViewFitArea();
125 void onViewGlobalPan();
134 void onViewTrihedron();
135 void onAdjustTrihedron();
138 OCCViewer_Viewer3d* myViewer; // my owner
139 OCCViewer_ViewPort* myViewPort; // child viewport