1 // SUPERV SUPERVGUI : GUI for Supervisor component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SUPERVGUI_Port.h
25 // Author : Francis KLOSS
28 #ifndef SUPERVGUI_Port_H
29 #define SUPERVGUI_Port_H
31 //#include "SUPERVGUI_Point.h"
32 #include "SUPERVGUI_Label.h"
33 #include "SUPERVGUI_Def.h"
34 #include "SALOME_Selection.h"
39 class SUPERVGUI_Port: public SUPERVGUI_Label {
43 SUPERVGUI_Port(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p);
44 virtual ~SUPERVGUI_Port();
46 SUPERV_Port getPort();
48 virtual QPoint getConnectPnt();
49 virtual void deleteLinks() = 0;
52 SUPERVGUI_Main* getMain() { return main;}
59 virtual void deletePort();
70 SALOME_Selection* mySelection;
75 void showPopup(QMouseEvent* e);
81 class SUPERVGUI_GetValueDlg;
82 class SUPERVGUI_PortIn: public SUPERVGUI_Port {
86 SUPERVGUI_PortIn(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p);
87 virtual ~SUPERVGUI_PortIn();
89 bool eventFilter( QObject* o, QEvent* e );
92 void setValue(const char* id);
93 virtual QPoint getConnectPnt();
95 void setLinkPrs(SUPERVGUI_Link* theLink);
97 SUPERVGUI_Link* getLinkPrs()
98 { return myLinkPrs; };
105 void onDeleteLink(SUPERVGUI_Link*);
111 SUPERVGUI_Link* myLinkPrs;
112 SUPERVGUI_GetValueDlg* myDlg;
119 class SUPERVGUI_PortOut: public SUPERVGUI_Port {
123 SUPERVGUI_PortOut(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p);
124 virtual ~SUPERVGUI_PortOut();
128 bool isInStudy() { return study; };
129 void setStudyState(bool theIsInStudy) { study = theIsInStudy; };
130 virtual QPoint getConnectPnt();
132 void addLinkPrs(SUPERVGUI_Link* theLink);
134 SUPERVGUI_Link* getLinkPrs(int theNum)
135 { return myLinksList.at(theNum); };
137 int getLinkPrsCount()
138 { return myLinksList.count(); };
146 void sketch(QMouseEvent* e);
147 void onDeleteLink(SUPERVGUI_Link*);
153 QPtrList<SUPERVGUI_Link> myLinksList;
157 class SUPERVGUI_PortInESNode: public SUPERVGUI_Port {
161 SUPERVGUI_PortInESNode(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p);
162 virtual ~SUPERVGUI_PortInESNode();
164 bool eventFilter( QObject* o, QEvent* e );
167 void setValue(const char* id);
168 virtual QPoint getConnectPnt();
170 void setLinkPrs(SUPERVGUI_Link* theLink);
172 SUPERVGUI_Link* getLinkPrs(int theNum)
173 { return myLinksList.at(theNum); };
175 int getLinkPrsCount()
176 { return myLinksList.count(); };
184 void onDeleteLink(SUPERVGUI_Link*);
190 QPtrList<SUPERVGUI_Link> myLinksList;
191 SUPERVGUI_GetValueDlg* myDlg;
201 //****************************************************************
203 class SUPERVGUI_StreamPortIn: public SUPERVGUI_PortIn
207 SUPERVGUI_StreamPortIn(QWidget* parent, SUPERVGUI_Main* m, SUPERV::StreamPort_ptr p);
208 virtual ~SUPERVGUI_StreamPortIn();
211 SUPERV_StreamPort getStreamPort() { return myPort;}
214 SUPERV_StreamPort myPort;
218 //**************************************************************
219 class SUPERVGUI_StreamPortOut: public SUPERVGUI_PortOut
223 SUPERVGUI_StreamPortOut(QWidget* parent, SUPERVGUI_Main* m, SUPERV::StreamPort_ptr p);
224 virtual ~SUPERVGUI_StreamPortOut();
227 SUPERV_StreamPort getStreamPort() { return myPort;}
230 SUPERV_StreamPort myPort;