Salome HOME
Remove dublicate "Canvas Table" menu item from dataflow view popup menu.
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_CanvasControlNode.h
1 //  SUPERV SUPERVGUI : GUI for Supervisor component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE
4 //
5 //  File   : SUPERVGUI_CanvasControlNode.h
6 //  Author : Natalia KOPNOVA
7 //  Module : SUPERV
8
9 #ifndef SUPERVGUI_CanvasControlNode_H
10 #define SUPERVGUI_CanvasControlNode_H
11
12 using namespace std;
13 #include "SUPERVGUI_Def.h"
14 #include "SUPERVGUI_CanvasNode.h"
15 #include <qdialog.h>
16 #include <qcombobox.h>
17
18 class SUPERVGUI_CanvasComputeNode : public SUPERVGUI_CanvasNode {
19   Q_OBJECT
20
21   public:
22     SUPERVGUI_CanvasComputeNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
23     virtual ~SUPERVGUI_CanvasComputeNode() {}
24
25     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
26 };
27
28 class SUPERVGUI_CanvasMacroNode : public SUPERVGUI_CanvasComputeNode {
29   Q_OBJECT
30
31   public:
32     SUPERVGUI_CanvasMacroNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
33     virtual ~SUPERVGUI_CanvasMacroNode() {}
34
35     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
36
37   public slots:
38     void openSubGraph();
39     void exportDataflow();
40
41   protected:
42     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
43 };
44
45
46 class SUPERVGUI_CanvasEndNode;
47 class SUPERVGUI_CanvasStartNode : public SUPERVGUI_CanvasNode {
48   Q_OBJECT
49
50   public:
51     SUPERVGUI_CanvasStartNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
52     virtual ~SUPERVGUI_CanvasStartNode() {}
53
54     virtual bool setNodeName(QString aName);
55
56     SUPERVGUI_CanvasEndNode* getCoupled() const { return myCoupled; }
57
58     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
59
60   public slots:
61     virtual void remove();
62
63     virtual void addInputPort();
64     virtual void addOutputPort();
65
66   protected:
67     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
68
69   protected slots:
70     virtual void onDestroyed(QObject*);
71
72   private:
73     friend class SUPERVGUI_CanvasEndNode;
74     void setCoupled(SUPERVGUI_CanvasEndNode* theEnd) { myCoupled = theEnd; }
75
76     SUPERVGUI_CanvasEndNode* myCoupled;
77
78 };
79
80
81 class SUPERVGUI_CanvasEndNode : public SUPERVGUI_CanvasNode {
82   Q_OBJECT
83
84   public:
85     SUPERVGUI_CanvasEndNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
86                             SUPERVGUI_CanvasStartNode* theStart);
87     virtual ~SUPERVGUI_CanvasEndNode() {}
88
89     SUPERVGUI_CanvasStartNode* getCoupled() const { return myCoupled; }
90
91     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
92
93   public slots:
94     virtual void addInputPort();
95
96   protected:
97     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
98
99   private:
100     SUPERVGUI_CanvasStartNode* myCoupled;
101
102 };
103
104
105 class SUPERVGUI_CanvasGotoNode : public SUPERVGUI_CanvasNode {
106   Q_OBJECT
107
108   public:
109     SUPERVGUI_CanvasGotoNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
110     virtual ~SUPERVGUI_CanvasGotoNode() {}
111
112     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
113
114   public slots:
115     void linkToNode();
116
117   protected:
118     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
119 };
120
121 class SUPERVGUI_CanvasCellNode : public SUPERVGUI_CanvasNode {
122   Q_OBJECT
123
124   public:
125     SUPERVGUI_CanvasCellNode(QObject* theParent, 
126                              SUPERVGUI_Main* theMain, 
127                              SUPERV_CNode theNode);
128     virtual ~SUPERVGUI_CanvasCellNode() {}
129
130     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
131
132     void setPairCell(SUPERVGUI_CanvasCellNode* thePairCell);
133     SUPERVGUI_CanvasCellNode* getPairCell();
134
135      virtual void sync();
136      //virtual bool setNodeName(QString aName);
137
138   protected:
139     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
140
141  protected:
142     SUPERVGUI_CanvasCellNode*  myPairCell;  //for ControlNodes
143
144  private:
145     bool        myIsControl;
146     bool        myIsStart;
147
148 };
149
150 class SUPERVGUI_CanvasCellEndNode: public SUPERVGUI_CanvasCellNode {
151  
152   public:
153     SUPERVGUI_CanvasCellEndNode(QObject* theParent, 
154                                 SUPERVGUI_Main* theMain, 
155                                 SUPERV_CNode theNode, 
156                                 SUPERVGUI_CanvasCellNode* theStart);
157     virtual ~SUPERVGUI_CanvasCellEndNode() {}
158 };
159
160 /** 
161  * Taken from SUPERVGUI_ControlNode.h without change
162  */
163 class SUPERVGUI_SelectInlineDlg:  public QDialog {
164   Q_OBJECT
165
166  public:
167   SUPERVGUI_SelectInlineDlg(SUPERVGUI_Main* theMain);
168   virtual ~SUPERVGUI_SelectInlineDlg() {};
169
170   QString getName() { return myCombo->currentText(); }
171
172  private:
173   QComboBox* myCombo;
174 };
175
176
177 #endif