Salome HOME
This commit was generated by cvs2git to create tag 'V1_4_0b1'.
[modules/kernel.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 "QAD.h"
33 #include "QAD_ViewFrame.h"
34 #include "QAD_Application.h"
35
36 #include "SALOME_InteractiveObject.hxx"
37
38 class QAD_EXPORT SUPERVGraph_View: public QWidget, public QAD_PopupClientServer{
39   Q_OBJECT;
40  public:
41   SUPERVGraph_View(QWidget* theParent);
42   SUPERVGraph_View(SUPERVGraph_View* theParent);
43
44   virtual void ActivatePanning() = 0;
45   virtual void ResetView() = 0;
46  protected:
47   void init(QWidget* theParent);
48   void onCreatePopup();
49 };
50
51 class QAD_EXPORT SUPERVGraph_ViewFrame : public QAD_ViewFrame {
52   Q_OBJECT
53
54     public:
55   SUPERVGraph_ViewFrame(QWidget* parent, const char* name=0 );
56   ~SUPERVGraph_ViewFrame();
57
58   ViewType                       getTypeView() const{ return VIEW_GRAPHSUPERV;};
59   SUPERVGraph_View*              getViewWidget();
60   void                           setViewWidget(SUPERVGraph_View* theView);
61
62   void                           setBackgroundColor( const QColor& );
63   QColor                         backgroundColor() const;
64   
65   void                           SetSelectionMode( int mode );
66
67   void                           onAdjustTrihedron( );
68   
69   /*  popup management */
70   void                           setPopupServer( QAD_Application* );
71
72   /*  interactive object management */
73   void                           highlight( const Handle(SALOME_InteractiveObject)& IObject, 
74                                             bool highlight, bool immediatly = true );
75   void                           unHighlightAll();
76   void                           rename( const Handle(SALOME_InteractiveObject)& IObject,
77                                          QString newName );
78   bool                           isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
79   bool                           isVisible( const Handle(SALOME_InteractiveObject)& IObject );
80
81   /*  undo/redo management */
82   void              undo(SALOMEDS::Study_var aStudy,
83                          const char* StudyFrameEntry);
84   void              redo(SALOMEDS::Study_var aStudy,
85                          const char* StudyFrameEntry);
86
87
88   /* selection */
89   Handle(SALOME_InteractiveObject) FindIObject(const char* Entry) { };
90
91   /* display */         
92   void           Display(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){};
93   void           DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject){};
94   void           Erase(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){};
95   void           DisplayAll(){};
96   void           EraseAll(){};
97   void           Repaint() {};
98
99  public slots:
100   void           onViewPan(); 
101   void           onViewZoom();
102   void           onViewFitAll();
103   void           onViewFitArea();
104   void           onViewGlobalPan(); 
105   void           onViewRotate();
106   void           onViewReset();     
107   void           onViewFront(); 
108   void           onViewBack(); 
109   void           onViewRight(); 
110   void           onViewLeft();     
111   void           onViewBottom();
112   void           onViewTop();
113   void           onViewTrihedron(); 
114  
115  private:
116   SUPERVGraph_View* myView;
117   QAD_Application* myApp;
118 }; 
119 #endif