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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SUPERVGUI_CanvasNode.h
23 // Author : Natalia KOPNOVA
26 #ifndef SUPERVGUI_CanvasNode_H
27 #define SUPERVGUI_CanvasNode_H
29 #include "SUPERVGUI_Def.h"
30 #include "SUPERVGUI_BrowseNodeDlg.h"
31 #include <qstringlist.h>
34 class SUPERVGUI_CanvasNodePrs;
35 class SUIT_ResourceMgr;
37 class SUPERVGUI_CanvasNode : public QObject {
38 friend class SUPERVGUI_ManagePortsDlg;
39 friend class SUPERVGUI_Clipboard;
44 virtual ~SUPERVGUI_CanvasNode();
46 // done to ignore port update when node is removed
47 bool isDestroyed() const { return myDestroyed; }
52 virtual void syncOnEvent(SUPERV::GraphState theStateFromEvent);
55 virtual void move(int x, int y);
57 virtual void hideAll();
58 virtual void showAll();
59 virtual bool setNodeName(QString aName);
61 SUPERV_CNode getEngine() const { return myNode; }
62 SUPERVGUI_Main* getMain() const { return myMain; }
63 SUPERVGUI_CanvasNodePrs* getPrs();
70 SUPERV::KindOfNode getNodeType() const { return myNode->Kind(); }
72 SUPERV_CNode getComputingNode() const { return myNode; }
73 SUPERV_FNode getFactoryNode() const { return SUPERV::FNode::_narrow(myNode); }
74 SUPERV_INode getInlineNode() const { return SUPERV::INode::_narrow(myNode); }
75 SUPERV_GNode getGotoNode() const { return SUPERV::GNode::_narrow(myNode); }
76 SUPERV_LNode getLoopNode() const { return SUPERV::LNode::_narrow(myNode); }
77 SUPERV_ELNode getEndLoopNode() const { return SUPERV::ELNode::_narrow(myNode);}
78 SUPERV_SNode getSwitchNode() const { return SUPERV::SNode::_narrow(myNode); }
79 SUPERV_ESNode getEndSwitchNode() const { return SUPERV::ESNode::_narrow(myNode);}
80 SUPERV_Graph getMacroNode() const { return SUPERV::Graph::_narrow(myNode); }
82 SUPERV_Port createInPort();
83 SUPERV_Port createOutPort();
84 QStringList getPortsNamesIN(SUPERV_INode theNode, bool theInputPorts);
86 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
88 QString getLabelText() const { return myLabelText; }
90 virtual QString getToolTipText() const;
93 void objectCreatedDeleted(); // mkr : PAL8237
100 //asv: 13.12.04: ??? --> void configure();
101 //asv: 13.12.04: ??? --> void showPython();
103 virtual void rename();
104 virtual void remove();
106 void changeInformation();
112 void setWarning(bool b);
113 void setStep(bool b);
114 void setTrace(bool b);
115 void setVerbose(bool b);
117 // mkr : IPAL9815 : commented the following code
118 /*virtual void addInputPort();
119 virtual void addOutputPort();*/
120 virtual void editFunction();
121 virtual void pastePort();
126 SUPERVGUI_CanvasNode (SUIT_ResourceMgr*, QObject*, SUPERVGUI_Main*,
127 SUPERV_CNode theNode, bool theIsCell=false);
129 // redefined by most of CanvasNode successors
130 virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
131 SUIT_ResourceMgr* resMgr() const { return myMgr; }
133 void createPort(SUPERV::Port_ptr thePort);
134 void createStreamPort(SUPERV::StreamPort_ptr thePort);
136 virtual bool eventFilter(QObject* o, QEvent* e);
137 SUPERVGUI_BrowseNodeDlg* myBrowseDlg;
142 virtual void onDestroyed(QObject*);
146 SUPERVGUI_Main* myMain;
149 SUPERVGUI_CanvasNodePrs* myPrs;
150 SUIT_ResourceMgr* myMgr;