1 // SUPERV SUPERVGUI : GUI for Supervisor component
3 // Copyright (C) 2003 OPEN CASCADE
5 // File : SUPERVGUI_CanvasNode.h
6 // Author : Natalia KOPNOVA
9 #ifndef SUPERVGUI_CanvasNode_H
10 #define SUPERVGUI_CanvasNode_H
13 #include "SUPERVGUI_Def.h"
14 #include "SUPERVGUI_BrowseNodeDlg.h"
15 #include <qstringlist.h>
18 class SUPERVGUI_CanvasNodePrs;
19 class SUIT_ResourceMgr;
21 class SUPERVGUI_CanvasNode : public QObject {
22 friend class SUPERVGUI_ManagePortsDlg;
23 friend class SUPERVGUI_Clipboard;
28 SUPERVGUI_CanvasNode( SUIT_ResourceMgr*, QObject*, SUPERVGUI_Main*, SUPERV_CNode theNode, bool theIsCell=false);
29 virtual ~SUPERVGUI_CanvasNode();
31 // done to ignore port update when node is removed
32 bool isDestroyed() const { return myDestroyed; }
37 virtual void syncOnEvent(SUPERV::GraphState theStateFromEvent);
40 virtual void move(int x, int y);
42 virtual void hideAll();
43 virtual void showAll();
44 virtual bool setNodeName(QString aName);
46 SUPERV_CNode getEngine() const { return myNode; }
47 SUPERVGUI_Main* getMain() const { return myMain; }
48 SUPERVGUI_CanvasNodePrs* getPrs();
55 SUPERV::KindOfNode getNodeType() const { return myNode->Kind(); }
57 SUPERV_CNode getComputingNode() const { return myNode; }
58 SUPERV_FNode getFactoryNode() const { return SUPERV::FNode::_narrow(myNode); }
59 SUPERV_INode getInlineNode() const { return SUPERV::INode::_narrow(myNode); }
60 SUPERV_GNode getGotoNode() const { return SUPERV::GNode::_narrow(myNode); }
61 SUPERV_LNode getLoopNode() const { return SUPERV::LNode::_narrow(myNode); }
62 SUPERV_ELNode getEndLoopNode() const { return SUPERV::ELNode::_narrow(myNode);}
63 SUPERV_SNode getSwitchNode() const { return SUPERV::SNode::_narrow(myNode); }
64 SUPERV_ESNode getEndSwitchNode() const { return SUPERV::ESNode::_narrow(myNode);}
65 SUPERV_Graph getMacroNode() const { return SUPERV::Graph::_narrow(myNode); }
67 SUPERV_Port createInPort();
68 SUPERV_Port createOutPort();
69 QStringList getPortsNamesIN(SUPERV_INode theNode, bool theInputPorts);
71 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
73 QString getLabelText() const { return myLabelText; }
80 //asv: 13.12.04: ??? --> void configure();
81 //asv: 13.12.04: ??? --> void showPython();
83 virtual void rename();
84 virtual void remove();
86 void changeInformation();
92 void setWarning(bool b);
94 void setTrace(bool b);
95 void setVerbose(bool b);
97 // mkr : IPAL9815 : commented the following code
98 /*virtual void addInputPort();
99 virtual void addOutputPort();*/
100 virtual void editFunction();
101 virtual void pastePort();
106 // redefined by most of CanvasNode successors
107 virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
108 SUIT_ResourceMgr* resMgr() const { return myMgr; }
110 void createPort(SUPERV::Port_ptr thePort);
111 void createStreamPort(SUPERV::StreamPort_ptr thePort);
113 virtual bool eventFilter(QObject* o, QEvent* e);
114 SUPERVGUI_BrowseNodeDlg* myBrowseDlg;
119 virtual void onDestroyed(QObject*);
123 SUPERVGUI_Main* myMain;
126 SUPERVGUI_CanvasNodePrs* myPrs;
127 SUIT_ResourceMgr* myMgr;