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 SUPERVGUI_CanvasNode( SUIT_ResourceMgr*, QObject*, SUPERVGUI_Main*, SUPERV_CNode theNode, bool theIsCell=false);
45 virtual ~SUPERVGUI_CanvasNode();
47 // done to ignore port update when node is removed
48 bool isDestroyed() const { return myDestroyed; }
53 virtual void syncOnEvent(SUPERV::GraphState theStateFromEvent);
56 virtual void move(int x, int y);
58 virtual void hideAll();
59 virtual void showAll();
60 virtual bool setNodeName(QString aName);
62 SUPERV_CNode getEngine() const { return myNode; }
63 SUPERVGUI_Main* getMain() const { return myMain; }
64 SUPERVGUI_CanvasNodePrs* getPrs();
71 SUPERV::KindOfNode getNodeType() const { return myNode->Kind(); }
73 SUPERV_CNode getComputingNode() const { return myNode; }
74 SUPERV_FNode getFactoryNode() const { return SUPERV::FNode::_narrow(myNode); }
75 SUPERV_INode getInlineNode() const { return SUPERV::INode::_narrow(myNode); }
76 SUPERV_GNode getGotoNode() const { return SUPERV::GNode::_narrow(myNode); }
77 SUPERV_LNode getLoopNode() const { return SUPERV::LNode::_narrow(myNode); }
78 SUPERV_ELNode getEndLoopNode() const { return SUPERV::ELNode::_narrow(myNode);}
79 SUPERV_SNode getSwitchNode() const { return SUPERV::SNode::_narrow(myNode); }
80 SUPERV_ESNode getEndSwitchNode() const { return SUPERV::ESNode::_narrow(myNode);}
81 SUPERV_Graph getMacroNode() const { return SUPERV::Graph::_narrow(myNode); }
83 SUPERV_Port createInPort();
84 SUPERV_Port createOutPort();
85 QStringList getPortsNamesIN(SUPERV_INode theNode, bool theInputPorts);
87 virtual QPopupMenu* getPopupMenu(QWidget* theParent);
89 QString getLabelText() const { return myLabelText; }
91 virtual QString getToolTipText() const;
94 void objectCreatedDeleted(); // mkr : PAL8237
101 //asv: 13.12.04: ??? --> void configure();
102 //asv: 13.12.04: ??? --> void showPython();
104 virtual void rename();
105 virtual void remove();
107 void changeInformation();
113 void setWarning(bool b);
114 void setStep(bool b);
115 void setTrace(bool b);
116 void setVerbose(bool b);
118 // mkr : IPAL9815 : commented the following code
119 /*virtual void addInputPort();
120 virtual void addOutputPort();*/
121 virtual void editFunction();
122 virtual void pastePort();
127 // redefined by most of CanvasNode successors
128 virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
129 SUIT_ResourceMgr* resMgr() const { return myMgr; }
131 void createPort(SUPERV::Port_ptr thePort);
132 void createStreamPort(SUPERV::StreamPort_ptr thePort);
134 virtual bool eventFilter(QObject* o, QEvent* e);
135 SUPERVGUI_BrowseNodeDlg* myBrowseDlg;
140 virtual void onDestroyed(QObject*);
144 SUPERVGUI_Main* myMain;
147 SUPERVGUI_CanvasNodePrs* myPrs;
148 SUIT_ResourceMgr* myMgr;