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;}
60 virtual void deletePort();
71 SALOME_Selection* mySelection;
76 virtual void showPopup(QMouseEvent* e);
82 class SUPERVGUI_GetValueDlg;
83 class SUPERVGUI_PortIn: public SUPERVGUI_Port {
87 SUPERVGUI_PortIn(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p);
88 virtual ~SUPERVGUI_PortIn();
90 bool eventFilter( QObject* o, QEvent* e );
93 void setValue(const char* id);
94 virtual QPoint getConnectPnt();
96 void setLinkPrs(SUPERVGUI_Link* theLink);
98 SUPERVGUI_Link* getLinkPrs()
99 { return myLinkPrs; };
106 void onDeleteLink(SUPERVGUI_Link*);
107 virtual void showPopup(QMouseEvent* e);
113 SUPERVGUI_Link* myLinkPrs;
114 SUPERVGUI_GetValueDlg* myDlg;
121 class SUPERVGUI_PortOut: public SUPERVGUI_Port {
125 SUPERVGUI_PortOut(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p);
126 virtual ~SUPERVGUI_PortOut();
130 bool isInStudy() { return study; };
131 void setStudyState(bool theIsInStudy) { study = theIsInStudy; };
132 virtual QPoint getConnectPnt();
134 void addLinkPrs(SUPERVGUI_Link* theLink);
136 SUPERVGUI_Link* getLinkPrs(int theNum)
137 { return myLinksList.at(theNum); };
139 int getLinkPrsCount()
140 { return myLinksList.count(); };
148 void sketch(QMouseEvent* e);
149 void onDeleteLink(SUPERVGUI_Link*);
155 QPtrList<SUPERVGUI_Link> myLinksList;
159 class SUPERVGUI_PortInESNode: public SUPERVGUI_Port {
163 SUPERVGUI_PortInESNode(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p);
164 virtual ~SUPERVGUI_PortInESNode();
166 bool eventFilter( QObject* o, QEvent* e );
169 void setValue(const char* id);
170 virtual QPoint getConnectPnt();
172 void setLinkPrs(SUPERVGUI_Link* theLink);
174 SUPERVGUI_Link* getLinkPrs(int theNum)
175 { return myLinksList.at(theNum); };
177 int getLinkPrsCount()
178 { return myLinksList.count(); };
186 void onDeleteLink(SUPERVGUI_Link*);
192 QPtrList<SUPERVGUI_Link> myLinksList;
193 SUPERVGUI_GetValueDlg* myDlg;
200 class SUPERVGUI_StreamPortIn: public SUPERVGUI_PortIn
204 SUPERVGUI_StreamPortIn(QWidget* parent, SUPERVGUI_Main* m, SUPERV::StreamPort_ptr p);
205 virtual ~SUPERVGUI_StreamPortIn();
208 SUPERV_StreamPort getStreamPort() { return myPort;}
214 SUPERV_StreamPort myPort;
220 class SUPERVGUI_StreamPortOut: public SUPERVGUI_PortOut
224 SUPERVGUI_StreamPortOut(QWidget* parent, SUPERVGUI_Main* m, SUPERV::StreamPort_ptr p);
225 virtual ~SUPERVGUI_StreamPortOut();
228 SUPERV_StreamPort getStreamPort() { return myPort;}
234 SUPERV_StreamPort myPort;