Salome HOME
Add functionality for Table view based on QCanvas.
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_ControlNode.h
1 //  SUPERV SUPERVGUI : GUI for Supervisor component
2 //
3 //  Copyright (C) 2003  CEA/DEN, EDF R&D
4 //
5 //
6 //
7 //  File   : SUPERVGUI_ControlNode.h
8 //  Author : Vitaly SMETANNIKOV
9 //  Module : SUPERV
10
11 #ifndef SUPERVGUI_ControlNode_H
12 #define SUPERVGUI_ControlNode_H
13
14 #include "SUPERVGUI_GraphNode.h"
15 #include <qlayout.h>
16 #include <qdialog.h>
17 #include <qcombobox.h>
18
19
20 class SUPERVGUI_EndControlNode;
21
22
23 /**
24  * Start node of Switch and Loop
25  */
26 class SUPERVGUI_StartControlNode: public SUPERVGUI_GraphNode {
27   Q_OBJECT
28
29  public:
30   SUPERVGUI_StartControlNode(QWidget* theParent, SUPERVGUI_Main* theMain, 
31                              SUPERV_CNode theNode);
32   virtual ~SUPERVGUI_StartControlNode() {};
33
34   virtual void hideAll();
35   virtual void showAll();
36   virtual void updateShape();
37   virtual void deletePort(SUPERVGUI_Port* thePort);
38
39   void setEndNode(SUPERVGUI_EndControlNode* theEndNode);
40   SUPERVGUI_EndControlNode* getEndNode();
41
42   virtual QPoint getOutConnectPnt();
43
44  public slots:
45   void switchPorts();
46   virtual void rename();
47   virtual void remove();
48   virtual void addInputPort();
49   virtual void addOutputPort();
50
51  private:
52   void setShape();
53
54   SUPERVGUI_EndControlNode* myEndNode;
55   int myPortsItem;
56 };
57
58
59
60
61 /**
62  * End node of Switch and Loop
63  */
64 class SUPERVGUI_EndControlNode: public SUPERVGUI_GraphNode {
65   Q_OBJECT
66
67  public:
68   SUPERVGUI_EndControlNode(QWidget* theParent, SUPERVGUI_Main* theMain, 
69                              SUPERV_CNode theNode, SUPERVGUI_StartControlNode* theStart);
70   virtual ~SUPERVGUI_EndControlNode() {};
71
72   virtual void hideAll();
73   virtual void showAll();
74   virtual void updateShape();
75
76   virtual QPoint getInConnectPnt();
77
78  public slots:
79   void switchPorts();
80
81  private:
82   void setShape();
83
84   SUPERVGUI_StartControlNode* myStartNode;
85   int myPortsItem;
86 };
87
88
89 class SUPERVGUI_SelectInlineDlg:  public QDialog {
90   Q_OBJECT
91
92  public:
93   SUPERVGUI_SelectInlineDlg(SUPERVGUI_Main* theMain);
94   virtual ~SUPERVGUI_SelectInlineDlg() {};
95
96   QString getName() { return myCombo->currentText(); }
97
98  private:
99   QComboBox* myCombo;
100 };
101
102
103 /**
104  * GOTO node
105  */
106 class SUPERVGUI_GotoNode: public SUPERVGUI_GraphNode {
107   Q_OBJECT
108
109  public:
110   SUPERVGUI_GotoNode(QWidget* theParent, SUPERVGUI_Main* theMain, 
111                              SUPERV_CNode theNode);
112   virtual ~SUPERVGUI_GotoNode() {};
113
114   virtual void hideAll();
115   virtual void showAll();
116   virtual void updateShape();
117
118   void setLinkedNode(char* theNodeName);
119
120  public slots:
121    void linkToNode();
122
123  private:
124   void setShape();
125   
126   
127 };
128
129
130 #endif