1 # Copyright (C) 2007-2012 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
23 # Generated python file of Graph GraphGeom2Essai
32 geom = lcc.FindOrLoadComponent("FactoryServer", "Geometry")
33 geom.GetCurrentStudy(salome.myStudyId)
35 myBuilder = salome.myStudy.NewBuilder()
38 GraphGeom2Essai = Graph( 'GraphGeom2Essai' )
39 print GraphGeom2Essai.SetAuthor( '' )
40 print GraphGeom2Essai.SetComment( '' )
41 GraphGeom2Essai.Coords( 0 , 0 )
44 MakeSphere = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeSphere' )
45 print MakeSphere.SetAuthor( '' )
46 print MakeSphere.SetContainer( 'FactoryServer' )
47 print MakeSphere.SetComment( '' )
48 MakeSphere.Coords( 26 , 13 )
49 MakeCopy = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeCopy' )
50 print MakeCopy.SetAuthor( '' )
51 print MakeCopy.SetContainer( 'FactoryServer' )
52 print MakeCopy.SetComment( '' )
53 MakeCopy.Coords( 219 , 12 )
54 MakeTranslation = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeTranslation' )
55 print MakeTranslation.SetAuthor( '' )
56 print MakeTranslation.SetContainer( 'FactoryServer' )
57 print MakeTranslation.SetComment( '' )
58 MakeTranslation.Coords( 219 , 159 )
59 MakeFuse = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeFuse' )
60 print MakeFuse.SetAuthor( '' )
61 print MakeFuse.SetContainer( 'FactoryServer' )
62 print MakeFuse.SetComment( '' )
63 MakeFuse.Coords( 465 , 106 )
65 # Creation of intermediate Output variables and of links
66 MakeSphereshape = MakeSphere.Port( 'shape' )
67 MakeCopyshape1 = GraphGeom2Essai.Link( MakeSphereshape , MakeCopy.Port( 'shape1' ) )
68 MakeTranslationshape1 = GraphGeom2Essai.Link( MakeSphereshape , MakeTranslation.Port( 'shape1' ) )
69 MakeCopyshape = MakeCopy.Port( 'shape' )
70 MakeFuseshape1 = GraphGeom2Essai.Link( MakeCopyshape , MakeFuse.Port( 'shape1' ) )
71 MakeTranslationshape = MakeTranslation.Port( 'shape' )
72 MakeFuseshape2 = GraphGeom2Essai.Link( MakeTranslationshape , MakeFuse.Port( 'shape2' ) )
74 # Creation of Input datas
75 MakeSpherex1 = MakeSphere.Input( 'x1' , 0)
76 MakeSpherey1 = MakeSphere.Input( 'y1' , 0)
77 MakeSpherez1 = MakeSphere.Input( 'z1' , 0)
78 MakeSphereradius = MakeSphere.Input( 'radius' , 50)
79 MakeTranslationx1 = MakeTranslation.Input( 'x1' , 80)
80 MakeTranslationy1 = MakeTranslation.Input( 'y1' , 0)
81 MakeTranslationz1 = MakeTranslation.Input( 'z1' , 0)
83 # Missing Input datas : None
85 # Creation of Output variables
86 MakeFuseshape = MakeFuse.Port( 'shape' )
88 # State of Ports of the Graph
89 GraphGeom2Essai.PrintPorts()
91 # Start asynchronous run
92 print GraphGeom2Essai.Run()
95 print GraphGeom2Essai.IsDone()
97 # Events of execution :
98 aStatus,aNode,anEvent,aState = GraphGeom2Essai.Event()
100 print aNode.Thread(),aNode.SubGraph(),aNode.Name(),anEvent,aState
101 aStatus,aNode,anEvent,aState = GraphGeom2Essai.Event()
102 print GraphGeom2Essai.IsDone()
104 # Waiting end of execution :
105 print GraphGeom2Essai.DoneW()
108 print "Type print GraphGeom2Essai.IsDone()"
109 print "1 <==> It's done"
111 print "Type print GraphGeom2Essai.DoneW()"
112 print "Wait until end of execution : 1(success)"
114 print "Type GraphGeom2Essai.PrintPorts()"
115 print " to see input and output values of the graph"
117 print "Type MakeSphere.PrintPorts()"
118 print "Type MakeCopy.PrintPorts()"
119 print "Type MakeTranslation.PrintPorts()"
120 print "Type MakeFuse.PrintPorts()"
121 print " to see input and output values of nodes"
123 print "Type print GraphGeom2Essai.Export('File-Name')"
124 print "You will get a .py and a .xml file of this graph"