2 # Generated python file of Graph GraphGeomEssai_1_1_1_1
6 # Graph creation of GraphGeomEssai_1_1_1_1
7 def DefGraphGeomEssai_1_1_1_1() :
8 GraphGeomEssai_1_1_1_1 = Graph( 'GraphGeomEssai_1_1_1_1' )
9 GraphGeomEssai_1_1_1_1.SetName( 'GraphGeomEssai_1_1_1_1' )
10 GraphGeomEssai_1_1_1_1.SetAuthor( '' )
11 GraphGeomEssai_1_1_1_1.SetComment( '' )
12 GraphGeomEssai_1_1_1_1.Coords( 0 , 0 )
14 # Creation of Factory Nodes
16 # Creation of InLine Nodes
18 Pygag.append( 'from batchmode_geompy import * ' )
19 Pygag.append( 'def gag(): ' )
20 Pygag.append( ' # This is a gag ' )
21 Pygag.append( ' return 1 ' )
22 gag = GraphGeomEssai_1_1_1_1.INode( 'gag' , Pygag )
25 gag.SetComment( 'Compute Node' )
27 IgagGate = gag.GetInPort( 'Gate' )
28 OgagGate = gag.GetOutPort( 'Gate' )
31 PyMakeSphere_1.append( 'def MakeSphere_1(x1,y1,z1,radius): ' )
32 PyMakeSphere_1.append( ' apoint=MakeVertex(x1,y1,z1) ' )
33 PyMakeSphere_1.append( ' shape=MakeSpherePntR(apoint,radius) ' )
34 PyMakeSphere_1.append( ' return shape ' )
35 MakeSphere_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeSphere_1' , PyMakeSphere_1 )
36 MakeSphere_1.SetName( 'MakeSphere_1' )
37 MakeSphere_1.SetAuthor( '' )
38 MakeSphere_1.SetComment( 'Compute Node' )
39 MakeSphere_1.Coords( 181 , 86 )
40 IMakeSphere_1x1 = MakeSphere_1.InPort( 'x1' , 'double' )
41 IMakeSphere_1y1 = MakeSphere_1.InPort( 'y1' , 'double' )
42 IMakeSphere_1z1 = MakeSphere_1.InPort( 'z1' , 'double' )
43 IMakeSphere_1radius = MakeSphere_1.InPort( 'radius' , 'double' )
44 IMakeSphere_1Gate = MakeSphere_1.GetInPort( 'Gate' )
45 OMakeSphere_1shape = MakeSphere_1.OutPort( 'shape' , 'objref' )
46 OMakeSphere_1Gate = MakeSphere_1.GetOutPort( 'Gate' )
49 PyMakeCopy_1.append( 'def MakeCopy_1(shape1): ' )
50 PyMakeCopy_1.append( ' shape=MakeCopy(shape1) ' )
51 PyMakeCopy_1.append( ' return shape ' )
52 MakeCopy_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeCopy_1' , PyMakeCopy_1 )
53 MakeCopy_1.SetName( 'MakeCopy_1' )
54 MakeCopy_1.SetAuthor( '' )
55 MakeCopy_1.SetComment( 'Compute Node' )
56 MakeCopy_1.Coords( 386 , 2 )
57 IMakeCopy_1shape1 = MakeCopy_1.InPort( 'shape1' , 'objref' )
58 IMakeCopy_1Gate = MakeCopy_1.GetInPort( 'Gate' )
59 OMakeCopy_1shape = MakeCopy_1.OutPort( 'shape' , 'objref' )
60 OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' )
63 PyMakeCopy_2.append( 'def MakeCopy_2(shape1): ' )
64 PyMakeCopy_2.append( ' shape=MakeCopy(shape1) ' )
65 PyMakeCopy_2.append( ' return shape ' )
66 MakeCopy_2 = GraphGeomEssai_1_1_1_1.INode( 'MakeCopy_2' , PyMakeCopy_2 )
67 MakeCopy_2.SetName( 'MakeCopy_2' )
68 MakeCopy_2.SetAuthor( '' )
69 MakeCopy_2.SetComment( 'Compute Node' )
70 MakeCopy_2.Coords( 388 , 181 )
71 IMakeCopy_2shape1 = MakeCopy_2.InPort( 'shape1' , 'objref' )
72 IMakeCopy_2Gate = MakeCopy_2.GetInPort( 'Gate' )
73 OMakeCopy_2shape = MakeCopy_2.OutPort( 'shape' , 'objref' )
74 OMakeCopy_2Gate = MakeCopy_2.GetOutPort( 'Gate' )
77 PyMakeFuse_1.append( 'def MakeFuse_1(shape1,shape2): ' )
78 PyMakeFuse_1.append( ' # fuse operation 3 ' )
79 PyMakeFuse_1.append( ' shape = MakeBoolean(shape1,shape2,3) ' )
80 PyMakeFuse_1.append( ' from SALOME_NamingServicePy import SALOME_NamingServicePy_i ' )
81 PyMakeFuse_1.append( ' myNamingService = SALOME_NamingServicePy_i(orb) ' )
82 PyMakeFuse_1.append( ' aSession = myNamingService.Resolve('/Kernel/Session') ' )
83 PyMakeFuse_1.append( ' aStudyId = aSession.GetActiveStudyId() ' )
84 PyMakeFuse_1.append( ' myStudyManager = myNamingService.Resolve('/myStudyManager') ' )
85 PyMakeFuse_1.append( ' aStudy = myStudyManager.GetStudyByID(aStudyId) ' )
86 PyMakeFuse_1.append( ' aSObject = geom.AddInStudy(aStudy, shape, "shape", None) ' )
87 PyMakeFuse_1.append( ' return shape ' )
88 MakeFuse_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeFuse_1' , PyMakeFuse_1 )
89 MakeFuse_1.SetName( 'MakeFuse_1' )
90 MakeFuse_1.SetAuthor( '' )
91 MakeFuse_1.SetComment( 'Compute Node' )
92 MakeFuse_1.Coords( 779 , 161 )
93 IMakeFuse_1shape1 = MakeFuse_1.InPort( 'shape1' , 'objref' )
94 IMakeFuse_1shape2 = MakeFuse_1.InPort( 'shape2' , 'objref' )
95 IMakeFuse_1Gate = MakeFuse_1.GetInPort( 'Gate' )
96 OMakeFuse_1shape = MakeFuse_1.OutPort( 'shape' , 'objref' )
97 OMakeFuse_1Gate = MakeFuse_1.GetOutPort( 'Gate' )
99 PyMakeTranslation_1 = []
100 PyMakeTranslation_1.append( 'def MakeTranslation_1(shape1,x1,y1,z1): ' )
101 PyMakeTranslation_1.append( ' shape = MakeTranslation(shape1,x1,y1,z1) ' )
102 PyMakeTranslation_1.append( ' return shape' )
103 MakeTranslation_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeTranslation_1' , PyMakeTranslation_1 )
104 MakeTranslation_1.SetName( 'MakeTranslation_1' )
105 MakeTranslation_1.SetAuthor( '' )
106 MakeTranslation_1.SetComment( 'Compute Node' )
107 MakeTranslation_1.Coords( 580 , 2 )
108 IMakeTranslation_1shape1 = MakeTranslation_1.InPort( 'shape1' , 'objref' )
109 IMakeTranslation_1x1 = MakeTranslation_1.InPort( 'x1' , 'double' )
110 IMakeTranslation_1y1 = MakeTranslation_1.InPort( 'y1' , 'double' )
111 IMakeTranslation_1z1 = MakeTranslation_1.InPort( 'z1' , 'double' )
112 IMakeTranslation_1Gate = MakeTranslation_1.GetInPort( 'Gate' )
113 OMakeTranslation_1shape = MakeTranslation_1.OutPort( 'shape' , 'objref' )
114 OMakeTranslation_1Gate = MakeTranslation_1.GetOutPort( 'Gate' )
117 LgagGateMakeSphere_1Gate = GraphGeomEssai_1_1_1_1.Link( OgagGate , IMakeSphere_1Gate )
119 LMakeSphere_1shapeMakeCopy_1shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeSphere_1shape , IMakeCopy_1shape1 )
121 LMakeSphere_1shapeMakeCopy_2shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeSphere_1shape , IMakeCopy_2shape1 )
123 LMakeCopy_1shapeMakeTranslation_1shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeCopy_1shape , IMakeTranslation_1shape1 )
125 LMakeCopy_2shapeMakeFuse_1shape2 = GraphGeomEssai_1_1_1_1.Link( OMakeCopy_2shape , IMakeFuse_1shape2 )
127 LMakeTranslation_1shapeMakeFuse_1shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeTranslation_1shape , IMakeFuse_1shape1 )
130 IMakeSphere_1x1.Input( 0 )
131 IMakeSphere_1y1.Input( 0 )
132 IMakeSphere_1z1.Input( 0 )
133 IMakeSphere_1radius.Input( 20 )
134 IMakeTranslation_1x1.Input( 10 )
135 IMakeTranslation_1y1.Input( 10 )
136 IMakeTranslation_1z1.Input( 10 )
138 # Output Ports of the graph
139 #OMakeFuse_1shape = MakeFuse_1.GetOutPort( 'shape' )
140 return GraphGeomEssai_1_1_1_1
143 GraphGeomEssai_1_1_1_1 = DefGraphGeomEssai_1_1_1_1()