]> SALOME platform Git repositories - modules/superv.git/blob - src/SUPERVGUI/SUPERVGUI_Graph.h
Salome HOME
NRI : Correction 1.1a version.
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_Graph.h
1 //  File      : SUPERVGUI_Graph.h
2 //  Created   : 17 / 10 / 2001
3 //  Author    : Francis KLOSS
4 //  Project   : SALOME
5 //  Module    : SUPERVGUI
6 //  Copyright : CEA
7
8 #ifndef SUPERVGUI_Graph_H
9 #define SUPERVGUI_Graph_H
10
11 using namespace std;
12 //#include "SUPERVGUI.h"
13 #include "SUPERVGUI_View.h"
14 #include "SUPERVGUI_Node.h"
15 #include "SUPERVGUI_Link.h"
16
17 class SUPERVGUI_Main;
18
19 class SUPERVGUI_Graph: public SUPERVGUI_View {
20   Q_OBJECT
21
22   public:
23     SUPERVGUI_Graph(SUPERVGUI_Main* m);
24     virtual ~SUPERVGUI_Graph();
25
26     void sync();
27     void contentsMousePressEvent(QMouseEvent* e);
28     void contentsMouseReleaseEvent(QMouseEvent* e);
29     void contentsMouseMoveEvent(QMouseEvent* e);
30
31  
32     virtual void setAsFromStudy(bool theToStudy);
33     
34     bool isLinkPrsExists(SUPERV_Link theLink);
35     bool createLinkPrs(SUPERV_Link theLink);
36     void removeLinks() 
37       { myLinksList.clear(); };
38
39     void setFullView();
40     void setControlView();
41     void deleteLink(SUPERVGUI_Link* theLink);
42
43     void deleteNode(SUPERVGUI_Node* theNode);
44     
45     void draw();
46     void clearView();
47
48 signals:
49   void mouseMoved(QMouseEvent* theEvent);
50   void mousePressed(QMouseEvent* theEvent);
51   void mouseReleased(QMouseEvent* theEvent);
52
53 public slots:
54   void sketchBegin(SUPERVGUI_Port* thePort);
55   void sketchEnd(SUPERVGUI_Port* thePort);
56   
57  
58 private slots:
59   void addPoint();
60   void deleteLink();
61   void deletePoint();
62   void delLastPnt();
63   void delCreatingLink();
64   void setOrtho();
65
66   protected:
67     bool eventFilter(QObject* object, QEvent* event);
68
69   private:
70
71     QPoint myMousePos;
72     SUPERVGUI_Link* mySelectedLink;
73     int mySelectedPoint;
74
75     // Popup menu for link creation management
76     QPopupMenu* mySketchPopup;
77     int myDelPntItem;
78     int myOrtoItem;
79
80      // Popup menu for link
81     QPopupMenu* myLinkPopup;
82     int myDelLinkPntItem;
83     int myAddLinkPntItem;
84     int myDelLinkItem;
85    
86
87     SUPERVGUI_Link* myNewLink;
88     QPtrList<SUPERVGUI_Link> myLinksList;
89 };
90
91 #endif