]> SALOME platform Git repositories - modules/superv.git/blob - src/SUPERVGUI/SUPERVGUI_Port.h
Salome HOME
This commit was generated by cvs2git to create branch 'IMPORT'.
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_Port.h
1 //  File      : SUPERVGUI_Port.h
2 //  Created   : 25 / 10 / 2001
3 //  Author    : Francis KLOSS
4 //  Project   : SALOME
5 //  Module    : SUPERVGUI
6 //  Copyright : CEA
7
8 #ifndef SUPERVGUI_Port_H
9 #define SUPERVGUI_Port_H
10
11 //#include "SUPERVGUI_Point.h"
12 #include "SUPERVGUI_Label.h"
13 #include "SUPERVGUI_Def.h"
14 #include "SALOME_Selection.h"
15
16 class SUPERVGUI_Main;
17 class SUPERVGUI_Link;
18
19 class SUPERVGUI_Port: public SUPERVGUI_Label {
20   Q_OBJECT
21
22   public:
23     SUPERVGUI_Port(QWidget* parent, SUPERVGUI_Main* m, SUPERV_Port p);
24     virtual ~SUPERVGUI_Port();
25
26     SUPERV_Port getPort();
27
28     virtual QPoint getConnectPnt();
29     virtual void deleteLinks() = 0;
30     virtual void sync();
31
32     SUPERVGUI_Main* getMain() { return main;}
33
34   private slots:
35     void sketchLink();
36     void endSketch();
37
38   protected slots:
39     virtual void deletePort();
40
41   protected:
42     SUPERVGUI_Main*  main;
43     SUPERV_Port      port;
44
45     QPopupMenu*      popup;
46     int              mySketchItem;
47     int              myDelItem;
48     int              browser;
49
50     SALOME_Selection* mySelection;
51
52     QString myName;
53
54   private slots:
55     void showPopup(QMouseEvent* e);
56 };
57
58
59
60
61 class SUPERVGUI_GetValueDlg;
62 class SUPERVGUI_PortIn: public SUPERVGUI_Port {
63   Q_OBJECT
64
65   public:
66     SUPERVGUI_PortIn(QWidget* parent, SUPERVGUI_Main* m, SUPERV_Port p);
67     virtual ~SUPERVGUI_PortIn();
68
69     bool eventFilter( QObject* o, QEvent* e );
70
71     void sync();
72     void setValue(const char* id);
73     virtual QPoint getConnectPnt();
74
75     void setLinkPrs(SUPERVGUI_Link* theLink);
76
77     SUPERVGUI_Link* getLinkPrs()
78       { return myLinkPrs; };
79
80     void deleteLinks();
81
82   private slots:
83     void setInput();
84     void browse();
85     void onDeleteLink(SUPERVGUI_Link*);
86
87
88   private:
89     int   psd;
90     int   psc;
91     SUPERVGUI_Link*        myLinkPrs;
92     SUPERVGUI_GetValueDlg* myDlg;
93 };
94
95
96
97
98
99 class SUPERVGUI_PortOut: public SUPERVGUI_Port {
100   Q_OBJECT
101
102   public:
103     SUPERVGUI_PortOut(QWidget* parent, SUPERVGUI_Main* m, SUPERV_Port p);
104     virtual ~SUPERVGUI_PortOut();
105
106     void sync();
107     void updateStudy();
108     bool isInStudy() { return study; };
109     void setStudyState(bool theIsInStudy) { study = theIsInStudy; };
110     virtual QPoint getConnectPnt();
111
112     void addLinkPrs(SUPERVGUI_Link* theLink);
113
114     SUPERVGUI_Link* getLinkPrs(int theNum) 
115       { return myLinksList.at(theNum); };
116
117     int getLinkPrsCount()
118       { return myLinksList.count(); };
119
120     void deleteLinks();
121
122   private slots:
123     void toStudy();
124     void browse();
125
126     void sketch(QMouseEvent* e);
127     void onDeleteLink(SUPERVGUI_Link*);
128
129
130   private:
131     int  pls;
132     bool study;
133     QPtrList<SUPERVGUI_Link> myLinksList;
134 };
135
136
137 class SUPERVGUI_PortInESNode: public SUPERVGUI_Port {
138   Q_OBJECT
139
140   public:
141     SUPERVGUI_PortInESNode(QWidget* parent, SUPERVGUI_Main* m, SUPERV_Port p);
142     virtual ~SUPERVGUI_PortInESNode();
143
144     bool eventFilter( QObject* o, QEvent* e );    
145
146     void sync();
147     void setValue(const char* id);
148     virtual QPoint getConnectPnt();
149
150     void setLinkPrs(SUPERVGUI_Link* theLink);
151     
152     SUPERVGUI_Link* getLinkPrs(int theNum) 
153       { return myLinksList.at(theNum); };
154
155     int getLinkPrsCount()
156       { return myLinksList.count(); };
157
158     void deleteLinks();
159
160
161   private slots:
162     void setInput();
163     void browse();
164     void onDeleteLink(SUPERVGUI_Link*);
165
166
167   private:
168 //    int   psd;
169     int   psc;
170     QPtrList<SUPERVGUI_Link> myLinksList;
171     SUPERVGUI_GetValueDlg* myDlg;
172
173 };
174 #endif