Salome HOME
merge from branch DEV tag mergeto_trunk_04apr08
[modules/yacs.git] / src / gui / YACSGui_Node.h
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 // 
4 //  This library is free software; you can redistribute it and/or 
5 //  modify it under the terms of the GNU Lesser General Public 
6 //  License as published by the Free Software Foundation; either 
7 //  version 2.1 of the License. 
8 // 
9 //  This library is distributed in the hope that it will be useful, 
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 //  Lesser General Public License for more details. 
13 // 
14 //  You should have received a copy of the GNU Lesser General Public 
15 //  License along with this library; if not, write to the Free Software 
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 // 
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20
21 #ifndef YACSGui_Node_HeaderFile
22 #define YACSGui_Node_HeaderFile
23
24 #include <YACSGui_Graph.h>
25
26 #include <Node.hxx>
27 #include <guiObservers.hxx>
28
29 class SUIT_ResourceMgr;
30
31 /*! Interface of a driver that creates specific graphic items for some type of 
32  *  graph nodes. It also updates any parameters of existing graphic items
33  *  before they are redrawn by the viewer.
34  *  Drivers for each kind of node should be derived from YACSGui_Node,
35  *  with their own implementation of update() method (it should become
36  *  a pure virtual function in the final version).
37  */
38 class YACSGui_Node
39 {
40  public:
41   YACSGui_Node(YACSGui_Graph*);
42   virtual ~YACSGui_Node();
43
44   virtual void        update(YACS::ENGINE::Node*, YACS::HMI::SubjectComposedNode*, YACSPrs_ElementaryNode*&);
45
46 protected:
47   YACSGui_Graph*      graph() const { return myGraph; }
48   SUIT_ResourceMgr*   resMgr() const;
49
50 private:
51   YACSGui_Graph*      myGraph;
52 };
53
54 /*! Interface of a driver that creates specific graphic items for Service 
55  *  graph nodes. It also updates any parameters of existing graphic items
56  *  before they are redrawn by the viewer.
57  */
58 class YACSGui_ServiceNode : public YACSGui_Node
59 {
60  public:
61   YACSGui_ServiceNode(YACSGui_Graph*);
62   virtual ~YACSGui_ServiceNode();
63
64   virtual void        update(YACS::ENGINE::Node*, YACS::HMI::SubjectComposedNode*, YACSPrs_ElementaryNode*&);
65
66 };
67
68 /*! Interface of a driver that creates specific graphic items for Inline 
69  *  graph nodes. It also updates any parameters of existing graphic items
70  *  before they are redrawn by the viewer.
71  */
72 class YACSGui_InlineNode : public YACSGui_Node
73 {
74  public:
75   YACSGui_InlineNode(YACSGui_Graph*);
76   virtual ~YACSGui_InlineNode();
77
78   virtual void        update(YACS::ENGINE::Node*, YACS::HMI::SubjectComposedNode*, YACSPrs_ElementaryNode*&);
79
80 };
81
82 /*! Interface of a driver that creates specific graphic items for If 
83  *  graph nodes. It also updates any parameters of existing graphic items
84  *  before they are redrawn by the viewer.
85  */
86 class YACSGui_IfNode : public YACSGui_Node
87 {
88  public:
89   YACSGui_IfNode(YACSGui_Graph*);
90   virtual ~YACSGui_IfNode();
91
92   virtual void        update(YACS::ENGINE::Node*, YACS::HMI::SubjectComposedNode*, YACSPrs_ElementaryNode*&);
93
94 };
95
96 /*! Interface of a driver that creates specific graphic items for Switch 
97  *  graph nodes. It also updates any parameters of existing graphic items
98  *  before they are redrawn by the viewer.
99  */
100 class YACSGui_SwitchNode : public YACSGui_Node
101 {
102  public:
103   YACSGui_SwitchNode(YACSGui_Graph*);
104   virtual ~YACSGui_SwitchNode();
105
106   virtual void        update(YACS::ENGINE::Node*, YACS::HMI::SubjectComposedNode*, YACSPrs_ElementaryNode*&);
107
108 };
109
110 /*! Interface of a driver that creates specific graphic items for ForLoop and WhileLoop
111  *  graph nodes. It also updates any parameters of existing graphic items
112  *  before they are redrawn by the viewer.
113  */
114 class YACSGui_LoopNode : public YACSGui_Node
115 {
116  public:
117   YACSGui_LoopNode(YACSGui_Graph*);
118   virtual ~YACSGui_LoopNode();
119
120   virtual void        update(YACS::ENGINE::Node*, YACS::HMI::SubjectComposedNode*, YACSPrs_ElementaryNode*&);
121
122 };
123
124 /*! Interface of a driver that creates specific graphic items for ForEachLoop
125  *  graph nodes. It also updates any parameters of existing graphic items
126  *  before they are redrawn by the viewer.
127  */
128 class YACSGui_ForEachLoopNode : public YACSGui_Node
129 {
130  public:
131   YACSGui_ForEachLoopNode(YACSGui_Graph*);
132   virtual ~YACSGui_ForEachLoopNode();
133
134   virtual void        update(YACS::ENGINE::Node*, YACS::HMI::SubjectComposedNode*, YACSPrs_ElementaryNode*&);
135
136 };
137
138 /*! Interface of a driver that creates specific graphic items for Bloc
139  *  graph nodes. It also updates any parameters of existing graphic items
140  *  before they are redrawn by the viewer.
141  */
142 class YACSGui_BlocNode : public YACSGui_Node
143 {
144  public:
145   YACSGui_BlocNode(YACSGui_Graph*);
146   virtual ~YACSGui_BlocNode();
147
148   virtual void        update(YACS::ENGINE::Node*, YACS::HMI::SubjectComposedNode*, YACSPrs_ElementaryNode*&);
149
150   int level(YACS::ENGINE::Node* theEngine);
151 };
152
153 #endif