1 # Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/
20 # Generated python file of Graph GraphGeom2Essai
29 geom = lcc.FindOrLoadComponent("FactoryServer", "Geometry")
30 geom.GetCurrentStudy(salome.myStudyId)
32 myBuilder = salome.myStudy.NewBuilder()
35 GraphGeom2Essai = Graph( 'GraphGeom2Essai' )
36 print GraphGeom2Essai.SetAuthor( '' )
37 print GraphGeom2Essai.SetComment( '' )
38 GraphGeom2Essai.Coords( 0 , 0 )
41 MakeSphere = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeSphere' )
42 print MakeSphere.SetAuthor( '' )
43 print MakeSphere.SetContainer( 'FactoryServer' )
44 print MakeSphere.SetComment( '' )
45 MakeSphere.Coords( 26 , 13 )
46 MakeCopy = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeCopy' )
47 print MakeCopy.SetAuthor( '' )
48 print MakeCopy.SetContainer( 'FactoryServer' )
49 print MakeCopy.SetComment( '' )
50 MakeCopy.Coords( 219 , 12 )
51 MakeTranslation = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeTranslation' )
52 print MakeTranslation.SetAuthor( '' )
53 print MakeTranslation.SetContainer( 'FactoryServer' )
54 print MakeTranslation.SetComment( '' )
55 MakeTranslation.Coords( 219 , 159 )
56 MakeFuse = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeFuse' )
57 print MakeFuse.SetAuthor( '' )
58 print MakeFuse.SetContainer( 'FactoryServer' )
59 print MakeFuse.SetComment( '' )
60 MakeFuse.Coords( 465 , 106 )
62 # Creation of intermediate Output variables and of links
63 MakeSphereshape = MakeSphere.Port( 'shape' )
64 MakeCopyshape1 = GraphGeom2Essai.Link( MakeSphereshape , MakeCopy.Port( 'shape1' ) )
65 MakeTranslationshape1 = GraphGeom2Essai.Link( MakeSphereshape , MakeTranslation.Port( 'shape1' ) )
66 MakeCopyshape = MakeCopy.Port( 'shape' )
67 MakeFuseshape1 = GraphGeom2Essai.Link( MakeCopyshape , MakeFuse.Port( 'shape1' ) )
68 MakeTranslationshape = MakeTranslation.Port( 'shape' )
69 MakeFuseshape2 = GraphGeom2Essai.Link( MakeTranslationshape , MakeFuse.Port( 'shape2' ) )
71 # Creation of Input datas
72 MakeSpherex1 = MakeSphere.Input( 'x1' , 0)
73 MakeSpherey1 = MakeSphere.Input( 'y1' , 0)
74 MakeSpherez1 = MakeSphere.Input( 'z1' , 0)
75 MakeSphereradius = MakeSphere.Input( 'radius' , 50)
76 MakeTranslationx1 = MakeTranslation.Input( 'x1' , 80)
77 MakeTranslationy1 = MakeTranslation.Input( 'y1' , 0)
78 MakeTranslationz1 = MakeTranslation.Input( 'z1' , 0)
80 # Missing Input datas : None
82 # Creation of Output variables
83 MakeFuseshape = MakeFuse.Port( 'shape' )
85 # State of Ports of the Graph
86 GraphGeom2Essai.PrintPorts()
88 # Start asynchronous run
89 print GraphGeom2Essai.Run()
92 print GraphGeom2Essai.IsDone()
94 # Events of execution :
95 aStatus,aNode,anEvent,aState = GraphGeom2Essai.Event()
97 print aNode.Thread(),aNode.SubGraph(),aNode.Name(),anEvent,aState
98 aStatus,aNode,anEvent,aState = GraphGeom2Essai.Event()
99 print GraphGeom2Essai.IsDone()
101 # Waiting end of execution :
102 print GraphGeom2Essai.DoneW()
105 print "Type print GraphGeom2Essai.IsDone()"
106 print "1 <==> It's done"
108 print "Type print GraphGeom2Essai.DoneW()"
109 print "Wait until end of execution : 1(success)"
111 print "Type GraphGeom2Essai.PrintPorts()"
112 print " to see input and output values of the graph"
114 print "Type MakeSphere.PrintPorts()"
115 print "Type MakeCopy.PrintPorts()"
116 print "Type MakeTranslation.PrintPorts()"
117 print "Type MakeFuse.PrintPorts()"
118 print " to see input and output values of nodes"
120 print "Type print GraphGeom2Essai.Export('File-Name')"
121 print "You will get a .py and a .xml file of this graph"