1 # Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 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 # Generated python file of Graph GraphLoop2
26 # Graph creation of GraphLoop2
28 GraphLoop2 = Graph( 'GraphLoop2' )
29 GraphLoop2.SetName( 'GraphLoop2' )
30 GraphLoop2.SetAuthor( '' )
31 GraphLoop2.SetComment( '' )
32 GraphLoop2.Coords( 0 , 0 )
34 # Creation of Factory Nodes
36 # Creation of InLine Nodes
38 NodeIndex = GraphLoop2.INode( '' , PyNodeIndex )
39 NodeIndex.SetName( 'NodeIndex' )
40 NodeIndex.SetAuthor( '' )
41 NodeIndex.SetComment( 'Compute Node' )
42 NodeIndex.Coords( 281 , 215 )
43 INodeIndexIndex = NodeIndex.InPort( 'Index' , 'long' )
44 INodeIndexGate = NodeIndex.GetInPort( 'Gate' )
45 ONodeIndexIndex = NodeIndex.OutPort( 'Index' , 'long' )
46 ONodeIndexGate = NodeIndex.GetOutPort( 'Gate' )
49 NodeIncr = GraphLoop2.INode( '' , PyNodeIncr )
50 NodeIncr.SetName( 'NodeIncr' )
51 NodeIncr.SetAuthor( '' )
52 NodeIncr.SetComment( 'Compute Node' )
53 NodeIncr.Coords( 278 , 372 )
54 INodeIncrIncr = NodeIncr.InPort( 'Incr' , 'long' )
55 INodeIncraString = NodeIncr.InPort( 'aString' , 'string' )
56 INodeIncrGate = NodeIncr.GetInPort( 'Gate' )
57 ONodeIncrIncr = NodeIncr.OutPort( 'Incr' , 'long' )
58 ONodeIncraString = NodeIncr.OutPort( 'aString' , 'string' )
59 ONodeIncrGate = NodeIncr.GetOutPort( 'Gate' )
61 # Creation of Loop Nodes
63 PyInit.append( 'def Init(Index,Min,Max,Incr) : ' )
64 PyInit.append( ' if Min <= Max : ' )
65 PyInit.append( ' Index = Min ' )
66 PyInit.append( ' else : ' )
67 PyInit.append( ' Index = Max ' )
68 PyInit.append( ' return Index,Min,Max,Incr ' )
70 PyMoreInit.append( 'import time ' )
71 PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' )
72 PyMoreInit.append( ' time.sleep(2) ' )
73 PyMoreInit.append( ' if Index < Max : ' )
74 PyMoreInit.append( ' DoLoop = 1 ' )
75 PyMoreInit.append( ' else : ' )
76 PyMoreInit.append( ' DoLoop = 0 ' )
77 PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' )
79 PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' )
80 PyNextInit.append( ' Index = Index + Incr ' )
81 PyNextInit.append( ' return Index,Min,Max,Incr ' )
82 Init,EndInit = GraphLoop2.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
83 EndInit.SetName( 'EndInit' )
84 EndInit.SetAuthor( '' )
85 EndInit.SetComment( 'Compute Node' )
86 EndInit.Coords( 555 , 255 )
88 EndInit.SetPyFunction( '' , PyEndInit )
89 IInitDoLoop = Init.GetInPort( 'DoLoop' )
90 IInitIndex = Init.InPort( 'Index' , 'long' )
91 IInitMin = Init.InPort( 'Min' , 'long' )
92 IInitMax = Init.InPort( 'Max' , 'long' )
93 IInitIncr = Init.InPort( 'Incr' , 'long' )
94 IInitGate = Init.GetInPort( 'Gate' )
95 OInitDoLoop = Init.GetOutPort( 'DoLoop' )
96 OInitIndex = Init.GetOutPort( 'Index' )
97 OInitMin = Init.GetOutPort( 'Min' )
98 OInitMax = Init.GetOutPort( 'Max' )
99 OInitIncr = Init.GetOutPort( 'Incr' )
100 IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
101 IEndInitIndex = EndInit.GetInPort( 'Index' )
102 IEndInitMin = EndInit.GetInPort( 'Min' )
103 IEndInitMax = EndInit.GetInPort( 'Max' )
104 IEndInitIncr = EndInit.GetInPort( 'Incr' )
105 IEndInitGate = EndInit.GetInPort( 'Gate' )
106 OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
107 OEndInitIndex = EndInit.GetOutPort( 'Index' )
108 OEndInitMin = EndInit.GetOutPort( 'Min' )
109 OEndInitMax = EndInit.GetOutPort( 'Max' )
110 OEndInitIncr = EndInit.GetOutPort( 'Incr' )
111 OEndInitGate = EndInit.GetOutPort( 'Gate' )
112 Init.SetName( 'Init' )
114 Init.SetComment( 'Compute Node' )
115 Init.Coords( 17 , 257 )
118 LInitIndexNodeIndexIndex = GraphLoop2.Link( OInitIndex , INodeIndexIndex )
120 LInitMinEndInitMin = GraphLoop2.Link( OInitMin , IEndInitMin )
122 LInitMaxEndInitMax = GraphLoop2.Link( OInitMax , IEndInitMax )
124 LInitIncrNodeIncrIncr = GraphLoop2.Link( OInitIncr , INodeIncrIncr )
126 LNodeIndexIndexEndInitIndex = GraphLoop2.Link( ONodeIndexIndex , IEndInitIndex )
128 LNodeIncrIncrEndInitIncr = GraphLoop2.Link( ONodeIncrIncr , IEndInitIncr )
131 IInitIndex.Input( 0 )
135 INodeIncraString.Input( 'NodeToDelete' )
137 # Output Ports of the graph
138 #OEndInitIndex = EndInit.GetOutPort( 'Index' )
139 #OEndInitMin = EndInit.GetOutPort( 'Min' )
140 #OEndInitMax = EndInit.GetOutPort( 'Max' )
141 #OEndInitIncr = EndInit.GetOutPort( 'Incr' )
142 #ONodeIncraString = NodeIncr.GetOutPort( 'aString' )
146 GraphLoop2 = DefGraphLoop2()