2 # Generated python file of Graph aNewDataFlow_1_4_2_1
6 # Graph creation of aNewDataFlow_1_4_2_1
7 def DefaNewDataFlow_1_4_2_1() :
8 aNewDataFlow_1_4_2_1 = Graph( 'aNewDataFlow_1_4_2_1' )
9 aNewDataFlow_1_4_2_1.SetName( 'aNewDataFlow_1_4_2_1' )
10 aNewDataFlow_1_4_2_1.SetAuthor( '' )
11 aNewDataFlow_1_4_2_1.SetComment( '' )
12 aNewDataFlow_1_4_2_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 = aNewDataFlow_1_4_2_1.INode( 'gag' , Pygag )
25 gag.SetComment( 'Compute Node' )
27 IgagGate = gag.GetInPort( 'Gate' )
28 OgagGate = gag.GetOutPort( 'Gate' )
31 PyMakeCopy_1.append( 'def MakeCopy_1(shape1): ' )
32 PyMakeCopy_1.append( ' shape=MakeCopy(shape1) ' )
33 PyMakeCopy_1.append( ' return shape ' )
34 MakeCopy_1 = aNewDataFlow_1_4_2_1.INode( 'MakeCopy_1' , PyMakeCopy_1 )
35 MakeCopy_1.SetName( 'MakeCopy_1' )
36 MakeCopy_1.SetAuthor( '' )
37 MakeCopy_1.SetComment( 'Compute Node' )
38 MakeCopy_1.Coords( 385 , 3 )
39 IMakeCopy_1shape1 = MakeCopy_1.InPort( 'shape1' , 'objref' )
40 IMakeCopy_1Gate = MakeCopy_1.GetInPort( 'Gate' )
41 OMakeCopy_1shape = MakeCopy_1.OutPort( 'shape' , 'objref' )
42 OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' )
45 PyMakeSphere_1.append( 'def MakeSphere_1(x1,y1,z1,radius): ' )
46 PyMakeSphere_1.append( ' apoint=MakeVertex(x1,y1,z1) ' )
47 PyMakeSphere_1.append( ' shape=MakeSpherePntR(apoint,radius) ' )
48 PyMakeSphere_1.append( ' return shape ' )
49 MakeSphere_1 = aNewDataFlow_1_4_2_1.INode( 'MakeSphere_1' , PyMakeSphere_1 )
50 MakeSphere_1.SetName( 'MakeSphere_1' )
51 MakeSphere_1.SetAuthor( '' )
52 MakeSphere_1.SetComment( 'Compute Node' )
53 MakeSphere_1.Coords( 193 , 67 )
54 IMakeSphere_1x1 = MakeSphere_1.InPort( 'x1' , 'double' )
55 IMakeSphere_1y1 = MakeSphere_1.InPort( 'y1' , 'double' )
56 IMakeSphere_1z1 = MakeSphere_1.InPort( 'z1' , 'double' )
57 IMakeSphere_1radius = MakeSphere_1.InPort( 'radius' , 'double' )
58 IMakeSphere_1Gate = MakeSphere_1.GetInPort( 'Gate' )
59 OMakeSphere_1shape = MakeSphere_1.OutPort( 'shape' , 'objref' )
60 OMakeSphere_1Gate = MakeSphere_1.GetOutPort( 'Gate' )
62 PyMakeTranslation_1 = []
63 PyMakeTranslation_1.append( 'def MakeTranslation_1(shape1,x1,y1,z1): ' )
64 PyMakeTranslation_1.append( ' shape = MakeTranslation(shape1,x1,y1,z1) ' )
65 PyMakeTranslation_1.append( ' return shape ' )
66 MakeTranslation_1 = aNewDataFlow_1_4_2_1.INode( 'MakeTranslation_1' , PyMakeTranslation_1 )
67 MakeTranslation_1.SetName( 'MakeTranslation_1' )
68 MakeTranslation_1.SetAuthor( '' )
69 MakeTranslation_1.SetComment( 'Compute Node' )
70 MakeTranslation_1.Coords( 388 , 146 )
71 IMakeTranslation_1shape1 = MakeTranslation_1.InPort( 'shape1' , 'objref' )
72 IMakeTranslation_1x1 = MakeTranslation_1.InPort( 'x1' , 'double' )
73 IMakeTranslation_1y1 = MakeTranslation_1.InPort( 'y1' , 'double' )
74 IMakeTranslation_1z1 = MakeTranslation_1.InPort( 'z1' , 'double' )
75 IMakeTranslation_1Gate = MakeTranslation_1.GetInPort( 'Gate' )
76 OMakeTranslation_1shape = MakeTranslation_1.OutPort( 'shape' , 'objref' )
77 OMakeTranslation_1Gate = MakeTranslation_1.GetOutPort( 'Gate' )
80 PyMakeFuse_1.append( 'def MakeFuse_1(shape1,shape2): ' )
81 PyMakeFuse_1.append( ' # fuse operation 3 ' )
82 PyMakeFuse_1.append( ' shape = MakeBoolean(shape1,shape2,3) ' )
83 PyMakeFuse_1.append( ' from SALOME_NamingServicePy import SALOME_NamingServicePy_i ' )
84 PyMakeFuse_1.append( ' myNamingService = SALOME_NamingServicePy_i(orb) ' )
85 PyMakeFuse_1.append( ' aSession = myNamingService.Resolve('/Kernel/Session') ' )
86 PyMakeFuse_1.append( ' aStudyId = aSession.GetActiveStudyId() ' )
87 PyMakeFuse_1.append( ' myStudyManager = myNamingService.Resolve('/myStudyManager') ' )
88 PyMakeFuse_1.append( ' aStudy = myStudyManager.GetStudyByID(aStudyId) ' )
89 PyMakeFuse_1.append( ' aSObject = geom.AddInStudy(aStudy, shape, "shape", None) ' )
90 PyMakeFuse_1.append( ' return shape ' )
91 MakeFuse_1 = aNewDataFlow_1_4_2_1.INode( 'MakeFuse_1' , PyMakeFuse_1 )
92 MakeFuse_1.SetName( 'MakeFuse_1' )
93 MakeFuse_1.SetAuthor( '' )
94 MakeFuse_1.SetComment( 'Compute Node' )
95 MakeFuse_1.Coords( 618 , 64 )
96 IMakeFuse_1shape1 = MakeFuse_1.InPort( 'shape1' , 'objref' )
97 IMakeFuse_1shape2 = MakeFuse_1.InPort( 'shape2' , 'objref' )
98 IMakeFuse_1Gate = MakeFuse_1.GetInPort( 'Gate' )
99 OMakeFuse_1shape = MakeFuse_1.OutPort( 'shape' , 'objref' )
100 OMakeFuse_1Gate = MakeFuse_1.GetOutPort( 'Gate' )
103 LgagGateMakeSphere_1Gate = aNewDataFlow_1_4_2_1.Link( OgagGate , IMakeSphere_1Gate )
105 LMakeCopy_1shapeMakeFuse_1shape1 = aNewDataFlow_1_4_2_1.Link( OMakeCopy_1shape , IMakeFuse_1shape1 )
107 LMakeSphere_1shapeMakeCopy_1shape1 = aNewDataFlow_1_4_2_1.Link( OMakeSphere_1shape , IMakeCopy_1shape1 )
109 LMakeSphere_1shapeMakeTranslation_1shape1 = aNewDataFlow_1_4_2_1.Link( OMakeSphere_1shape , IMakeTranslation_1shape1 )
111 LMakeTranslation_1shapeMakeFuse_1shape2 = aNewDataFlow_1_4_2_1.Link( OMakeTranslation_1shape , IMakeFuse_1shape2 )
114 IMakeSphere_1x1.Input( 0 )
115 IMakeSphere_1y1.Input( 0 )
116 IMakeSphere_1z1.Input( 0 )
117 IMakeSphere_1radius.Input( 50 )
118 IMakeTranslation_1x1.Input( 80 )
119 IMakeTranslation_1y1.Input( 0 )
120 IMakeTranslation_1z1.Input( 0 )
122 # Output Ports of the graph
123 #OMakeFuse_1shape = MakeFuse_1.GetOutPort( 'shape' )
124 return aNewDataFlow_1_4_2_1
127 aNewDataFlow_1_4_2_1 = DefaNewDataFlow_1_4_2_1()