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_Node.h
25 // Author : Francis KLOSS
28 #ifndef SUPERVGUI_Node_H
29 #define SUPERVGUI_Node_H
32 #include "SUPERVGUI_Def.h"
33 #include "SUPERVGUI_Label.h"
35 #include "SUPERVGUI_BrowseNodeDlg.h"
36 #include <qcombobox.h>
37 #include "SUPERVGUI_Port.h"
38 #include <qstringlist.h>
42 class SUPERVGUI_Node: public QFrame {
46 SUPERVGUI_Node(QWidget* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
47 virtual ~SUPERVGUI_Node();
49 bool eventFilter( QObject* o, QEvent* e );
51 void syncOnEvent(SUPERV::GraphState theStateFromEvent);
53 virtual void hideAll()=0;
54 virtual void showAll()=0;
55 virtual void deleteLinks() {};
56 virtual void setNodeName(QString aName);
58 SUPERV_CNode getEngine()
61 SUPERVGUI_Main* getMain()
69 SUPERV::KindOfNode getNodeType()
70 { return myNode->Kind(); }
72 SUPERV_CNode getComputingNode()
75 SUPERV_FNode getFactoryNode()
76 { return SUPERV::FNode::_narrow(myNode); }
78 SUPERV_INode getInlineNode()
79 { return SUPERV::INode::_narrow(myNode); }
81 SUPERV_GNode getGotoNode()
82 { return SUPERV::GNode::_narrow(myNode); }
84 SUPERV_LNode getLoopNode()
85 { return SUPERV::LNode::_narrow(myNode); }
87 SUPERV_ELNode getEndLoopNode()
88 { return SUPERV::ELNode::_narrow(myNode); }
90 SUPERV_SNode getSwitchNode()
91 { return SUPERV::SNode::_narrow(myNode); }
93 SUPERV_ESNode getEndSwitchNode()
94 { return SUPERV::ESNode::_narrow(myNode); }
97 SUPERV_Port createInPort();
98 SUPERV_Port createOutPort();
99 QStringList getPortsNamesIN(SUPERV_INode theNode, bool theInputPorts);
102 void mousePressEvent(QMouseEvent* e);
105 void suspendResume();
111 virtual void rename();
112 virtual void remove();
113 void changeInformation();
116 void setWarning(bool b);
117 void setStep(bool b);
118 void setTrace(bool b);
119 void setVerbose(bool b);
120 void showPopup(QMouseEvent* e);
122 virtual void addInputPort();
123 virtual void addOutputPort();
124 virtual void editFunction();
127 virtual void setState(SUPERV::GraphState theState);
130 SUPERVGUI_Main* myMain;
132 //SUPERVGUI_Label* myTitle;
133 SUPERVGUI_Label* myTime;
134 SUPERVGUI_Label* myStatus;
137 QPopupMenu* myRunPopup;
145 SUPERVGUI_BrowseNodeDlg* aBrowseDlg;
159 * Port parameters dialog definition
161 class SUPERVGUI_PortParamsDlg: public QDialog {
165 SUPERVGUI_PortParamsDlg(const QStringList& thePortsNames);
166 ~SUPERVGUI_PortParamsDlg() {};
168 QString getName() { return myNameTxt->text(); }
169 QString getType() { return myTypeTxt->currentText(); }
176 QLineEdit* myNameTxt;
177 QComboBox* myTypeTxt;
178 QStringList myPortsNames;