Salome HOME
NRI : Remove dependence with VISU.
[modules/kernel.git] / src / SUPERVGraph / SUPERVGraph_ViewFrame.h
1 //  File      : SUPERVGraph_ViewFrame.h
2 //  Created   : Wed Mar 20 14:22:27 2002
3 //  Author    : Nicolas REJNERI
4 //  Project   : SALOME
5 //  Module    : SUPERVGraph
6 //  Copyright : Open CASCADE 2002
7 //  $Header$
8
9
10 #ifndef SUPERVGraph_ViewFrame_H
11 #define SUPERVGraph_ViewFrame_H
12
13 #include "QAD.h"
14 #include "QAD_ViewFrame.h"
15 #include "QAD_Application.h"
16
17 #include "SALOME_InteractiveObject.hxx"
18
19 class QAD_EXPORT SUPERVGraph_View: public QWidget, public QAD_PopupClientServer{
20   Q_OBJECT;
21  public:
22   SUPERVGraph_View(QWidget* theParent);
23   SUPERVGraph_View(SUPERVGraph_View* theParent);
24
25   virtual void ActivatePanning() = 0;
26   virtual void ResetView() = 0;
27  protected:
28   void init(QWidget* theParent);
29   void onCreatePopup();
30 };
31
32 class QAD_EXPORT SUPERVGraph_ViewFrame : public QAD_ViewFrame {
33   Q_OBJECT
34
35     public:
36   SUPERVGraph_ViewFrame(QWidget* parent, const char* name=0 );
37   ~SUPERVGraph_ViewFrame();
38
39   ViewType                       getTypeView() const{ return VIEW_GRAPHSUPERV;};
40   SUPERVGraph_View*              getViewWidget();
41   void                           setViewWidget(SUPERVGraph_View* theView);
42
43   void                           setBackgroundColor( const QColor& );
44   QColor                         backgroundColor() const;
45   
46   void                           SetSelectionMode( int mode );
47
48   void                           SetTrihedronSize( int dim );
49   
50   /*  popup management */
51   void                           setPopupServer( QAD_Application* );
52
53   /*  interactive object management */
54   void                           highlight( const Handle(SALOME_InteractiveObject)& IObject, 
55                                             bool highlight, bool immediatly = true );
56   void                           unHighlightAll();
57   void                           rename( const Handle(SALOME_InteractiveObject)& IObject,
58                                          QString newName );
59   bool                           isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
60   bool                           isVisible( const Handle(SALOME_InteractiveObject)& IObject );
61
62   /*  undo/redo management */
63   void              undo(SALOMEDS::Study_var aStudy,
64                          const char* StudyFrameEntry);
65   void              redo(SALOMEDS::Study_var aStudy,
66                          const char* StudyFrameEntry);
67
68
69   /* selection */
70   Handle(SALOME_InteractiveObject) FindIObject(const char* Entry) { };
71
72   /* display */         
73   void           Display(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){};
74   void           DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject){};
75   void           Erase(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){};
76   void           DisplayAll(){};
77   void           EraseAll(){};
78   void           Repaint() {};
79
80  public slots:
81   void           onViewPan(); 
82   void           onViewZoom();
83   void           onViewFitAll();
84   void           onViewFitArea();
85   void           onViewGlobalPan(); 
86   void           onViewRotate();
87   void           onViewReset();     
88   void           onViewFront(); 
89   void           onViewBack(); 
90   void           onViewRight(); 
91   void           onViewLeft();     
92   void           onViewBottom();
93   void           onViewTop();
94   void           onViewTrihedron(); 
95  
96  private:
97   SUPERVGraph_View* myView;
98   QAD_Application* myApp;
99 }; 
100 #endif