]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Fix for 12314.
authorakk <akk@opencascade.com>
Wed, 3 May 2006 14:16:24 +0000 (14:16 +0000)
committerakk <akk@opencascade.com>
Wed, 3 May 2006 14:16:24 +0000 (14:16 +0000)
src/GEOM_SWIG/GEOM_cyl2complementary.py
src/GEOM_SWIG/GEOM_example3.py
src/GEOM_SWIG/GEOM_tube_geom_gg2.py

index 97efc776efc267db9f10bed4a468482f806111c2..930f092180b4281c7eb70994dcc077ac091a00cb 100755 (executable)
 import salome
 import geompy
 geomgui = salome.ImportComponentGUI("GEOM") 
-
+import salome_ComponentGUI
 def addToStudy(shape, name):
     i = geompy.addToStudy(shape, name)
     salome.sg.updateObjBrowser(0)
-    geomgui.createAndDisplayGO(i)
+    if not isinstance(geomgui, type(salome_ComponentGUI)):
+        geomgui.createAndDisplayGO(i)
     return i
 
 # Piece
index 1287f6853d1efda401840006c53b1c08f88514a0..da733d47737d79278152a0fd3d29de16d3ab28b1 100644 (file)
@@ -30,7 +30,7 @@ import salome
 import geompy
 import math
 from time import sleep
-
+import salome_ComponentGUI
 geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
 myBuilder = salome.myStudy.NewBuilder()
 
@@ -47,14 +47,16 @@ dirz = BasicOp.MakeVectorTwoPnt(point0,pointz1)
 
 torus1 = PrimOp.MakeTorusPntVecRR(point0,dirz,150.,25.)
 id_torus1 = geompy.addToStudy(torus1,"torus1")
-gg.createAndDisplayGO(id_torus1)
+if not isinstance(gg, type(salome_ComponentGUI)):
+    gg.createAndDisplayGO(id_torus1)
 
 torus2 = InsertOp.MakeCopy(torus1)
 
 vec1 = BasicOp.MakeVectorDXDYDZ(0.,0.,100.)
 torus2 = TrsfOp.TranslateVectorCopy(torus2,vec1)
 id_torus2 = geompy.addToStudy(torus2,"torus2")
-gg.createAndDisplayGO(id_torus2)
+if not isinstance(gg, type(salome_ComponentGUI)):
+    gg.createAndDisplayGO(id_torus2)
 
 cylz1 = PrimOp.MakeCylinderPntVecRH(point0,dirz,25.,100.)
 
@@ -70,7 +72,8 @@ while ind < 6:
     name = "cyl%d"%(ind)
     acyl = TrsfOp.TranslateVectorCopy(acyl,vec_i)
     id_acyl = geompy.addToStudy(acyl,name)
-    gg.createAndDisplayGO(id_acyl)
+    if not isinstance(gg, type(salome_ComponentGUI)):
+        gg.createAndDisplayGO(id_acyl)
     shapeList.append(acyl)
     idList.append(id_acyl)
     ind = ind +1
@@ -82,7 +85,8 @@ idList.append(id_torus2)
 
 cage = geompy.MakeCompound(shapeList)
 id_cage = geompy.addToStudy(cage,"cage")
-gg.createAndDisplayGO(id_cage)
+if not isinstance(gg, type(salome_ComponentGUI)):
+    gg.createAndDisplayGO(id_cage)
 
 from salome import sg
 sleep(1)
@@ -102,15 +106,15 @@ for id in idList:
 sg.Display(id_torus1)
 sg.Display(id_torus2)
 sg.Display(id_acyl)
-
-gg.setTransparency(id_torus1,0.5)
-
-gg.setDisplayMode(id_torus1,1)
-gg.setDisplayMode(id_torus2,1)
-gg.setDisplayMode(id_acyl,1)
-#gg.setDisplayMode(id_cage,1)
-
-gg.setColor(id_torus1,0,0,255)
-gg.setColor(id_torus2,255,0,0)
-gg.setColor(id_acyl,0,255,0)
-#gg.setColor(id_cage,255,255,0)
+if not isinstance(gg, type(salome_ComponentGUI)):
+    gg.setTransparency(id_torus1,0.5)
+    
+    gg.setDisplayMode(id_torus1,1)
+    gg.setDisplayMode(id_torus2,1)
+    gg.setDisplayMode(id_acyl,1)
+    #gg.setDisplayMode(id_cage,1)
+    
+    gg.setColor(id_torus1,0,0,255)
+    gg.setColor(id_torus2,255,0,0)
+    gg.setColor(id_acyl,0,255,0)
+    #gg.setColor(id_cage,255,255,0)
index 9d7ddbcb5be2832d622badb67915d763a26696e6..6773102660778cb4cf67428f596fcbc315a6b7b1 100755 (executable)
@@ -143,17 +143,18 @@ assemblageId = addToStudy(assemblage, "assemblage")
 # Display\r
 #\r
 gg = ImportComponentGUI("GEOM")\r
-gg.initGeomGen()\r
-\r
-gg.createAndDisplayGO(baseId)\r
-gg.setTransparency(baseId,0.5)\r
-gg.setDisplayMode(baseId,1)\r
-gg.setColor(baseId,255,0,0)\r
-gg.createAndDisplayGO(travId)\r
-gg.setTransparency(travId,0.5)\r
-gg.setDisplayMode(travId,1)\r
-gg.setColor(travId,255,0,0)\r
-gg.createAndDisplayGO(weldId)\r
-gg.setTransparency(weldId,0.5)\r
-gg.setDisplayMode(weldId,1)\r
-gg.setColor(weldId,0,0,255)\r
+import salome_ComponentGUI\r
+if not isinstance(gg, type(salome_ComponentGUI)):\r
+    gg.initGeomGen()\r
+    gg.createAndDisplayGO(baseId)\r
+    gg.setTransparency(baseId,0.5)\r
+    gg.setDisplayMode(baseId,1)\r
+    gg.setColor(baseId,255,0,0)\r
+    gg.createAndDisplayGO(travId)\r
+    gg.setTransparency(travId,0.5)\r
+    gg.setDisplayMode(travId,1)\r
+    gg.setColor(travId,255,0,0)\r
+    gg.createAndDisplayGO(weldId)\r
+    gg.setTransparency(weldId,0.5)\r
+    gg.setDisplayMode(weldId,1)\r
+    gg.setColor(weldId,0,0,255)\r