mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-24 05:22:04 +05:00
Fix for 12314.
This commit is contained in:
parent
6f9578bb5c
commit
3d41c01543
@ -12,10 +12,11 @@
|
|||||||
import salome
|
import salome
|
||||||
import geompy
|
import geompy
|
||||||
geomgui = salome.ImportComponentGUI("GEOM")
|
geomgui = salome.ImportComponentGUI("GEOM")
|
||||||
|
import salome_ComponentGUI
|
||||||
def addToStudy(shape, name):
|
def addToStudy(shape, name):
|
||||||
i = geompy.addToStudy(shape, name)
|
i = geompy.addToStudy(shape, name)
|
||||||
salome.sg.updateObjBrowser(0)
|
salome.sg.updateObjBrowser(0)
|
||||||
|
if not isinstance(geomgui, type(salome_ComponentGUI)):
|
||||||
geomgui.createAndDisplayGO(i)
|
geomgui.createAndDisplayGO(i)
|
||||||
return i
|
return i
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ import salome
|
|||||||
import geompy
|
import geompy
|
||||||
import math
|
import math
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
import salome_ComponentGUI
|
||||||
geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
|
geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
|
||||||
myBuilder = salome.myStudy.NewBuilder()
|
myBuilder = salome.myStudy.NewBuilder()
|
||||||
|
|
||||||
@ -47,6 +47,7 @@ dirz = BasicOp.MakeVectorTwoPnt(point0,pointz1)
|
|||||||
|
|
||||||
torus1 = PrimOp.MakeTorusPntVecRR(point0,dirz,150.,25.)
|
torus1 = PrimOp.MakeTorusPntVecRR(point0,dirz,150.,25.)
|
||||||
id_torus1 = geompy.addToStudy(torus1,"torus1")
|
id_torus1 = geompy.addToStudy(torus1,"torus1")
|
||||||
|
if not isinstance(gg, type(salome_ComponentGUI)):
|
||||||
gg.createAndDisplayGO(id_torus1)
|
gg.createAndDisplayGO(id_torus1)
|
||||||
|
|
||||||
torus2 = InsertOp.MakeCopy(torus1)
|
torus2 = InsertOp.MakeCopy(torus1)
|
||||||
@ -54,6 +55,7 @@ torus2 = InsertOp.MakeCopy(torus1)
|
|||||||
vec1 = BasicOp.MakeVectorDXDYDZ(0.,0.,100.)
|
vec1 = BasicOp.MakeVectorDXDYDZ(0.,0.,100.)
|
||||||
torus2 = TrsfOp.TranslateVectorCopy(torus2,vec1)
|
torus2 = TrsfOp.TranslateVectorCopy(torus2,vec1)
|
||||||
id_torus2 = geompy.addToStudy(torus2,"torus2")
|
id_torus2 = geompy.addToStudy(torus2,"torus2")
|
||||||
|
if not isinstance(gg, type(salome_ComponentGUI)):
|
||||||
gg.createAndDisplayGO(id_torus2)
|
gg.createAndDisplayGO(id_torus2)
|
||||||
|
|
||||||
cylz1 = PrimOp.MakeCylinderPntVecRH(point0,dirz,25.,100.)
|
cylz1 = PrimOp.MakeCylinderPntVecRH(point0,dirz,25.,100.)
|
||||||
@ -70,6 +72,7 @@ while ind < 6:
|
|||||||
name = "cyl%d"%(ind)
|
name = "cyl%d"%(ind)
|
||||||
acyl = TrsfOp.TranslateVectorCopy(acyl,vec_i)
|
acyl = TrsfOp.TranslateVectorCopy(acyl,vec_i)
|
||||||
id_acyl = geompy.addToStudy(acyl,name)
|
id_acyl = geompy.addToStudy(acyl,name)
|
||||||
|
if not isinstance(gg, type(salome_ComponentGUI)):
|
||||||
gg.createAndDisplayGO(id_acyl)
|
gg.createAndDisplayGO(id_acyl)
|
||||||
shapeList.append(acyl)
|
shapeList.append(acyl)
|
||||||
idList.append(id_acyl)
|
idList.append(id_acyl)
|
||||||
@ -82,6 +85,7 @@ idList.append(id_torus2)
|
|||||||
|
|
||||||
cage = geompy.MakeCompound(shapeList)
|
cage = geompy.MakeCompound(shapeList)
|
||||||
id_cage = geompy.addToStudy(cage,"cage")
|
id_cage = geompy.addToStudy(cage,"cage")
|
||||||
|
if not isinstance(gg, type(salome_ComponentGUI)):
|
||||||
gg.createAndDisplayGO(id_cage)
|
gg.createAndDisplayGO(id_cage)
|
||||||
|
|
||||||
from salome import sg
|
from salome import sg
|
||||||
@ -102,7 +106,7 @@ for id in idList:
|
|||||||
sg.Display(id_torus1)
|
sg.Display(id_torus1)
|
||||||
sg.Display(id_torus2)
|
sg.Display(id_torus2)
|
||||||
sg.Display(id_acyl)
|
sg.Display(id_acyl)
|
||||||
|
if not isinstance(gg, type(salome_ComponentGUI)):
|
||||||
gg.setTransparency(id_torus1,0.5)
|
gg.setTransparency(id_torus1,0.5)
|
||||||
|
|
||||||
gg.setDisplayMode(id_torus1,1)
|
gg.setDisplayMode(id_torus1,1)
|
||||||
|
@ -143,8 +143,9 @@ assemblageId = addToStudy(assemblage, "assemblage")
|
|||||||
# Display
|
# Display
|
||||||
#
|
#
|
||||||
gg = ImportComponentGUI("GEOM")
|
gg = ImportComponentGUI("GEOM")
|
||||||
|
import salome_ComponentGUI
|
||||||
|
if not isinstance(gg, type(salome_ComponentGUI)):
|
||||||
gg.initGeomGen()
|
gg.initGeomGen()
|
||||||
|
|
||||||
gg.createAndDisplayGO(baseId)
|
gg.createAndDisplayGO(baseId)
|
||||||
gg.setTransparency(baseId,0.5)
|
gg.setTransparency(baseId,0.5)
|
||||||
gg.setDisplayMode(baseId,1)
|
gg.setDisplayMode(baseId,1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user