Salome HOME
sources v1.2
[modules/kernel.git] / src / SALOMEGUI / QAD_ViewFrame.h
1 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : QAD_ViewFrame.cxx
25 //  Author : Nicolas REJNERI
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef QAD_ViewFrame_H
30 #define QAD_ViewFrame_H
31
32 #include "QAD.h"
33 #include "QAD_Application.h"
34 #include "QAD_StudyFrame.h"
35 #include "SALOME_InteractiveObject.hxx"
36
37 // QT Include
38 #include <qmainwindow.h>
39
40 //class vtkRenderer;
41
42 class QAD_EXPORT QAD_ViewFrame : public QMainWindow
43 {
44   Q_OBJECT
45
46 public:
47   QAD_ViewFrame(QWidget* parent, const QString& title);
48   QAD_ViewFrame(QWidget* parent = 0);
49   virtual ~QAD_ViewFrame();
50
51   void                   cleanup();
52
53   virtual ViewType       getTypeView() const = 0; 
54   virtual QWidget*       getViewWidget() = 0;
55 //  virtual vtkRenderer*   getRenderer();
56
57   virtual void           setBackgroundColor( const QColor& ) = 0;
58   virtual QColor         backgroundColor() const = 0;
59
60   virtual void           SetSelectionMode( int mode ) = 0;
61
62   virtual void           SetTrihedronSize( int dim ) = 0;
63
64   /*  popup management */
65   virtual void           setPopupServer( QAD_Application* ) = 0;
66
67   /*  interactive object management */
68   virtual void           highlight( const Handle(SALOME_InteractiveObject)& IObject, 
69                                     bool highlight, bool immediatly = true ) = 0;
70   virtual void           unHighlightAll() = 0;
71   virtual void           rename( const Handle(SALOME_InteractiveObject)& IObject,
72                                  QString newName ) = 0;
73   virtual bool           isInViewer( const Handle(SALOME_InteractiveObject)& IObject ) = 0;
74   virtual bool           isVisible( const Handle(SALOME_InteractiveObject)& IObject ) = 0;
75
76   /*  undo/redo management */
77   virtual void           undo(SALOMEDS::Study_var aStudy,
78                               const char* StudyFrameEntry) = 0;
79   virtual void           redo(SALOMEDS::Study_var aStudy,
80                               const char* StudyFrameEntry) = 0;
81
82   static bool            isInViewer(SALOMEDS::Study_var aStudy,
83                                     const char* anEntry,
84                                     const char* StudyFrameEntry);
85
86   /* selection */
87   virtual Handle(SALOME_InteractiveObject)   FindIObject(const char* Entry) = 0;
88
89   /* display */         
90   virtual void           Display(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true) = 0;
91   virtual void           DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject) = 0;
92   virtual void           Erase(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true) = 0;
93   virtual void           DisplayAll() = 0;
94   virtual void           EraseAll() = 0;
95   virtual void           Repaint() = 0;
96
97 protected slots:
98   virtual void           onViewPan() = 0; 
99   virtual void           onViewZoom() = 0;
100   virtual void           onViewFitAll() = 0;
101   virtual void           onViewFitArea() = 0;
102   virtual void           onViewGlobalPan() = 0; 
103   virtual void           onViewRotate() = 0;
104   virtual void           onViewReset() = 0;     
105   virtual void           onViewFront() = 0; 
106   virtual void           onViewBack() = 0; 
107   virtual void           onViewRight() = 0; 
108   virtual void           onViewLeft() = 0;     
109   virtual void           onViewBottom() = 0;
110   virtual void           onViewTop() = 0;
111   virtual void           onViewTrihedron() = 0; 
112   virtual void           onViewDump();
113
114 };
115
116 #endif
117