]> SALOME platform Git repositories - modules/gui.git/blob - src/SUPERVGraph/SUPERVGraph_ViewFrame.h
Salome HOME
351241aa8939a9c004e859a5707155855c17625c
[modules/gui.git] / src / SUPERVGraph / SUPERVGraph_ViewFrame.h
1 //  SALOME SUPERVGraph : build Supervisor viewer into desktop
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   : SUPERVGraph_ViewFrame.h
25 //  Author : Nicolas REJNERI
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef SUPERVGraph_ViewFrame_H
30 #define SUPERVGraph_ViewFrame_H
31
32 #include "SALOME_InteractiveObject.hxx"
33 #include "SUIT_PopupClient.h"
34 #include "SUIT_ViewWindow.h"
35
36 class /*SUPERVGRAPH_EXPORT*/ SUPERVGraph_View: public QWidget, public SUIT_PopupClient {
37   Q_OBJECT;
38  public:
39   static QString Type() { return "SUPERVGraphViewer"; }
40
41   SUPERVGraph_View(QWidget* theParent);
42   SUPERVGraph_View(SUPERVGraph_View* theParent);
43
44   virtual void ActivatePanning() = 0;
45   virtual void ResetView() = 0;
46
47   /* redefine functions from SUIT_PopupClient */
48   virtual QString popupClientType() const { return Type(); }
49   virtual void    contextMenuPopup( QPopupMenu* );
50   
51   virtual void resizeView( QResizeEvent* theEvent ) {};
52   
53  protected:
54   void init(QWidget* theParent);
55   
56 };
57
58 class /*SUPERVGRAPH_EXPORT*/ SUPERVGraph_ViewFrame : public SUIT_ViewWindow {
59   Q_OBJECT
60
61     public:
62   SUPERVGraph_ViewFrame(SUIT_Desktop* theDesktop );
63   ~SUPERVGraph_ViewFrame();
64
65   SUPERVGraph_View*              getViewWidget();
66   void                           setViewWidget(SUPERVGraph_View* theView);
67
68   void                           setBackgroundColor( const QColor& );
69   QColor                         backgroundColor() const;
70   
71   void                           onAdjustTrihedron( );
72   
73   /*  interactive object management */
74   void                           highlight( const Handle(SALOME_InteractiveObject)& IObject, 
75                                             bool highlight, bool immediatly = true );
76   void                           unHighlightAll();
77   void                           rename( const Handle(SALOME_InteractiveObject)& IObject,
78                                          QString newName );
79   bool                           isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
80   bool                           isVisible( const Handle(SALOME_InteractiveObject)& IObject );
81   
82   /* selection */
83   Handle(SALOME_InteractiveObject) FindIObject(const char* Entry) { Handle(SALOME_InteractiveObject) o; return o; };
84
85   /* display */         
86   void           Display(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){};
87   void           DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject){};
88   void           Erase(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){};
89   void           DisplayAll(){};
90   void           EraseAll(){};
91   void           Repaint() {};
92
93  public slots:
94   void           onViewPan(); 
95   void           onViewZoom();
96   void           onViewFitAll();
97   void           onViewFitArea();
98   void           onViewGlobalPan(); 
99   void           onViewRotate();
100   void           onViewReset();     
101   void           onViewFront(); 
102   void           onViewBack(); 
103   void           onViewRight(); 
104   void           onViewLeft();     
105   void           onViewBottom();
106   void           onViewTop();
107   void           onViewTrihedron(); 
108
109  protected:
110   void resizeEvent( QResizeEvent* theEvent );
111   
112  private:
113   SUPERVGraph_View* myView;
114 }; 
115 #endif