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 GraphGeomEssai_1_1_1_1
26 # Graph creation of GraphGeomEssai_1_1_1_1
27 def DefGraphGeomEssai_1_1_1_1() :
28 GraphGeomEssai_1_1_1_1 = Graph( 'GraphGeomEssai_1_1_1_1' )
29 GraphGeomEssai_1_1_1_1.SetName( 'GraphGeomEssai_1_1_1_1' )
30 GraphGeomEssai_1_1_1_1.SetAuthor( '' )
31 GraphGeomEssai_1_1_1_1.SetComment( '' )
32 GraphGeomEssai_1_1_1_1.Coords( 0 , 0 )
34 # Creation of Factory Nodes
36 # Creation of InLine Nodes
38 Pygag.append( 'from batchmode_geompy import * ' )
39 Pygag.append( 'def gag(): ' )
40 Pygag.append( ' # This is a gag ' )
41 Pygag.append( ' return 1 ' )
42 gag = GraphGeomEssai_1_1_1_1.INode( 'gag' , Pygag )
45 gag.SetComment( 'Compute Node' )
47 IgagGate = gag.GetInPort( 'Gate' )
48 OgagGate = gag.GetOutPort( 'Gate' )
51 PyMakeSphere_1.append( 'def MakeSphere_1(x1,y1,z1,radius): ' )
52 PyMakeSphere_1.append( ' apoint=MakeVertex(x1,y1,z1) ' )
53 PyMakeSphere_1.append( ' shape=MakeSpherePntR(apoint,radius) ' )
54 PyMakeSphere_1.append( ' return shape ' )
55 MakeSphere_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeSphere_1' , PyMakeSphere_1 )
56 MakeSphere_1.SetName( 'MakeSphere_1' )
57 MakeSphere_1.SetAuthor( '' )
58 MakeSphere_1.SetComment( 'Compute Node' )
59 MakeSphere_1.Coords( 181 , 86 )
60 IMakeSphere_1x1 = MakeSphere_1.InPort( 'x1' , 'double' )
61 IMakeSphere_1y1 = MakeSphere_1.InPort( 'y1' , 'double' )
62 IMakeSphere_1z1 = MakeSphere_1.InPort( 'z1' , 'double' )
63 IMakeSphere_1radius = MakeSphere_1.InPort( 'radius' , 'double' )
64 IMakeSphere_1Gate = MakeSphere_1.GetInPort( 'Gate' )
65 OMakeSphere_1shape = MakeSphere_1.OutPort( 'shape' , 'objref' )
66 OMakeSphere_1Gate = MakeSphere_1.GetOutPort( 'Gate' )
69 PyMakeCopy_1.append( 'def MakeCopy_1(shape1): ' )
70 PyMakeCopy_1.append( ' shape=MakeCopy(shape1) ' )
71 PyMakeCopy_1.append( ' return shape ' )
72 MakeCopy_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeCopy_1' , PyMakeCopy_1 )
73 MakeCopy_1.SetName( 'MakeCopy_1' )
74 MakeCopy_1.SetAuthor( '' )
75 MakeCopy_1.SetComment( 'Compute Node' )
76 MakeCopy_1.Coords( 386 , 2 )
77 IMakeCopy_1shape1 = MakeCopy_1.InPort( 'shape1' , 'objref' )
78 IMakeCopy_1Gate = MakeCopy_1.GetInPort( 'Gate' )
79 OMakeCopy_1shape = MakeCopy_1.OutPort( 'shape' , 'objref' )
80 OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' )
83 PyMakeCopy_2.append( 'def MakeCopy_2(shape1): ' )
84 PyMakeCopy_2.append( ' shape=MakeCopy(shape1) ' )
85 PyMakeCopy_2.append( ' return shape ' )
86 MakeCopy_2 = GraphGeomEssai_1_1_1_1.INode( 'MakeCopy_2' , PyMakeCopy_2 )
87 MakeCopy_2.SetName( 'MakeCopy_2' )
88 MakeCopy_2.SetAuthor( '' )
89 MakeCopy_2.SetComment( 'Compute Node' )
90 MakeCopy_2.Coords( 388 , 181 )
91 IMakeCopy_2shape1 = MakeCopy_2.InPort( 'shape1' , 'objref' )
92 IMakeCopy_2Gate = MakeCopy_2.GetInPort( 'Gate' )
93 OMakeCopy_2shape = MakeCopy_2.OutPort( 'shape' , 'objref' )
94 OMakeCopy_2Gate = MakeCopy_2.GetOutPort( 'Gate' )
97 PyMakeFuse_1.append( 'def MakeFuse_1(shape1,shape2): ' )
98 PyMakeFuse_1.append( ' # fuse operation 3 ' )
99 PyMakeFuse_1.append( ' shape = MakeBoolean(shape1,shape2,3) ' )
100 PyMakeFuse_1.append( ' from SALOME_NamingServicePy import SALOME_NamingServicePy_i ' )
101 PyMakeFuse_1.append( ' myNamingService = SALOME_NamingServicePy_i(orb) ' )
102 PyMakeFuse_1.append( ' aSession = myNamingService.Resolve('/Kernel/Session') ' )
103 PyMakeFuse_1.append( ' aStudyId = aSession.GetActiveStudyId() ' )
104 PyMakeFuse_1.append( ' myStudyManager = myNamingService.Resolve('/myStudyManager') ' )
105 PyMakeFuse_1.append( ' aStudy = myStudyManager.GetStudyByID(aStudyId) ' )
106 PyMakeFuse_1.append( ' aSObject = geom.AddInStudy(aStudy, shape, "shape", None) ' )
107 PyMakeFuse_1.append( ' return shape ' )
108 MakeFuse_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeFuse_1' , PyMakeFuse_1 )
109 MakeFuse_1.SetName( 'MakeFuse_1' )
110 MakeFuse_1.SetAuthor( '' )
111 MakeFuse_1.SetComment( 'Compute Node' )
112 MakeFuse_1.Coords( 779 , 161 )
113 IMakeFuse_1shape1 = MakeFuse_1.InPort( 'shape1' , 'objref' )
114 IMakeFuse_1shape2 = MakeFuse_1.InPort( 'shape2' , 'objref' )
115 IMakeFuse_1Gate = MakeFuse_1.GetInPort( 'Gate' )
116 OMakeFuse_1shape = MakeFuse_1.OutPort( 'shape' , 'objref' )
117 OMakeFuse_1Gate = MakeFuse_1.GetOutPort( 'Gate' )
119 PyMakeTranslation_1 = []
120 PyMakeTranslation_1.append( 'def MakeTranslation_1(shape1,x1,y1,z1): ' )
121 PyMakeTranslation_1.append( ' shape = MakeTranslation(shape1,x1,y1,z1) ' )
122 PyMakeTranslation_1.append( ' return shape' )
123 MakeTranslation_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeTranslation_1' , PyMakeTranslation_1 )
124 MakeTranslation_1.SetName( 'MakeTranslation_1' )
125 MakeTranslation_1.SetAuthor( '' )
126 MakeTranslation_1.SetComment( 'Compute Node' )
127 MakeTranslation_1.Coords( 580 , 2 )
128 IMakeTranslation_1shape1 = MakeTranslation_1.InPort( 'shape1' , 'objref' )
129 IMakeTranslation_1x1 = MakeTranslation_1.InPort( 'x1' , 'double' )
130 IMakeTranslation_1y1 = MakeTranslation_1.InPort( 'y1' , 'double' )
131 IMakeTranslation_1z1 = MakeTranslation_1.InPort( 'z1' , 'double' )
132 IMakeTranslation_1Gate = MakeTranslation_1.GetInPort( 'Gate' )
133 OMakeTranslation_1shape = MakeTranslation_1.OutPort( 'shape' , 'objref' )
134 OMakeTranslation_1Gate = MakeTranslation_1.GetOutPort( 'Gate' )
137 LgagGateMakeSphere_1Gate = GraphGeomEssai_1_1_1_1.Link( OgagGate , IMakeSphere_1Gate )
139 LMakeSphere_1shapeMakeCopy_1shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeSphere_1shape , IMakeCopy_1shape1 )
141 LMakeSphere_1shapeMakeCopy_2shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeSphere_1shape , IMakeCopy_2shape1 )
143 LMakeCopy_1shapeMakeTranslation_1shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeCopy_1shape , IMakeTranslation_1shape1 )
145 LMakeCopy_2shapeMakeFuse_1shape2 = GraphGeomEssai_1_1_1_1.Link( OMakeCopy_2shape , IMakeFuse_1shape2 )
147 LMakeTranslation_1shapeMakeFuse_1shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeTranslation_1shape , IMakeFuse_1shape1 )
150 IMakeSphere_1x1.Input( 0 )
151 IMakeSphere_1y1.Input( 0 )
152 IMakeSphere_1z1.Input( 0 )
153 IMakeSphere_1radius.Input( 20 )
154 IMakeTranslation_1x1.Input( 10 )
155 IMakeTranslation_1y1.Input( 10 )
156 IMakeTranslation_1z1.Input( 10 )
158 # Output Ports of the graph
159 #OMakeFuse_1shape = MakeFuse_1.GetOutPort( 'shape' )
160 return GraphGeomEssai_1_1_1_1
163 GraphGeomEssai_1_1_1_1 = DefGraphGeomEssai_1_1_1_1()