Salome HOME
Merge from OCC_development_generic_2006
[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 #include "SUPERVGUI_Def.h"
13 #include "SUPERVGUI_CanvasNode.h"
14 #include <qdialog.h>
15 #include <qcombobox.h>
16
17 class SUPERVGUI_CanvasComputeNode : public SUPERVGUI_CanvasNode {
18   Q_OBJECT
19
20   public:
21     SUPERVGUI_CanvasComputeNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
22     virtual ~SUPERVGUI_CanvasComputeNode() {}
23
24     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
25 };
26
27 class SUPERVGUI_CanvasMacroNode : public SUPERVGUI_CanvasComputeNode {
28   Q_OBJECT
29
30   public:
31     SUPERVGUI_CanvasMacroNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
32     virtual ~SUPERVGUI_CanvasMacroNode() {}
33
34     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
35
36   public slots:
37     void openSubGraph();
38     void exportDataflow();
39
40   protected:
41     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
42 };
43
44
45 class SUPERVGUI_CanvasEndNode;
46 class SUPERVGUI_CanvasStartNode : public SUPERVGUI_CanvasNode {
47   Q_OBJECT
48
49   public:
50     SUPERVGUI_CanvasStartNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
51     virtual ~SUPERVGUI_CanvasStartNode() {}
52
53     virtual bool setNodeName(QString aName);
54
55     SUPERVGUI_CanvasEndNode* getCoupled() const { return myCoupled; }
56     
57     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
58
59   public slots:
60     virtual void remove();
61
62     // mkr : IPAL9815 : commented the following code
63     /*virtual void addInputPort();
64       virtual void addOutputPort();*/
65     virtual void pastePort();
66
67   protected:
68     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
69
70   protected slots:
71     virtual void onDestroyed(QObject*);
72
73   private:
74     friend class SUPERVGUI_CanvasEndNode;
75     void setCoupled(SUPERVGUI_CanvasEndNode* theEnd) { myCoupled = theEnd; }
76
77     SUPERVGUI_CanvasEndNode* myCoupled;
78
79 };
80
81
82 class SUPERVGUI_CanvasEndNode : public SUPERVGUI_CanvasNode {
83   Q_OBJECT
84
85   public:
86     SUPERVGUI_CanvasEndNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
87                              SUPERVGUI_CanvasStartNode* theStart);
88     virtual ~SUPERVGUI_CanvasEndNode() {}
89
90     SUPERVGUI_CanvasStartNode* getCoupled() const { return myCoupled; }
91
92     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
93
94   // mkr : IPAL9815 : commented the following code
95   /*public slots:
96     virtual void addInputPort();*/
97
98   protected:
99     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
100
101   private:
102     SUPERVGUI_CanvasStartNode* myCoupled;
103
104 };
105
106
107 class SUPERVGUI_CanvasGotoNode : public SUPERVGUI_CanvasNode {
108   Q_OBJECT
109
110   public:
111     SUPERVGUI_CanvasGotoNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
112     virtual ~SUPERVGUI_CanvasGotoNode() {}
113
114     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
115
116   public slots:
117     void linkToNode();
118
119   protected:
120     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
121 };
122
123 class SUPERVGUI_CanvasCellNode : public SUPERVGUI_CanvasNode {
124   Q_OBJECT
125
126   public:
127     SUPERVGUI_CanvasCellNode( SUIT_ResourceMgr*, QObject* theParent, 
128                               SUPERVGUI_Main* theMain, 
129                               SUPERV_CNode theNode);
130     virtual ~SUPERVGUI_CanvasCellNode();
131
132     // asv : 26.01.05 : everything moved to CanvasNode::getPopupMenu()
133     //virtual QPopupMenu* getPopupMenu(QWidget* theParent);
134
135     void setPairCell(SUPERVGUI_CanvasCellNode* thePairCell);
136     SUPERVGUI_CanvasCellNode* getPairCell();
137
138      virtual void sync();
139
140      // asv : 26.01.05 : decided to remove all "edition" operations on nodes in Table view
141      //virtual bool setNodeName(QString aName);
142
143   protected:
144     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
145
146  protected:
147     SUPERVGUI_CanvasCellNode*  myPairCell;  //for ControlNodes
148
149  private:
150     bool        myIsControl;
151     bool        myIsStart;
152
153 };
154
155 class SUPERVGUI_CanvasCellEndNode: public SUPERVGUI_CanvasCellNode {
156  
157   public:
158     SUPERVGUI_CanvasCellEndNode( SUIT_ResourceMgr*, QObject* theParent, 
159                                  SUPERVGUI_Main* theMain, 
160                                  SUPERV_CNode theNode, 
161                                  SUPERVGUI_CanvasCellNode* theStart);
162     virtual ~SUPERVGUI_CanvasCellEndNode() {}
163
164      // asv : 26.01.05 : decided to remove all "edition" operations on nodes in Table view
165      //virtual bool setNodeName(QString theName);
166 };
167
168 /** 
169  * Taken from SUPERVGUI_ControlNode.h without change
170  */
171 class SUPERVGUI_SelectInlineDlg:  public QDialog {
172   Q_OBJECT
173
174  public:
175   SUPERVGUI_SelectInlineDlg(SUPERVGUI_Main* theMain);
176   virtual ~SUPERVGUI_SelectInlineDlg() {};
177
178   QString getName() { return myCombo->currentText(); }
179
180  private:
181   QComboBox* myCombo;
182 };
183
184
185 #endif