import salome
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
import tempfile, os
sphere = geompy.MakeSphereR(100)
tmpdir = tempfile.mkdtemp()
f_brep = os.path.join(tmpdir, "sphere.brep")
geompy.ExportBREP(sphere, f_brep)
f_iges = os.path.join(tmpdir, "sphere.iges")
geompy.ExportIGES(sphere, f_iges, "5.3")
f_step = os.path.join(tmpdir, "sphere.step")
geompy.ExportSTEP(sphere, f_step, GEOM.LU_MILLIMETER)
f_stl1 = os.path.join(tmpdir, "sphere1.stl")
geompy.ExportSTL(sphere, f_stl1, False)
f_stl2 = os.path.join(tmpdir, "sphere2.stl")
geompy.ExportSTL(sphere, f_stl2, True, 0.1)
f_vtk1 = os.path.join(tmpdir, "sphere1.vtk")
geompy.ExportVTK(sphere, f_vtk1)
f_vtk2 = os.path.join(tmpdir, "sphere2.vtk")
geompy.ExportVTK(sphere, f_vtk2, 0.1)
f_xao = os.path.join(tmpdir, "sphere.xao")
geompy.ExportXAO(sphere, [], [], "author", f_xao)
buff_xao = geompy.ExportXAOMem(sphere, [], [], "author")
sphere_brep = geompy.ImportBREP(f_brep)
sphere_iges = geompy.ImportIGES(f_iges)
sphere_step1 = geompy.ImportSTEP(f_step)
sphere_step2 = geompy.ImportSTEP(f_step, True)
sphere_stl1 = geompy.ImportSTL(f_stl1)
sphere_stl2 = geompy.ImportSTL(f_stl2)
ok, sphere_xao, sub_shapes, groups, fields = geompy.ImportXAO(f_xao)
ok_mem, sphere_xao_mem, sub_shapes_mem, groups_mem, fields_mem = geompy.ImportXAOMem(buff_xao)
for f in f_brep, f_iges, f_step, f_stl1, f_stl2, f_vtk1, f_vtk2, f_xao:
os.remove(f)
os.rmdir(tmpdir)