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;
22 friend class SUPERVGUI_Clipboard;
27 SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell=false);
28 virtual ~SUPERVGUI_CanvasNode();
30 // done to ignore port update when node is removed
31 bool isDestroyed() const { return myDestroyed; }
36 virtual void syncOnEvent(SUPERV::GraphState theStateFromEvent);
39 virtual void move(int x, int y);
41 virtual void hideAll();
42 virtual void showAll();
43 virtual bool setNodeName(QString aName);
45 SUPERV_CNode getEngine() const { return myNode; }
46 SUPERVGUI_Main* getMain() const { return myMain; }
47 SUPERVGUI_CanvasNodePrs* getPrs();
54 SUPERV::KindOfNode getNodeType() const { return myNode->Kind(); }
56 SUPERV_CNode getComputingNode() const { return myNode; }
57 SUPERV_FNode getFactoryNode() const { return SUPERV::FNode::_narrow(myNode); }
58 SUPERV_INode getInlineNode() const { return SUPERV::INode::_narrow(myNode); }
59 SUPERV_GNode getGotoNode() const { return SUPERV::GNode::_narrow(myNode); }
60 SUPERV_LNode getLoopNode() const { return SUPERV::LNode::_narrow(myNode); }
61 SUPERV_ELNode getEndLoopNode() const { return SUPERV::ELNode::_narrow(myNode);}
62 SUPERV_SNode getSwitchNode() const { return SUPERV::SNode::_narrow(myNode); }
63 SUPERV_ESNode getEndSwitchNode() const { return SUPERV::ESNode::_narrow(myNode);}
64 SUPERV_Graph getMacroNode() const { return SUPERV::Graph::_narrow(myNode); }
66 SUPERV_Port createInPort();
67 SUPERV_Port createOutPort();
68 QStringList getPortsNamesIN(SUPERV_INode theNode, bool theInputPorts);
70 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
72 QString getLabelText() const { return myLabelText; }
79 //asv: 13.12.04: ??? --> void configure();
80 //asv: 13.12.04: ??? --> void showPython();
82 virtual void rename();
83 virtual void remove();
85 void changeInformation();
91 void setWarning(bool b);
93 void setTrace(bool b);
94 void setVerbose(bool b);
96 virtual void addInputPort();
97 virtual void addOutputPort();
98 virtual void editFunction();
99 virtual void pastePort();
104 // redefined by most of CanvasNode successors
105 virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
107 void createPort(SUPERV::Port_ptr thePort);
108 void createStreamPort(SUPERV::StreamPort_ptr thePort);
110 virtual bool eventFilter(QObject* o, QEvent* e);
111 SUPERVGUI_BrowseNodeDlg* myBrowseDlg;
116 virtual void onDestroyed(QObject*);
120 SUPERVGUI_Main* myMain;
123 SUPERVGUI_CanvasNodePrs* myPrs;