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;
20 class SUPERVGUI_CanvasNode : public QObject {
21 friend class SUPERVGUI_ManagePortsDlg;
26 SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell=false);
27 virtual ~SUPERVGUI_CanvasNode();
29 // done to ignore port update when node is removed
30 bool isDestroyed() const { return myDestroyed; }
35 virtual void syncOnEvent(SUPERV::GraphState theStateFromEvent);
38 virtual void move(int x, int y);
40 virtual void hideAll();
41 virtual void showAll();
42 virtual bool setNodeName(QString aName);
44 SUPERV_CNode getEngine() const { return myNode; }
45 SUPERVGUI_Main* getMain() const { return myMain; }
46 SUPERVGUI_CanvasNodePrs* getPrs() const;
53 SUPERV::KindOfNode getNodeType() const { return myNode->Kind(); }
55 SUPERV_CNode getComputingNode() const { return myNode; }
56 SUPERV_FNode getFactoryNode() const { return SUPERV::FNode::_narrow(myNode); }
57 SUPERV_INode getInlineNode() const { return SUPERV::INode::_narrow(myNode); }
58 SUPERV_GNode getGotoNode() const { return SUPERV::GNode::_narrow(myNode); }
59 SUPERV_LNode getLoopNode() const { return SUPERV::LNode::_narrow(myNode); }
60 SUPERV_ELNode getEndLoopNode() const { return SUPERV::ELNode::_narrow(myNode); }
61 SUPERV_SNode getSwitchNode() const { return SUPERV::SNode::_narrow(myNode); }
62 SUPERV_ESNode getEndSwitchNode() const { return SUPERV::ESNode::_narrow(myNode); }
63 SUPERV_Graph getMacroNode() const { return SUPERV::Graph::_narrow(myNode); }
65 SUPERV_Port createInPort();
66 SUPERV_Port createOutPort();
67 QStringList getPortsNamesIN(SUPERV_INode theNode, bool theInputPorts);
69 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
71 QString getLabelText() const { return myLabelText; }
80 virtual void rename();
81 virtual void remove();
82 void changeInformation();
88 void setWarning(bool b);
90 void setTrace(bool b);
91 void setVerbose(bool b);
93 virtual void addInputPort();
94 virtual void addOutputPort();
95 virtual void editFunction();
99 virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
100 virtual void createPort(SUPERV::Port_ptr thePort) const;
101 virtual void createStreamPort(SUPERV::StreamPort_ptr thePort) const;
103 virtual bool eventFilter(QObject* o, QEvent* e);
104 SUPERVGUI_BrowseNodeDlg* myBrowseDlg;
110 virtual void onDestroyed(QObject*);
114 SUPERVGUI_Main* myMain;
117 SUPERVGUI_CanvasNodePrs* myPrs;