diff --git a/doc/salome/examples/3dsketcher.py b/doc/salome/examples/3dsketcher.py
index 69b779898..29f88e710 100644
--- a/doc/salome/examples/3dsketcher.py
+++ b/doc/salome/examples/3dsketcher.py
@@ -1,7 +1,10 @@
# 3D Sketcher
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# Create a 3D sketcher (wire) on the given points coordinates
diff --git a/doc/salome/examples/GEOM_box.py b/doc/salome/examples/GEOM_box.py
new file mode 100644
index 000000000..1d9864b2f
--- /dev/null
+++ b/doc/salome/examples/GEOM_box.py
@@ -0,0 +1,16 @@
+# --- salome initialization
+import salome
+salome.salome_init()
+
+# --- geom Python interface
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+# --- Create a box and publish it into the salome study
+Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
+geompy.addToStudy( Box_1, 'Box_1' )
+
+# --- update the study object browser
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)
diff --git a/doc/salome/examples/Makefile.am b/doc/salome/examples/Makefile.am
index 506afc7af..171c03674 100644
--- a/doc/salome/examples/Makefile.am
+++ b/doc/salome/examples/Makefile.am
@@ -74,6 +74,7 @@ GOOD_TESTS = \
complex_objs_ex10.py \
free_boundaries.py \
free_faces.py \
+ GEOM_box.py \
get_non_blocks.py \
import_export.py \
inertia.py \
diff --git a/doc/salome/examples/advanced_geom_objs_ex01.py b/doc/salome/examples/advanced_geom_objs_ex01.py
index 036fe8f4e..b2499e906 100644
--- a/doc/salome/examples/advanced_geom_objs_ex01.py
+++ b/doc/salome/examples/advanced_geom_objs_ex01.py
@@ -1,7 +1,10 @@
# Creation of PipeTShape
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create PipeTShape object
diff --git a/doc/salome/examples/advanced_geom_objs_ex02.py b/doc/salome/examples/advanced_geom_objs_ex02.py
index 2ee301688..442af631e 100644
--- a/doc/salome/examples/advanced_geom_objs_ex02.py
+++ b/doc/salome/examples/advanced_geom_objs_ex02.py
@@ -1,8 +1,10 @@
# Creation of DividedDisk
-import geompy
import salome
+salome.salome_init()
import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create DividedDisk object
diff --git a/doc/salome/examples/advanced_geom_objs_ex03.py b/doc/salome/examples/advanced_geom_objs_ex03.py
index 195cda0dd..915ee1586 100644
--- a/doc/salome/examples/advanced_geom_objs_ex03.py
+++ b/doc/salome/examples/advanced_geom_objs_ex03.py
@@ -1,8 +1,10 @@
# Creation of DividedCylinder
-import geompy
import salome
+salome.salome_init()
import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create DividedCylinder object
diff --git a/doc/salome/examples/angle.py b/doc/salome/examples/angle.py
index 324d72653..1fd60440f 100644
--- a/doc/salome/examples/angle.py
+++ b/doc/salome/examples/angle.py
@@ -2,10 +2,10 @@
import salome
salome.salome_init()
-
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import math
-import geompy
-geompy.init_geom(salome.myStudy)
OX = geompy.MakeVectorDXDYDZ(10, 0,0)
OXY = geompy.MakeVectorDXDYDZ(10,10,0)
diff --git a/doc/salome/examples/basic_geom_objs_ex01.py b/doc/salome/examples/basic_geom_objs_ex01.py
index 05abb799d..1501633ca 100644
--- a/doc/salome/examples/basic_geom_objs_ex01.py
+++ b/doc/salome/examples/basic_geom_objs_ex01.py
@@ -1,7 +1,10 @@
# Creation of a Point
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/basic_geom_objs_ex02.py b/doc/salome/examples/basic_geom_objs_ex02.py
index 02f87e910..858548f23 100644
--- a/doc/salome/examples/basic_geom_objs_ex02.py
+++ b/doc/salome/examples/basic_geom_objs_ex02.py
@@ -1,7 +1,10 @@
# Creation of a Line
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/basic_geom_objs_ex03.py b/doc/salome/examples/basic_geom_objs_ex03.py
index 510ae18fc..d7bdf2feb 100644
--- a/doc/salome/examples/basic_geom_objs_ex03.py
+++ b/doc/salome/examples/basic_geom_objs_ex03.py
@@ -1,7 +1,10 @@
# Creation of a Circle
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/basic_geom_objs_ex04.py b/doc/salome/examples/basic_geom_objs_ex04.py
index bf7d3e870..51a1304d4 100644
--- a/doc/salome/examples/basic_geom_objs_ex04.py
+++ b/doc/salome/examples/basic_geom_objs_ex04.py
@@ -1,7 +1,10 @@
# Creation of an Ellipse
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/basic_geom_objs_ex05.py b/doc/salome/examples/basic_geom_objs_ex05.py
index 5a82c3b1b..fe24424cc 100644
--- a/doc/salome/examples/basic_geom_objs_ex05.py
+++ b/doc/salome/examples/basic_geom_objs_ex05.py
@@ -1,7 +1,10 @@
# Creation of an Arc
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/basic_geom_objs_ex06.py b/doc/salome/examples/basic_geom_objs_ex06.py
index ba4940c14..661b0edef 100644
--- a/doc/salome/examples/basic_geom_objs_ex06.py
+++ b/doc/salome/examples/basic_geom_objs_ex06.py
@@ -1,7 +1,10 @@
# Creation of a Curve
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices and vectors
@@ -27,13 +30,13 @@ interpol = geompy.MakeInterpol([p0, p1, p2, p3, p4], False)
interpol_tangents = geompy.MakeInterpolWithTangents([p0, p1, p2, p3, p4], v1, v2)
#create a polyline using parametric definition of the basic points
-param_polyline = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 100, geompy.GEOM.Polyline, theNewMethod=True)
+param_polyline = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 100, GEOM.Polyline, theNewMethod=True)
# create a bezier curve using parametric definition of the basic points
-param_bezier = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 20, geompy.GEOM.Bezier, theNewMethod=True)
+param_bezier = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 20, GEOM.Bezier, theNewMethod=True)
#create a b-spline curve using parametric definition of the basic points
-param_interpol = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 100, geompy.GEOM.Interpolation, theNewMethod=True)
+param_interpol = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 100, GEOM.Interpolation, theNewMethod=True)
# add objects in the study
diff --git a/doc/salome/examples/basic_geom_objs_ex07.py b/doc/salome/examples/basic_geom_objs_ex07.py
index 2de687af0..04673b1f4 100644
--- a/doc/salome/examples/basic_geom_objs_ex07.py
+++ b/doc/salome/examples/basic_geom_objs_ex07.py
@@ -1,7 +1,10 @@
# Creation of a Vector
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/basic_geom_objs_ex08.py b/doc/salome/examples/basic_geom_objs_ex08.py
index 81a8745c5..707540a06 100644
--- a/doc/salome/examples/basic_geom_objs_ex08.py
+++ b/doc/salome/examples/basic_geom_objs_ex08.py
@@ -1,7 +1,10 @@
# Creation of a Plane
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/basic_geom_objs_ex09.py b/doc/salome/examples/basic_geom_objs_ex09.py
index 3934410ee..91fa3ce6d 100644
--- a/doc/salome/examples/basic_geom_objs_ex09.py
+++ b/doc/salome/examples/basic_geom_objs_ex09.py
@@ -1,7 +1,10 @@
# Creation of a Local Coordinate System
+import salome
+salome.salome_init()
import GEOM
-import geompy
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import math
import SALOMEDS
diff --git a/doc/salome/examples/basic_operations_ex01.py b/doc/salome/examples/basic_operations_ex01.py
index bed9e1c86..b9152729f 100644
--- a/doc/salome/examples/basic_operations_ex01.py
+++ b/doc/salome/examples/basic_operations_ex01.py
@@ -1,7 +1,10 @@
# Partition
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/basic_operations_ex02.py b/doc/salome/examples/basic_operations_ex02.py
index ac9b77b9d..ff102f0d5 100644
--- a/doc/salome/examples/basic_operations_ex02.py
+++ b/doc/salome/examples/basic_operations_ex02.py
@@ -1,7 +1,10 @@
# Archimede
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/basic_operations_ex03.py b/doc/salome/examples/basic_operations_ex03.py
index 39b1dd22b..5fa0e9e0a 100644
--- a/doc/salome/examples/basic_operations_ex03.py
+++ b/doc/salome/examples/basic_operations_ex03.py
@@ -1,7 +1,10 @@
# Restore presentation parameters and sub-shapes
-import geompy
+import salome
+salome.salome_init()
import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import SALOMEDS
# create a box and a cylinder
diff --git a/doc/salome/examples/basic_properties.py b/doc/salome/examples/basic_properties.py
index 239655901..ce6e45a9c 100644
--- a/doc/salome/examples/basic_properties.py
+++ b/doc/salome/examples/basic_properties.py
@@ -1,6 +1,10 @@
# Basic Properties
-import geompy
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import math
# create a box
diff --git a/doc/salome/examples/blocks_operations_ex01.py b/doc/salome/examples/blocks_operations_ex01.py
index 5535f121d..d8040637c 100644
--- a/doc/salome/examples/blocks_operations_ex01.py
+++ b/doc/salome/examples/blocks_operations_ex01.py
@@ -1,7 +1,10 @@
# Multi Transformation
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/blocks_operations_ex02.py b/doc/salome/examples/blocks_operations_ex02.py
index 68fbb01a6..03deab0a6 100644
--- a/doc/salome/examples/blocks_operations_ex02.py
+++ b/doc/salome/examples/blocks_operations_ex02.py
@@ -1,7 +1,10 @@
# Explode on Blocks
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a box and a sphere
diff --git a/doc/salome/examples/blocks_operations_ex03.py b/doc/salome/examples/blocks_operations_ex03.py
index 268a52e10..c38bf6c83 100644
--- a/doc/salome/examples/blocks_operations_ex03.py
+++ b/doc/salome/examples/blocks_operations_ex03.py
@@ -1,7 +1,10 @@
# Propagate
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create a box
check_box = geompy.MakeBoxDXDYDZ(200, 200, 200)
diff --git a/doc/salome/examples/boolean_operations_ex01.py b/doc/salome/examples/boolean_operations_ex01.py
index 5f52542c6..01809955e 100644
--- a/doc/salome/examples/boolean_operations_ex01.py
+++ b/doc/salome/examples/boolean_operations_ex01.py
@@ -1,7 +1,10 @@
# Fuse
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/boolean_operations_ex02.py b/doc/salome/examples/boolean_operations_ex02.py
index b7e73b727..90317ba93 100644
--- a/doc/salome/examples/boolean_operations_ex02.py
+++ b/doc/salome/examples/boolean_operations_ex02.py
@@ -1,7 +1,10 @@
# Common
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/boolean_operations_ex03.py b/doc/salome/examples/boolean_operations_ex03.py
index 44c597405..7c97b09f0 100644
--- a/doc/salome/examples/boolean_operations_ex03.py
+++ b/doc/salome/examples/boolean_operations_ex03.py
@@ -1,7 +1,10 @@
# Cut
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/boolean_operations_ex04.py b/doc/salome/examples/boolean_operations_ex04.py
index 9472f7aa1..a7da6a9af 100644
--- a/doc/salome/examples/boolean_operations_ex04.py
+++ b/doc/salome/examples/boolean_operations_ex04.py
@@ -1,7 +1,10 @@
# Section
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/bounding_box.py b/doc/salome/examples/bounding_box.py
index d6480aeac..ed8736b98 100644
--- a/doc/salome/examples/bounding_box.py
+++ b/doc/salome/examples/bounding_box.py
@@ -1,6 +1,10 @@
# Bounding Box
-import geompy
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create a box
box = geompy.MakeBoxDXDYDZ(100,30,100)
diff --git a/doc/salome/examples/building_by_blocks_ex01.py b/doc/salome/examples/building_by_blocks_ex01.py
index 16b02d75b..fe93e7c4c 100644
--- a/doc/salome/examples/building_by_blocks_ex01.py
+++ b/doc/salome/examples/building_by_blocks_ex01.py
@@ -1,7 +1,10 @@
# Quadrangle Face
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/building_by_blocks_ex02.py b/doc/salome/examples/building_by_blocks_ex02.py
index ed81f4233..8d40beec5 100644
--- a/doc/salome/examples/building_by_blocks_ex02.py
+++ b/doc/salome/examples/building_by_blocks_ex02.py
@@ -1,7 +1,10 @@
# Hexagonal Solid
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/center_of_mass.py b/doc/salome/examples/center_of_mass.py
index acf5962ff..9e570f318 100644
--- a/doc/salome/examples/center_of_mass.py
+++ b/doc/salome/examples/center_of_mass.py
@@ -1,6 +1,10 @@
# Center of masses
-import geompy
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import math
# create a box
diff --git a/doc/salome/examples/check_compound_of_blocks.py b/doc/salome/examples/check_compound_of_blocks.py
index 2f1ba9850..26f7c3012 100644
--- a/doc/salome/examples/check_compound_of_blocks.py
+++ b/doc/salome/examples/check_compound_of_blocks.py
@@ -1,7 +1,10 @@
# Check Compound of Blocks
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create boxes
diff --git a/doc/salome/examples/check_self_intersections.py b/doc/salome/examples/check_self_intersections.py
index 44c55d257..8df91b9fe 100644
--- a/doc/salome/examples/check_self_intersections.py
+++ b/doc/salome/examples/check_self_intersections.py
@@ -1,6 +1,10 @@
# Detect Self-intersections
-import geompy
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create a box
box = geompy.MakeBoxDXDYDZ(100,30,100)
diff --git a/doc/salome/examples/check_shape.py b/doc/salome/examples/check_shape.py
index b708494b3..30793345e 100644
--- a/doc/salome/examples/check_shape.py
+++ b/doc/salome/examples/check_shape.py
@@ -1,6 +1,10 @@
# Check Shape
-import geompy
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create a box
box = geompy.MakeBoxDXDYDZ(100,30,100)
diff --git a/doc/salome/examples/complex_objs_ex01.py b/doc/salome/examples/complex_objs_ex01.py
index a5cf102c8..5a04f3a76 100644
--- a/doc/salome/examples/complex_objs_ex01.py
+++ b/doc/salome/examples/complex_objs_ex01.py
@@ -1,7 +1,10 @@
# Creation of a Prism
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/complex_objs_ex02.py b/doc/salome/examples/complex_objs_ex02.py
index e096551fd..ec9f85729 100644
--- a/doc/salome/examples/complex_objs_ex02.py
+++ b/doc/salome/examples/complex_objs_ex02.py
@@ -1,7 +1,10 @@
# Creation of a Revolution
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/complex_objs_ex03.py b/doc/salome/examples/complex_objs_ex03.py
index ec7767b2a..35ccf0857 100644
--- a/doc/salome/examples/complex_objs_ex03.py
+++ b/doc/salome/examples/complex_objs_ex03.py
@@ -1,7 +1,10 @@
# Creation of a Filling
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
mindeg = 2
diff --git a/doc/salome/examples/complex_objs_ex04.py b/doc/salome/examples/complex_objs_ex04.py
index 72af08f29..4bff05d17 100644
--- a/doc/salome/examples/complex_objs_ex04.py
+++ b/doc/salome/examples/complex_objs_ex04.py
@@ -1,7 +1,10 @@
# Creation of a Pipe
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/complex_objs_ex05.py b/doc/salome/examples/complex_objs_ex05.py
index 724810c58..f38f0816b 100644
--- a/doc/salome/examples/complex_objs_ex05.py
+++ b/doc/salome/examples/complex_objs_ex05.py
@@ -1,7 +1,10 @@
# Creation of a PipeWithDifferentSections
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
Wire_1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 100 0:R 0:C 100 90:T 0 200", [0, 0, 0, 0, 0, 1, 1, 0, -0])
diff --git a/doc/salome/examples/complex_objs_ex06.py b/doc/salome/examples/complex_objs_ex06.py
index 4a3dfe439..caa68c4c0 100644
--- a/doc/salome/examples/complex_objs_ex06.py
+++ b/doc/salome/examples/complex_objs_ex06.py
@@ -1,7 +1,10 @@
# Creation of a PipeWithShellSections
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import math
gg = salome.ImportComponentGUI("GEOM")
diff --git a/doc/salome/examples/complex_objs_ex07.py b/doc/salome/examples/complex_objs_ex07.py
index 1b37a2e39..d9e72ae96 100644
--- a/doc/salome/examples/complex_objs_ex07.py
+++ b/doc/salome/examples/complex_objs_ex07.py
@@ -1,7 +1,10 @@
# Creation of a PipeShellsWithoutPath
-import geompy
-import math
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import salome
gg = salome.ImportComponentGUI("GEOM")
diff --git a/doc/salome/examples/complex_objs_ex08.py b/doc/salome/examples/complex_objs_ex08.py
index 4777e071b..bb4cac595 100644
--- a/doc/salome/examples/complex_objs_ex08.py
+++ b/doc/salome/examples/complex_objs_ex08.py
@@ -1,4 +1,9 @@
# Creation of a PipeBiNormalAlongVector
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
def MakeHelix(radius, height, rotation, direction):
# - create a helix -
@@ -14,7 +19,6 @@ def MakeHelix(radius, height, rotation, direction):
length_z = height
length_xy = radius*rotation
length = sqrt(length_z*length_z + length_xy*length_xy)
- import geompy
nb_steps = 1
epsilon = 1.0e-6
while 1:
@@ -48,7 +52,6 @@ def MakeSpring(radius, height, rotation, direction, thread_radius, base_rotation
# create a helix
helix = MakeHelix(radius, height, rotation, direction)
# base in the (Ox, Oz) plane
- import geompy
p0 = geompy.MakeVertex(radius-3*thread_radius, 0.0, -thread_radius)
p1 = geompy.MakeVertex(radius+3*thread_radius, 0.0, -thread_radius)
p2 = geompy.MakeVertex(radius+3*thread_radius, 0.0, +thread_radius)
diff --git a/doc/salome/examples/complex_objs_ex09.py b/doc/salome/examples/complex_objs_ex09.py
index 55c347a1f..9615ad1ef 100644
--- a/doc/salome/examples/complex_objs_ex09.py
+++ b/doc/salome/examples/complex_objs_ex09.py
@@ -1,7 +1,10 @@
# Creation of a Middle Path
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# Create a box
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
diff --git a/doc/salome/examples/complex_objs_ex10.py b/doc/salome/examples/complex_objs_ex10.py
index 8a14455ef..b51281505 100644
--- a/doc/salome/examples/complex_objs_ex10.py
+++ b/doc/salome/examples/complex_objs_ex10.py
@@ -1,7 +1,10 @@
# Creation of Tangent Plane On Face
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# Create Vertexes for curve
Vertex_1 = geompy.MakeVertex(0, 0, 0)
diff --git a/doc/salome/examples/free_boundaries.py b/doc/salome/examples/free_boundaries.py
index 7582f79dc..d36bbbbf7 100644
--- a/doc/salome/examples/free_boundaries.py
+++ b/doc/salome/examples/free_boundaries.py
@@ -1,8 +1,11 @@
# Check Free Boundaries
import os
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create boxes
diff --git a/doc/salome/examples/free_faces.py b/doc/salome/examples/free_faces.py
index 16d705614..2d1de5a00 100644
--- a/doc/salome/examples/free_faces.py
+++ b/doc/salome/examples/free_faces.py
@@ -1,7 +1,10 @@
# Check Free Faces
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/get_non_blocks.py b/doc/salome/examples/get_non_blocks.py
index 267fa870a..87bf934a6 100644
--- a/doc/salome/examples/get_non_blocks.py
+++ b/doc/salome/examples/get_non_blocks.py
@@ -1,7 +1,10 @@
# Get Non Blocks
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create solids
box = geompy.MakeBoxDXDYDZ(100, 100, 100)
diff --git a/doc/salome/examples/import_export.py b/doc/salome/examples/import_export.py
index ecde2442f..158fc6375 100644
--- a/doc/salome/examples/import_export.py
+++ b/doc/salome/examples/import_export.py
@@ -1,7 +1,10 @@
# Import/Export
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# Example of import from IGES using various formats
diff --git a/doc/salome/examples/inertia.py b/doc/salome/examples/inertia.py
index 203a39436..a63608c12 100644
--- a/doc/salome/examples/inertia.py
+++ b/doc/salome/examples/inertia.py
@@ -1,7 +1,10 @@
# Inertia
-import geompy
-import math
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create a box
box = geompy.MakeBoxDXDYDZ(100,30,100)
diff --git a/doc/salome/examples/min_distance.py b/doc/salome/examples/min_distance.py
index e6048bba2..e48804b30 100644
--- a/doc/salome/examples/min_distance.py
+++ b/doc/salome/examples/min_distance.py
@@ -1,6 +1,10 @@
# Minimal Distance
-import geompy
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# Create two curves with three closest points
Vertex_1 = geompy.MakeVertex(0, 0, 0)
diff --git a/doc/salome/examples/normal_face.py b/doc/salome/examples/normal_face.py
index 572b0f9f8..91eac0b5a 100644
--- a/doc/salome/examples/normal_face.py
+++ b/doc/salome/examples/normal_face.py
@@ -1,6 +1,10 @@
# Normal to a Face
-import geompy
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import math
# create a box
diff --git a/doc/salome/examples/notebook_geom.py b/doc/salome/examples/notebook_geom.py
index a84ae87de..5b52d9f2c 100644
--- a/doc/salome/examples/notebook_geom.py
+++ b/doc/salome/examples/notebook_geom.py
@@ -1,7 +1,10 @@
# Using SALOME NoteBook
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import salome_notebook
gg = salome.ImportComponentGUI("GEOM")
diff --git a/doc/salome/examples/point_coordinates.py b/doc/salome/examples/point_coordinates.py
index 802c88ca5..e31569b69 100644
--- a/doc/salome/examples/point_coordinates.py
+++ b/doc/salome/examples/point_coordinates.py
@@ -1,7 +1,11 @@
# Point Coordinates
import math
-import geompy
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create a point
point = geompy.MakeVertex(15., 23., 80.)
diff --git a/doc/salome/examples/primitives_ex01.py b/doc/salome/examples/primitives_ex01.py
index 77db019cd..41590a544 100644
--- a/doc/salome/examples/primitives_ex01.py
+++ b/doc/salome/examples/primitives_ex01.py
@@ -1,7 +1,10 @@
# Creation of a Box
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/primitives_ex02.py b/doc/salome/examples/primitives_ex02.py
index ed6a6f9a6..d55d6510f 100644
--- a/doc/salome/examples/primitives_ex02.py
+++ b/doc/salome/examples/primitives_ex02.py
@@ -1,7 +1,10 @@
# Creation of a Cylinder
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
diff --git a/doc/salome/examples/primitives_ex03.py b/doc/salome/examples/primitives_ex03.py
index 21dbc9e7e..4f07701ef 100644
--- a/doc/salome/examples/primitives_ex03.py
+++ b/doc/salome/examples/primitives_ex03.py
@@ -1,7 +1,10 @@
# Creation of a Sphere
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex
diff --git a/doc/salome/examples/primitives_ex04.py b/doc/salome/examples/primitives_ex04.py
index 99a003a4b..4e27ac41c 100644
--- a/doc/salome/examples/primitives_ex04.py
+++ b/doc/salome/examples/primitives_ex04.py
@@ -1,7 +1,10 @@
# Creation of a Torus
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/primitives_ex05.py b/doc/salome/examples/primitives_ex05.py
index b563303b2..61fcc3846 100644
--- a/doc/salome/examples/primitives_ex05.py
+++ b/doc/salome/examples/primitives_ex05.py
@@ -1,7 +1,10 @@
# Creation of a Cone
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/primitives_ex06.py b/doc/salome/examples/primitives_ex06.py
index d3fd53e35..b639ec0ca 100644
--- a/doc/salome/examples/primitives_ex06.py
+++ b/doc/salome/examples/primitives_ex06.py
@@ -1,7 +1,10 @@
# Creation of a Disk
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/primitives_ex07.py b/doc/salome/examples/primitives_ex07.py
index 75dad1e94..e5989dfe4 100644
--- a/doc/salome/examples/primitives_ex07.py
+++ b/doc/salome/examples/primitives_ex07.py
@@ -1,7 +1,10 @@
# Creation of a Rectangle
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/repairing_operations_ex01.py b/doc/salome/examples/repairing_operations_ex01.py
index 8a57db040..dc937caf0 100644
--- a/doc/salome/examples/repairing_operations_ex01.py
+++ b/doc/salome/examples/repairing_operations_ex01.py
@@ -1,7 +1,10 @@
# Shape Processing
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices, an edge, an arc, a wire, a face and a prism
diff --git a/doc/salome/examples/repairing_operations_ex02.py b/doc/salome/examples/repairing_operations_ex02.py
index f5ee65caf..344ec4bff 100644
--- a/doc/salome/examples/repairing_operations_ex02.py
+++ b/doc/salome/examples/repairing_operations_ex02.py
@@ -1,7 +1,10 @@
# Suppress Faces
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a box
diff --git a/doc/salome/examples/repairing_operations_ex03.py b/doc/salome/examples/repairing_operations_ex03.py
index 50eec1126..8b8baedbd 100644
--- a/doc/salome/examples/repairing_operations_ex03.py
+++ b/doc/salome/examples/repairing_operations_ex03.py
@@ -1,7 +1,10 @@
# Close Contour
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices and vectors
diff --git a/doc/salome/examples/repairing_operations_ex04.py b/doc/salome/examples/repairing_operations_ex04.py
index fad69131c..242b17231 100644
--- a/doc/salome/examples/repairing_operations_ex04.py
+++ b/doc/salome/examples/repairing_operations_ex04.py
@@ -1,7 +1,10 @@
# Suppress Internal Wires
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/repairing_operations_ex05.py b/doc/salome/examples/repairing_operations_ex05.py
index b7534ab65..e5fef2bb5 100644
--- a/doc/salome/examples/repairing_operations_ex05.py
+++ b/doc/salome/examples/repairing_operations_ex05.py
@@ -1,8 +1,10 @@
# Suppress Holes
-import geompy
import salome
+salome.salome_init()
import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/repairing_operations_ex06.py b/doc/salome/examples/repairing_operations_ex06.py
index e6120a7a6..8935962bf 100644
--- a/doc/salome/examples/repairing_operations_ex06.py
+++ b/doc/salome/examples/repairing_operations_ex06.py
@@ -1,7 +1,10 @@
# Sewing
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import math
gg = salome.ImportComponentGUI("GEOM")
diff --git a/doc/salome/examples/repairing_operations_ex07.py b/doc/salome/examples/repairing_operations_ex07.py
index 6cc688a4e..1a7ff79a4 100644
--- a/doc/salome/examples/repairing_operations_ex07.py
+++ b/doc/salome/examples/repairing_operations_ex07.py
@@ -1,7 +1,10 @@
# Glue Faces
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create boxes
diff --git a/doc/salome/examples/repairing_operations_ex08.py b/doc/salome/examples/repairing_operations_ex08.py
index a39d11088..933298eef 100644
--- a/doc/salome/examples/repairing_operations_ex08.py
+++ b/doc/salome/examples/repairing_operations_ex08.py
@@ -1,7 +1,10 @@
# Glue Edges
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create boxes
diff --git a/doc/salome/examples/repairing_operations_ex09.py b/doc/salome/examples/repairing_operations_ex09.py
index e94b1aa03..2875051d2 100644
--- a/doc/salome/examples/repairing_operations_ex09.py
+++ b/doc/salome/examples/repairing_operations_ex09.py
@@ -1,7 +1,10 @@
# Limit Tolerance
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# import initial topology with bad tolerances (more than 1e-07)
diff --git a/doc/salome/examples/repairing_operations_ex10.py b/doc/salome/examples/repairing_operations_ex10.py
index 7849a7cf5..898991b4e 100644
--- a/doc/salome/examples/repairing_operations_ex10.py
+++ b/doc/salome/examples/repairing_operations_ex10.py
@@ -1,7 +1,10 @@
# Add Point on Edge
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create vertices
p1 = geompy.MakeVertex(0,0,50)
diff --git a/doc/salome/examples/repairing_operations_ex11.py b/doc/salome/examples/repairing_operations_ex11.py
index 396881c72..1b50e6ffd 100644
--- a/doc/salome/examples/repairing_operations_ex11.py
+++ b/doc/salome/examples/repairing_operations_ex11.py
@@ -1,7 +1,10 @@
# Fuse Collinear Edges within a Wire
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create vertices
p1 = geompy.MakeVertex(0, 0, 0)
diff --git a/doc/salome/examples/sketcher.py b/doc/salome/examples/sketcher.py
index 8ca1f98ce..6cd355da9 100644
--- a/doc/salome/examples/sketcher.py
+++ b/doc/salome/examples/sketcher.py
@@ -1,7 +1,10 @@
# 2D Sketcher
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/tolerance.py b/doc/salome/examples/tolerance.py
index 639a676cf..ac72a3031 100644
--- a/doc/salome/examples/tolerance.py
+++ b/doc/salome/examples/tolerance.py
@@ -1,6 +1,10 @@
# Tolerance
-import geompy
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create a box
box = geompy.MakeBoxDXDYDZ(100,30,100)
diff --git a/doc/salome/examples/topological_geom_objs_ex01.py b/doc/salome/examples/topological_geom_objs_ex01.py
index 77c1d1807..257819c3d 100644
--- a/doc/salome/examples/topological_geom_objs_ex01.py
+++ b/doc/salome/examples/topological_geom_objs_ex01.py
@@ -1,7 +1,10 @@
# Creation of an Edge
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
#
diff --git a/doc/salome/examples/topological_geom_objs_ex02.py b/doc/salome/examples/topological_geom_objs_ex02.py
index 62806d770..eb12ea6a5 100644
--- a/doc/salome/examples/topological_geom_objs_ex02.py
+++ b/doc/salome/examples/topological_geom_objs_ex02.py
@@ -1,7 +1,10 @@
# Creation of a Wire
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/topological_geom_objs_ex03.py b/doc/salome/examples/topological_geom_objs_ex03.py
index 7b1600153..db2f060a9 100644
--- a/doc/salome/examples/topological_geom_objs_ex03.py
+++ b/doc/salome/examples/topological_geom_objs_ex03.py
@@ -1,7 +1,10 @@
# Creation of a Face
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices
diff --git a/doc/salome/examples/topological_geom_objs_ex04.py b/doc/salome/examples/topological_geom_objs_ex04.py
index b85e553f2..31a938dda 100644
--- a/doc/salome/examples/topological_geom_objs_ex04.py
+++ b/doc/salome/examples/topological_geom_objs_ex04.py
@@ -1,7 +1,10 @@
# Creation of a Shell
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
#create vertices
diff --git a/doc/salome/examples/topological_geom_objs_ex05.py b/doc/salome/examples/topological_geom_objs_ex05.py
index 700236b03..67bf79084 100644
--- a/doc/salome/examples/topological_geom_objs_ex05.py
+++ b/doc/salome/examples/topological_geom_objs_ex05.py
@@ -1,7 +1,10 @@
# Creation of a Solid
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
#create vertices
diff --git a/doc/salome/examples/topological_geom_objs_ex06.py b/doc/salome/examples/topological_geom_objs_ex06.py
index 071730b52..7ae16d8e6 100644
--- a/doc/salome/examples/topological_geom_objs_ex06.py
+++ b/doc/salome/examples/topological_geom_objs_ex06.py
@@ -1,7 +1,10 @@
# Creation of a Compound
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/transformation_operations_ex01.py b/doc/salome/examples/transformation_operations_ex01.py
index 678afa9e2..5a01039fd 100644
--- a/doc/salome/examples/transformation_operations_ex01.py
+++ b/doc/salome/examples/transformation_operations_ex01.py
@@ -1,7 +1,10 @@
# Translation
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
diff --git a/doc/salome/examples/transformation_operations_ex02.py b/doc/salome/examples/transformation_operations_ex02.py
index 7abbb7873..564e1409d 100644
--- a/doc/salome/examples/transformation_operations_ex02.py
+++ b/doc/salome/examples/transformation_operations_ex02.py
@@ -1,7 +1,10 @@
# Rotation
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import math
gg = salome.ImportComponentGUI("GEOM")
diff --git a/doc/salome/examples/transformation_operations_ex03.py b/doc/salome/examples/transformation_operations_ex03.py
index 3d250fd48..6870a3529 100644
--- a/doc/salome/examples/transformation_operations_ex03.py
+++ b/doc/salome/examples/transformation_operations_ex03.py
@@ -1,7 +1,10 @@
# Modify Location
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import math
gg = salome.ImportComponentGUI("GEOM")
diff --git a/doc/salome/examples/transformation_operations_ex04.py b/doc/salome/examples/transformation_operations_ex04.py
index 28e8b308a..ebcd1f48d 100644
--- a/doc/salome/examples/transformation_operations_ex04.py
+++ b/doc/salome/examples/transformation_operations_ex04.py
@@ -1,7 +1,10 @@
# Mirror Image
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a box
diff --git a/doc/salome/examples/transformation_operations_ex05.py b/doc/salome/examples/transformation_operations_ex05.py
index 7b906b969..948fa0087 100644
--- a/doc/salome/examples/transformation_operations_ex05.py
+++ b/doc/salome/examples/transformation_operations_ex05.py
@@ -1,7 +1,10 @@
# Scale Transform
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a box and a sphere
diff --git a/doc/salome/examples/transformation_operations_ex06.py b/doc/salome/examples/transformation_operations_ex06.py
index f6c2adfd4..64f8b6615 100644
--- a/doc/salome/examples/transformation_operations_ex06.py
+++ b/doc/salome/examples/transformation_operations_ex06.py
@@ -1,7 +1,10 @@
# Offset Surface
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a box and a sphere
diff --git a/doc/salome/examples/transformation_operations_ex07.py b/doc/salome/examples/transformation_operations_ex07.py
index c1efc39e3..206b93e80 100644
--- a/doc/salome/examples/transformation_operations_ex07.py
+++ b/doc/salome/examples/transformation_operations_ex07.py
@@ -1,7 +1,10 @@
# Projection
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create a cylindric face and a curve(edge)
cylinder = geompy.MakeCylinderRH(100, 300)
diff --git a/doc/salome/examples/transformation_operations_ex08.py b/doc/salome/examples/transformation_operations_ex08.py
index fb103f950..c26774d66 100644
--- a/doc/salome/examples/transformation_operations_ex08.py
+++ b/doc/salome/examples/transformation_operations_ex08.py
@@ -1,7 +1,10 @@
# Multi Translation
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create vertices and vectors
diff --git a/doc/salome/examples/transformation_operations_ex09.py b/doc/salome/examples/transformation_operations_ex09.py
index 665a2acb3..3467b5be6 100644
--- a/doc/salome/examples/transformation_operations_ex09.py
+++ b/doc/salome/examples/transformation_operations_ex09.py
@@ -1,7 +1,10 @@
# Multi Rotation
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
import math
diff --git a/doc/salome/examples/transformation_operations_ex10.py b/doc/salome/examples/transformation_operations_ex10.py
index cd2527331..17747db1b 100644
--- a/doc/salome/examples/transformation_operations_ex10.py
+++ b/doc/salome/examples/transformation_operations_ex10.py
@@ -1,7 +1,10 @@
# Fillet 2D
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create a face in OXY plane
diff --git a/doc/salome/examples/transformation_operations_ex11.py b/doc/salome/examples/transformation_operations_ex11.py
index f3b4bd095..a5b6e5b3a 100644
--- a/doc/salome/examples/transformation_operations_ex11.py
+++ b/doc/salome/examples/transformation_operations_ex11.py
@@ -1,7 +1,10 @@
# Fillet 1D
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create box
@@ -13,7 +16,9 @@ Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
# make fillet at given wire vertices with giver radius
Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
+id_Wire_1 = geompy.addToStudy(Wire_1, "Wire_1")
+id_Fillet_1D_1= geompy.addToStudy(Fillet_1D_1, "Fillet_1D_1")
# display disks
-gg.createAndDisplayGO(Wire_1)
-gg.createAndDisplayGO(Fillet_1D_1)
+gg.createAndDisplayGO(id_Wire_1)
+gg.createAndDisplayGO(id_Fillet_1D_1)
diff --git a/doc/salome/examples/transformation_operations_ex12.py b/doc/salome/examples/transformation_operations_ex12.py
index 1f0f31c97..a59eda05f 100644
--- a/doc/salome/examples/transformation_operations_ex12.py
+++ b/doc/salome/examples/transformation_operations_ex12.py
@@ -1,7 +1,10 @@
# Fillet
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
radius = 10.
ShapeTypeEdge = geompy.ShapeType["EDGE"]
diff --git a/doc/salome/examples/transformation_operations_ex13.py b/doc/salome/examples/transformation_operations_ex13.py
index ecc896e2b..ba857a05b 100644
--- a/doc/salome/examples/transformation_operations_ex13.py
+++ b/doc/salome/examples/transformation_operations_ex13.py
@@ -1,7 +1,10 @@
# Chamfer
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
d1 = 10.
d2 = 10.
diff --git a/doc/salome/examples/viewing_geom_objs_ex01.py b/doc/salome/examples/viewing_geom_objs_ex01.py
index 473c7f15a..0458d42bf 100644
--- a/doc/salome/examples/viewing_geom_objs_ex01.py
+++ b/doc/salome/examples/viewing_geom_objs_ex01.py
@@ -1,7 +1,10 @@
# Changing Display Mode
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
box = geompy.MakeBox(0,0,0, 50,50,50)
box2 = geompy.MakeBox(-50,-50,-50, 0,0,0)
diff --git a/doc/salome/examples/viewing_geom_objs_ex02.py b/doc/salome/examples/viewing_geom_objs_ex02.py
index fd8243d2f..b8629d61c 100644
--- a/doc/salome/examples/viewing_geom_objs_ex02.py
+++ b/doc/salome/examples/viewing_geom_objs_ex02.py
@@ -1,7 +1,10 @@
# Changing Color
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
box = geompy.MakeBox(0,0,0, 50,50,50)
sphere = geompy.MakeSphere(50,50,50, 30)
diff --git a/doc/salome/examples/viewing_geom_objs_ex03.py b/doc/salome/examples/viewing_geom_objs_ex03.py
index 381f0e9ae..9932eeec6 100644
--- a/doc/salome/examples/viewing_geom_objs_ex03.py
+++ b/doc/salome/examples/viewing_geom_objs_ex03.py
@@ -1,7 +1,10 @@
# Changing Transparency
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
box = geompy.MakeBox(0,0,0, 50,50,50)
sphere = geompy.MakeSphere(50,50,50, 30)
diff --git a/doc/salome/examples/viewing_geom_objs_ex04.py b/doc/salome/examples/viewing_geom_objs_ex04.py
index f31edefee..cbfcf40e6 100644
--- a/doc/salome/examples/viewing_geom_objs_ex04.py
+++ b/doc/salome/examples/viewing_geom_objs_ex04.py
@@ -1,8 +1,10 @@
# Set Point Marker
import salome
-import geompy
+salome.salome_init()
import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
texture = geompy.LoadTexture(os.getenv("DATA_DIR")+"/Textures/texture1.dat")
diff --git a/doc/salome/examples/whatis.py b/doc/salome/examples/whatis.py
index 42e7e4e4d..632ab6226 100644
--- a/doc/salome/examples/whatis.py
+++ b/doc/salome/examples/whatis.py
@@ -1,6 +1,10 @@
# What Is
-import geompy
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create a box
box = geompy.MakeBoxDXDYDZ(100,30,100)
diff --git a/doc/salome/examples/working_with_groups_ex01.py b/doc/salome/examples/working_with_groups_ex01.py
index 821862f4a..26678d58f 100644
--- a/doc/salome/examples/working_with_groups_ex01.py
+++ b/doc/salome/examples/working_with_groups_ex01.py
@@ -1,7 +1,10 @@
# Creation of a group
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create two vertices
diff --git a/doc/salome/examples/working_with_groups_ex02.py b/doc/salome/examples/working_with_groups_ex02.py
index 4c415babe..6531cbfc9 100644
--- a/doc/salome/examples/working_with_groups_ex02.py
+++ b/doc/salome/examples/working_with_groups_ex02.py
@@ -1,7 +1,10 @@
# Adding an object to the group
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create two vertices
diff --git a/doc/salome/examples/working_with_groups_ex03.py b/doc/salome/examples/working_with_groups_ex03.py
index 2c8a3d5f3..0170d54ed 100644
--- a/doc/salome/examples/working_with_groups_ex03.py
+++ b/doc/salome/examples/working_with_groups_ex03.py
@@ -1,7 +1,10 @@
# Removing an object from the group
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
gg = salome.ImportComponentGUI("GEOM")
# create two vertices
diff --git a/doc/salome/examples/working_with_groups_ex04.py b/doc/salome/examples/working_with_groups_ex04.py
index 945ae61fc..af9fc6f12 100644
--- a/doc/salome/examples/working_with_groups_ex04.py
+++ b/doc/salome/examples/working_with_groups_ex04.py
@@ -1,7 +1,10 @@
# Union Groups
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create a box and some groups of faces on it
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
diff --git a/doc/salome/examples/working_with_groups_ex05.py b/doc/salome/examples/working_with_groups_ex05.py
index 422c67274..50af27d5e 100644
--- a/doc/salome/examples/working_with_groups_ex05.py
+++ b/doc/salome/examples/working_with_groups_ex05.py
@@ -1,7 +1,10 @@
# Intersect Groups
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create a box and some groups of faces on it
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
diff --git a/doc/salome/examples/working_with_groups_ex06.py b/doc/salome/examples/working_with_groups_ex06.py
index 65c4fe21e..27fb6d509 100644
--- a/doc/salome/examples/working_with_groups_ex06.py
+++ b/doc/salome/examples/working_with_groups_ex06.py
@@ -1,7 +1,10 @@
# Cut Groups
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# create a box and some groups of faces on it
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
diff --git a/doc/salome/gui/GEOM/Makefile.am b/doc/salome/gui/GEOM/Makefile.am
index 4f3011e40..7454eb2ce 100755
--- a/doc/salome/gui/GEOM/Makefile.am
+++ b/doc/salome/gui/GEOM/Makefile.am
@@ -30,10 +30,6 @@ guidocdir = $(docdir)/gui/GEOM
guidoc_DATA = images/head.png static/SALOME_BOA_PA.pdf
usr_docs: doxyfile_tui doxyfile_py doxyfile
- echo "===========================================" ; \
- echo "Replacing geompyDC by geompy" ; \
- echo "===========================================" ; \
- $(KERNEL_ROOT_DIR)/bin/salome/prepare_generating_doc.py geompy.py $(top_srcdir)/src/GEOM_SWIG/geompyDC.py geompy ; \
echo "===========================================" ; \
echo "Generating examples documentation" ; \
echo "===========================================" ; \
diff --git a/doc/salome/gui/GEOM/doxyfile_py.in b/doc/salome/gui/GEOM/doxyfile_py.in
index 6da7b1512..56ae4db87 100755
--- a/doc/salome/gui/GEOM/doxyfile_py.in
+++ b/doc/salome/gui/GEOM/doxyfile_py.in
@@ -60,7 +60,7 @@ HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = YES
CASE_SENSE_NAMES = YES
-HIDE_SCOPE_NAMES = NO
+HIDE_SCOPE_NAMES = YES
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = NO
@@ -99,7 +99,7 @@ EXAMPLE_RECURSIVE = NO
#---------------------------------------------------------------------------
#Input related options
#---------------------------------------------------------------------------
-INPUT = geompy.py @top_srcdir@/src/GEOM_SWIG/gsketcher.py @top_srcdir@/idl/GEOM_Gen.idl
+INPUT = @top_srcdir@/src/GEOM_SWIG/geomBuilder.py @top_srcdir@/src/GEOM_SWIG/gsketcher.py @top_srcdir@/idl/GEOM_Gen.idl
FILE_PATTERNS =
IMAGE_PATH = @srcdir@/images
EXAMPLE_PATH = @top_srcdir@/src/GEOM_SWIG
diff --git a/doc/salome/gui/GEOM/input/geometrical_object_properties.doc b/doc/salome/gui/GEOM/input/geometrical_object_properties.doc
index a5b55449a..2d9653716 100644
--- a/doc/salome/gui/GEOM/input/geometrical_object_properties.doc
+++ b/doc/salome/gui/GEOM/input/geometrical_object_properties.doc
@@ -73,7 +73,12 @@ that allows converting the geometrical object id value to its string representat
For example, the output of the following code:
\code
-import geompy
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
box = geompy.MakeBoxDXDYDZ(10,10,10)
type = geompy.ShapeIdToType(box.GetType())
print type
@@ -94,8 +99,12 @@ of the \b GEOM_Object interface.
For example:
\code
-import geompy
+import salome
+salome.salome_init()
import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
box = geompy.MakeBoxDXDYDZ(10,10,10)
type = box.GetShapeType()
print type == GEOM.SOLID
diff --git a/doc/salome/gui/GEOM/input/geompy.doc b/doc/salome/gui/GEOM/input/geompy.doc
index f34f87fe1..c6411b7de 100644
--- a/doc/salome/gui/GEOM/input/geompy.doc
+++ b/doc/salome/gui/GEOM/input/geompy.doc
@@ -1,15 +1,20 @@
/*!
-\page geompy_page Python Interface geompy.py
+\page geompy_page Python Interface geomBuilder.py
\n Please, see
-structured documentation for geompy.py,
+structured documentation for geomBuilder.py,
where all package functionality is separated in groups by purpose.
-\n Also you can find any function in the \ref geompy
-"linear documentation for geompy.py".
+\n Also you can find any function in the \ref GEOM_SWIG.geomBuilder
+"linear documentation for geomBuilder.py".
-By the links below you can find sample scripts for all operations
+\n
+\anchor tui_sample_geom_script
+
GEOM Python script example
+\tui_script{GEOM_box.py}
+
+\n By the links below you can find sample scripts for all operations
provided by Geometry module.
diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx
index 88d5dec98..003a55332 100644
--- a/src/GEOM/GEOM_Engine.cxx
+++ b/src/GEOM/GEOM_Engine.cxx
@@ -602,13 +602,13 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
}
aScript = "import GEOM\n";
- aScript += "import geompy\n";
+ aScript += "from salome.geom import geomBuilder\n";
aScript += "import math\n";
aScript += "import SALOMEDS\n\n";
if( isMultiFile )
aScript += "def RebuildData(theStudy):";
- aScript += "\n\tgeompy.init_geom(theStudy)\n";
+ aScript += "\n\tgeompy = geomBuilder.New(theStudy)\n";
AddTextures(theDocID, aScript);
diff --git a/src/GEOM_PY/geomtools.py b/src/GEOM_PY/geomtools.py
index 439da20ef..4f9a01044 100644
--- a/src/GEOM_PY/geomtools.py
+++ b/src/GEOM_PY/geomtools.py
@@ -52,17 +52,9 @@ def getGeompy(studyId = None):
if studyId is None:
studyId = getActiveStudyId()
if not _geompys.has_key(studyId):
- import geompyDC
- _geompys[studyId] = salome.lcc.FindOrLoadComponent("FactoryServer",
- "GEOM")
- _geompys[studyId].ShapeType = geompyDC.ShapeType
- _geompys[studyId].GEOM = geompyDC.GEOM
- _geompys[studyId].kind = geompyDC.kind
- _geompys[studyId].info = geompyDC.info
- _geompys[studyId].PackData = geompyDC.PackData
- _geompys[studyId].ReadTexture = geompyDC.ReadTexture
+ from salome.geom import geomBuilder
study = salome.myStudyManager.GetStudyByID(studyId)
- _geompys[studyId].init_geom(study)
+ _geompys[studyId] = geomBuilder.New(study)
return _geompys[studyId]
diff --git a/src/GEOM_PY/sketcher.py b/src/GEOM_PY/sketcher.py
index 47210959a..7a20387ec 100644
--- a/src/GEOM_PY/sketcher.py
+++ b/src/GEOM_PY/sketcher.py
@@ -38,7 +38,8 @@ Example::
wire = mysketcher.getGeomWire()
# Put it in the study
- import geompy
+ from salome.geom import geomBuilder
+ geompy = geomBuilder.New(salome.myStudy)
geompy.addToStudy( wire, 'mysketch' )
Additionnal examples can be found as unit tests in the source code.
@@ -46,7 +47,11 @@ Additionnal examples can be found as unit tests in the source code.
geompyEnable = True
try:
- import geompy
+ import salome
+ salome.salome_init()
+ import GEOM
+ from salome.geom import geomBuilder
+ geompy = geomBuilder.New(salome.myStudy)
except:
geompyEnable = False
diff --git a/src/GEOM_PY/structelem/__init__.py b/src/GEOM_PY/structelem/__init__.py
index f9a9e737b..0ebddec06 100644
--- a/src/GEOM_PY/structelem/__init__.py
+++ b/src/GEOM_PY/structelem/__init__.py
@@ -414,7 +414,11 @@ class StructuralElement:
def TEST_CreateGeometry():
- import geompy
+ import salome
+ salome.salome_init()
+ import GEOM
+ from salome.geom import geomBuilder
+ geompy = geomBuilder.New(salome.myStudy)
import SALOMEDS
geompy.init_geom(salome.myStudy)
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
diff --git a/src/GEOM_SWIG/GEOM_Nut.py b/src/GEOM_SWIG/GEOM_Nut.py
index c5d020658..3f33ebb73 100755
--- a/src/GEOM_SWIG/GEOM_Nut.py
+++ b/src/GEOM_SWIG/GEOM_Nut.py
@@ -26,11 +26,15 @@
#Auhtor :MASLOV Eugeny, KOVALTCHUK Alexey
#####################################################################
#
-import geompy
-import salome
import os
import math
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
#Sketcher_1 creation
Sketcher_1 = geompy.MakeSketcher("Sketcher:F 100 -57.7:TT 100 57.7:TT 0 115.47:TT -100 57.7:TT -100 -57.7:TT 0 -115.47:WW")
geompy.addToStudy(Sketcher_1, "Sketcher_1")
diff --git a/src/GEOM_SWIG/GEOM_ObjectInfo.py b/src/GEOM_SWIG/GEOM_ObjectInfo.py
index c5efc0b20..741fba042 100644
--- a/src/GEOM_SWIG/GEOM_ObjectInfo.py
+++ b/src/GEOM_SWIG/GEOM_ObjectInfo.py
@@ -24,9 +24,10 @@
# Module : GEOM
#
import salome
-import geompy
-
-geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# Create several objects
obj1 = geompy.MakeVertex(0.,0.,0.)
@@ -45,13 +46,13 @@ obj4_entry = geompy.addToStudy(obj4, "Object4")
obj5_entry = geompy.addToStudy(obj5, "Object5")
# Get information about objects
-hasInfo = geom.hasObjectInfo()
+hasInfo = geompy.hasObjectInfo()
print "Check if GEOM module provides information about its objects: ", hasInfo
if hasInfo == True:
- print "Information about first object: ", geom.getObjectInfo(salome.myStudyId, obj1_entry)
- print "Information about second object: ", geom.getObjectInfo(salome.myStudyId, obj2_entry)
- print "Information about third object: ", geom.getObjectInfo(salome.myStudyId, obj3_entry)
- print "Information about fourth object: ", geom.getObjectInfo(salome.myStudyId, obj4_entry)
- print "Information about fifth object: ", geom.getObjectInfo(salome.myStudyId, obj5_entry)
+ print "Information about first object: ", geompy.getObjectInfo(salome.myStudyId, obj1_entry)
+ print "Information about second object: ", geompy.getObjectInfo(salome.myStudyId, obj2_entry)
+ print "Information about third object: ", geompy.getObjectInfo(salome.myStudyId, obj3_entry)
+ print "Information about fourth object: ", geompy.getObjectInfo(salome.myStudyId, obj4_entry)
+ print "Information about fifth object: ", geompy.getObjectInfo(salome.myStudyId, obj5_entry)
salome.sg.updateObjBrowser(1)
diff --git a/src/GEOM_SWIG/GEOM_Partition1.py b/src/GEOM_SWIG/GEOM_Partition1.py
index 84109b4fb..ba649260a 100755
--- a/src/GEOM_SWIG/GEOM_Partition1.py
+++ b/src/GEOM_SWIG/GEOM_Partition1.py
@@ -43,8 +43,11 @@ colis_center = sqrt(2.0)*colis_step/2
# --
-import geompy
-geom = geompy.geom
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
boolean_common = 1
boolean_cut = 2
diff --git a/src/GEOM_SWIG/GEOM_Partition2.py b/src/GEOM_SWIG/GEOM_Partition2.py
index d8a39da37..207958a3e 100755
--- a/src/GEOM_SWIG/GEOM_Partition2.py
+++ b/src/GEOM_SWIG/GEOM_Partition2.py
@@ -30,8 +30,12 @@
# Geometrie avec une galerie perpendiculaire
# --------------------------------------------
#
-import geompy
-geom = geompy.geom
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
vecy = geompy.MakeVectorDXDYDZ(0.,1.,0.)
diff --git a/src/GEOM_SWIG/GEOM_Partition3.py b/src/GEOM_SWIG/GEOM_Partition3.py
index 924ecbac7..e4ee24c6b 100755
--- a/src/GEOM_SWIG/GEOM_Partition3.py
+++ b/src/GEOM_SWIG/GEOM_Partition3.py
@@ -27,8 +27,11 @@
# import callovo_01_GEOM
# reload(callovo_01_GEOM)
#
-import geompy
-geom = geompy.geom
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
diff --git a/src/GEOM_SWIG/GEOM_Partition4.py b/src/GEOM_SWIG/GEOM_Partition4.py
index 18842cbe0..68c0459b2 100755
--- a/src/GEOM_SWIG/GEOM_Partition4.py
+++ b/src/GEOM_SWIG/GEOM_Partition4.py
@@ -49,8 +49,11 @@ gmDz = 100.0
# --
-import geompy
-geom = geompy.geom
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# -- Construction de backfill
diff --git a/src/GEOM_SWIG/GEOM_Partition5.py b/src/GEOM_SWIG/GEOM_Partition5.py
index bcd888fef..15f0f93a3 100755
--- a/src/GEOM_SWIG/GEOM_Partition5.py
+++ b/src/GEOM_SWIG/GEOM_Partition5.py
@@ -28,8 +28,11 @@
# reload(gallery_01_GEOM)
# -- Import geompy pour piloter GEOM par script
#
-import geompy
-geom = geompy.geom
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# -- Dimensions de la boite entiˆre
diff --git a/src/GEOM_SWIG/GEOM_Sketcher.py b/src/GEOM_SWIG/GEOM_Sketcher.py
index 4c084eed2..c301e9dab 100644
--- a/src/GEOM_SWIG/GEOM_Sketcher.py
+++ b/src/GEOM_SWIG/GEOM_Sketcher.py
@@ -26,7 +26,11 @@
# Author : Damien COQUERET, Open CASCADE
# Module : GEOM
#
-import geompy
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
#SKETCHER INFOS
#Init Sketcher
diff --git a/src/GEOM_SWIG/GEOM_TestOthers.py b/src/GEOM_SWIG/GEOM_TestOthers.py
index 3c711e92a..8fa5964b5 100644
--- a/src/GEOM_SWIG/GEOM_TestOthers.py
+++ b/src/GEOM_SWIG/GEOM_TestOthers.py
@@ -30,6 +30,7 @@
# ! documentation generation to identify certain places of this file
import os
+import GEOM
def TestExportImport (geompy, shape):
@@ -598,13 +599,13 @@ def TestOtherOperations (geompy, math):
# GetShapesOnPlane
faces_on_pln = geompy.GetShapesOnPlane(blocksComp, geompy.ShapeType["FACE"],
- v_0pp, geompy.GEOM.ST_ONIN)
+ v_0pp, GEOM.ST_ONIN)
for face_i in faces_on_pln:
geompy.addToStudy(face_i, "Face on Plane (N = (0, 1, 1)) or below it")
# GetShapesOnPlaneIDs
faces_above_pln_ids = geompy.GetShapesOnPlaneIDs(blocksComp, geompy.ShapeType["FACE"],
- v_0pp, geompy.GEOM.ST_OUT)
+ v_0pp, GEOM.ST_OUT)
faces_above = geompy.CreateGroup(blocksComp, geompy.ShapeType["FACE"])
geompy.UnionIDs(faces_above, faces_above_pln_ids)
geompy.addToStudy(faces_above, "Group of faces above Plane (N = (0, 1, 1))")
@@ -612,13 +613,13 @@ def TestOtherOperations (geompy, math):
# GetShapesOnPlaneWithLocation
Loc = geompy.MakeVertex(0, -50, 0)
edges_on_pln = geompy.GetShapesOnPlaneWithLocation(blocksComp, geompy.ShapeType["EDGE"],
- v_y, Loc, geompy.GEOM.ST_ON)
+ v_y, Loc, GEOM.ST_ON)
for edge_i in edges_on_pln:
geompy.addToStudy(edge_i, "Edge on Plane (N = (0, -1, 0) & Location = (0, -50, 0)")
# GetShapesOnPlaneWithLocationIDs
edges_on_pln_ids = geompy.GetShapesOnPlaneWithLocationIDs(
- blocksComp, geompy.ShapeType["EDGE"], v_y, Loc, geompy.GEOM.ST_ON)
+ blocksComp, geompy.ShapeType["EDGE"], v_y, Loc, GEOM.ST_ON)
group_edges_on_pln = geompy.CreateGroup(blocksComp, geompy.ShapeType["EDGE"])
geompy.UnionIDs(group_edges_on_pln, edges_on_pln_ids)
grname = "Group of edges on Plane (N = (0, -1, 0) & Location = (0, -50, 0))"
@@ -626,39 +627,39 @@ def TestOtherOperations (geompy, math):
# GetShapesOnCylinder
edges_out_cyl = geompy.GetShapesOnCylinder(blocksComp, geompy.ShapeType["EDGE"],
- vy, 55, geompy.GEOM.ST_OUT)
+ vy, 55, GEOM.ST_OUT)
for edge_i in edges_out_cyl:
geompy.addToStudy(edge_i, "Edge out of Cylinder (axis = (0, 1, 0), r = 55)")
# GetShapesOnCylinderIDs
edges_in_cyl_ids = geompy.GetShapesOnCylinderIDs(blocksComp, geompy.ShapeType["EDGE"],
- vy, 80, geompy.GEOM.ST_IN)
+ vy, 80, GEOM.ST_IN)
edges_in = geompy.CreateGroup(blocksComp, geompy.ShapeType["EDGE"])
geompy.UnionIDs(edges_in, edges_in_cyl_ids)
geompy.addToStudy(edges_in, "Group of edges inside Cylinder (axis = (0, 1, 0), r = 55)")
# GetShapesOnCylinderWithLocation
edges_out_cyl = geompy.GetShapesOnCylinderWithLocation(blocksComp, geompy.ShapeType["EDGE"],
- vy, p11, 55, geompy.GEOM.ST_OUT)
+ vy, p11, 55, GEOM.ST_OUT)
for edge_i in edges_out_cyl:
geompy.addToStudy(edge_i, "Edge out of Cylinder (axis = (0, 1, 0), loc = (0, 0, 0), r = 55)")
# GetShapesOnCylinderWithLocationIDs
edges_in_cyl_ids = geompy.GetShapesOnCylinderWithLocationIDs(blocksComp, geompy.ShapeType["EDGE"],
- vy, p11, 80, geompy.GEOM.ST_IN)
+ vy, p11, 80, GEOM.ST_IN)
edges_in = geompy.CreateGroup(blocksComp, geompy.ShapeType["EDGE"])
geompy.UnionIDs(edges_in, edges_in_cyl_ids)
geompy.addToStudy(edges_in, "Group of edges inside Cylinder (axis = (0, 1, 0), loc = (0, 0, 0), r = 80)")
# GetShapesOnSphere
vertices_on_sph = geompy.GetShapesOnSphere(blocksComp, geompy.ShapeType["VERTEX"],
- p0, 100, geompy.GEOM.ST_ON)
+ p0, 100, GEOM.ST_ON)
for vertex_i in vertices_on_sph:
geompy.addToStudy(vertex_i, "Vertex on Sphere (center = (0, 0, 0), r = 100)")
# GetShapesOnSphereIDs
vertices_on_sph_ids = geompy.GetShapesOnSphereIDs(blocksComp, geompy.ShapeType["VERTEX"],
- p0, 100, geompy.GEOM.ST_ON)
+ p0, 100, GEOM.ST_ON)
vertices_on = geompy.CreateGroup(blocksComp, geompy.ShapeType["VERTEX"])
geompy.UnionIDs(vertices_on, vertices_on_sph_ids)
geompy.addToStudy(vertices_on, "Group of vertices on Sphere (center = (0, 0, 0), r = 100)")
@@ -679,7 +680,7 @@ def TestOtherOperations (geompy, math):
geompy.addToStudy(quadrangle, "Quadrangle")
edges_onin_quad = geompy.GetShapesOnQuadrangle(f12, geompy.ShapeType["EDGE"],
- tl, tr, bl, br, geompy.GEOM.ST_ONIN)
+ tl, tr, bl, br, GEOM.ST_ONIN)
comp = geompy.MakeCompound(edges_onin_quad)
geompy.addToStudy(comp, "Edges of F12 ONIN Quadrangle")
if len( edges_onin_quad ) != 4:
@@ -687,14 +688,14 @@ def TestOtherOperations (geompy, math):
# GetShapesOnQuadrangleIDs
vertices_on_quad_ids = geompy.GetShapesOnQuadrangleIDs(f12, geompy.ShapeType["VERTEX"],
- tl, tr, bl, br, geompy.GEOM.ST_ON)
+ tl, tr, bl, br, GEOM.ST_ON)
vertices_on_quad = geompy.CreateGroup(f12, geompy.ShapeType["VERTEX"])
geompy.UnionIDs(vertices_on_quad, vertices_on_quad_ids)
geompy.addToStudy(vertices_on_quad, "Group of vertices on Quadrangle F12")
# GetShapesOnBox
edges_on_box = geompy.GetShapesOnBox(b0, part, geompy.ShapeType["EDGE"],
- geompy.GEOM.ST_ON)
+ GEOM.ST_ON)
comp = geompy.MakeCompound(edges_on_box)
geompy.addToStudy(comp, "Edges of part ON box b0")
if len( edges_on_box ) != 12:
@@ -702,7 +703,7 @@ def TestOtherOperations (geompy, math):
# GetShapesOnBoxIDs
faces_on_box_ids = geompy.GetShapesOnBoxIDs(b0, part, geompy.ShapeType["FACE"],
- geompy.GEOM.ST_ON)
+ GEOM.ST_ON)
faces_on_box = geompy.CreateGroup(part, geompy.ShapeType["FACE"])
geompy.UnionIDs(faces_on_box, faces_on_box_ids)
geompy.addToStudyInFather(part, faces_on_box, "Group of faces on box b0")
@@ -721,7 +722,7 @@ def TestOtherOperations (geompy, math):
# GetShapesOnShape
faces_in_sh = geompy.GetShapesOnShape(sh_1, part, geompy.ShapeType["FACE"],
- geompy.GEOM.ST_IN)
+ GEOM.ST_IN)
comp = geompy.MakeCompound(faces_in_sh)
geompy.addToStudy(comp, "Faces of part IN shape sh_1")
if len(faces_in_sh) != 11:
@@ -729,12 +730,12 @@ def TestOtherOperations (geompy, math):
# GetShapesOnShapeAsCompound
faces_in_sh_c = geompy.GetShapesOnShapeAsCompound(sh_1, part, geompy.ShapeType["FACE"],
- geompy.GEOM.ST_IN)
+ GEOM.ST_IN)
geompy.addToStudy(faces_in_sh_c, "Faces of part IN shape sh_1 (as compound)")
# GetShapesOnShapeIDs
edges_in_sh_ids = geompy.GetShapesOnShapeIDs(sh_1, part, geompy.ShapeType["EDGE"],
- geompy.GEOM.ST_IN)
+ GEOM.ST_IN)
edges_in_sh = geompy.CreateGroup(part, geompy.ShapeType["EDGE"])
geompy.UnionIDs(edges_in_sh, edges_in_sh_ids)
geompy.addToStudyInFather(part, edges_in_sh, "Group of edges in shape sh_1")
diff --git a/src/GEOM_SWIG/GEOM_blocks.py b/src/GEOM_SWIG/GEOM_blocks.py
index edbf635af..4fb031aff 100644
--- a/src/GEOM_SWIG/GEOM_blocks.py
+++ b/src/GEOM_SWIG/GEOM_blocks.py
@@ -27,9 +27,12 @@
# Module : GEOM
#
import salome
-import geompy
-import math
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+import math
import GEOM_Spanner
isBlocksTest = 0 # False
diff --git a/src/GEOM_SWIG/GEOM_cyl2complementary.py b/src/GEOM_SWIG/GEOM_cyl2complementary.py
index 7c78caa02..85679ff57 100755
--- a/src/GEOM_SWIG/GEOM_cyl2complementary.py
+++ b/src/GEOM_SWIG/GEOM_cyl2complementary.py
@@ -32,7 +32,11 @@
# ------
#
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
geomgui = salome.ImportComponentGUI("GEOM")
import salome_ComponentGUI
def addToStudy(shape, name):
diff --git a/src/GEOM_SWIG/GEOM_example.py b/src/GEOM_SWIG/GEOM_example.py
index a88a848bf..d90c3bacd 100644
--- a/src/GEOM_SWIG/GEOM_example.py
+++ b/src/GEOM_SWIG/GEOM_example.py
@@ -27,7 +27,10 @@
# Module : GEOM
#
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
ind = 0
boxlist = []
diff --git a/src/GEOM_SWIG/GEOM_example2.py b/src/GEOM_SWIG/GEOM_example2.py
index 4287539a3..57f239fff 100644
--- a/src/GEOM_SWIG/GEOM_example2.py
+++ b/src/GEOM_SWIG/GEOM_example2.py
@@ -27,7 +27,10 @@
# Module : GEOM
#
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import math
geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
diff --git a/src/GEOM_SWIG/GEOM_example3.py b/src/GEOM_SWIG/GEOM_example3.py
index 61896e107..70d6b8962 100644
--- a/src/GEOM_SWIG/GEOM_example3.py
+++ b/src/GEOM_SWIG/GEOM_example3.py
@@ -27,19 +27,20 @@
# Module : GEOM
#
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import math
from time import sleep
import salome_ComponentGUI
-geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
-myBuilder = salome.myStudy.NewBuilder()
gg = salome.ImportComponentGUI("GEOM")
-BasicOp = geom.GetIBasicOperations(salome.myStudyId)
-PrimOp = geom.GetI3DPrimOperations(salome.myStudyId)
-InsertOp = geom.GetIInsertOperations(salome.myStudyId)
-TrsfOp = geom.GetITransformOperations(salome.myStudyId)
+BasicOp = geompy.GetIBasicOperations(salome.myStudyId)
+PrimOp = geompy.GetI3DPrimOperations(salome.myStudyId)
+InsertOp = geompy.GetIInsertOperations(salome.myStudyId)
+TrsfOp = geompy.GetITransformOperations(salome.myStudyId)
point0 = BasicOp.MakePointXYZ(0.,0.,0.)
pointz1 = BasicOp.MakePointXYZ(0.,0.,1.)
diff --git a/src/GEOM_SWIG/GEOM_example4.py b/src/GEOM_SWIG/GEOM_example4.py
index 684482650..9afc4dc7f 100755
--- a/src/GEOM_SWIG/GEOM_example4.py
+++ b/src/GEOM_SWIG/GEOM_example4.py
@@ -24,30 +24,15 @@
# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
# File : GEOM_example4.py
# Module : GEOM
-#import SMESH
-#import smeshpy
#
import salome
-from salome import sg
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
import math
-import geompy
-
-geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
-myBuilder = salome.myStudy.NewBuilder()
-#from geompy import gg
-
-#smeshgui = salome.ImportComponentGUI("SMESH")
-#smeshgui.Init(salome.myStudyId);
-
-ShapeTypeCompSolid = 1
-ShapeTypeSolid = 2
-ShapeTypeShell = 3
-ShapeTypeFace = 4
-ShapeTypeWire = 5
-ShapeTypeEdge = 6
-ShapeTypeVertex = 7
-
pi=math.pi
# ---------------------------------------------
diff --git a/src/GEOM_SWIG/GEOM_example5.py b/src/GEOM_SWIG/GEOM_example5.py
index 6071e470c..dd91b0360 100644
--- a/src/GEOM_SWIG/GEOM_example5.py
+++ b/src/GEOM_SWIG/GEOM_example5.py
@@ -27,12 +27,13 @@
# Module : GEOM
#
import salome
-import geompy
-
-geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
#Create Points
-BasicOp = geom.GetIBasicOperations(salome.myStudyId)
+BasicOp = geompy.GetIBasicOperations(salome.myStudyId)
Vertex1 = BasicOp.MakePointXYZ(0., 0., 0.)
Vertex2 = BasicOp.MakePointXYZ(100., 20., 30.)
Vertex3 = BasicOp.MakePointXYZ(150., 100., -25.)
diff --git a/src/GEOM_SWIG/GEOM_example6.py b/src/GEOM_SWIG/GEOM_example6.py
index e1202c35f..7209e1def 100755
--- a/src/GEOM_SWIG/GEOM_example6.py
+++ b/src/GEOM_SWIG/GEOM_example6.py
@@ -24,7 +24,10 @@
# Module : GEOM
#
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
ind = 1
circlelist = []
diff --git a/src/GEOM_SWIG/GEOM_example7.py b/src/GEOM_SWIG/GEOM_example7.py
index 323403fdf..3da31f89f 100644
--- a/src/GEOM_SWIG/GEOM_example7.py
+++ b/src/GEOM_SWIG/GEOM_example7.py
@@ -22,10 +22,12 @@
# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
# ---
#
-import salome
-import geompy
import os
+import salome
+salome.salome_init()
import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
data_dir = os.getenv('DATA_DIR')
if data_dir:
diff --git a/src/GEOM_SWIG/GEOM_moteur.py b/src/GEOM_SWIG/GEOM_moteur.py
index 661abfebb..07066f445 100644
--- a/src/GEOM_SWIG/GEOM_moteur.py
+++ b/src/GEOM_SWIG/GEOM_moteur.py
@@ -27,12 +27,12 @@
# Module : GEOM
#
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
import math
-geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
-myBuilder = salome.myStudy.NewBuilder()
-
#Variables modifiables
PosX = 0 #Position du cylindre dans l'espace
PosY = 0 #Il est oriente suivant Z
@@ -56,7 +56,7 @@ PosCour = PosZ + HauteurT * 4 / 7
PosRot = PosZ + 0.9 * HauteurT
#Points
-BasicOp = geom.GetIBasicOperations(salome.myStudyId)
+BasicOp = geompy.GetIBasicOperations(salome.myStudyId)
OO = BasicOp.MakePointXYZ(0, 0, 0)
P0 = BasicOp.MakePointXYZ(0, 0, 1)
P1 = BasicOp.MakePointXYZ(PosX, PosY, PosZ)
diff --git a/src/GEOM_SWIG/GEOM_shellSolid.py b/src/GEOM_SWIG/GEOM_shellSolid.py
index 5413e8513..252ea7c88 100755
--- a/src/GEOM_SWIG/GEOM_shellSolid.py
+++ b/src/GEOM_SWIG/GEOM_shellSolid.py
@@ -32,9 +32,10 @@
# -------
#
import salome
-import SALOMEDS
-
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# Interface with geometry
# -----------------------
@@ -42,8 +43,6 @@ import geompy
#geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
geomgui = salome.ImportComponentGUI("GEOM")
-geom = geompy
-
# Interface with study
# --------------------
@@ -58,23 +57,23 @@ def setName(obj):
def MakeVertex(x, y, z):
- v = geom.MakeVertex(x, y, z)
+ v = geompy.MakeVertex(x, y, z)
setName(v)
return v
def MakeEdge(v1, v2):
- e = geom.MakeEdge(v1, v2)
+ e = geompy.MakeEdge(v1, v2)
setName(e)
return e
def MakeArc(f, p, t):
- e = geom.MakeArc(f, p, t)
+ e = geompy.MakeArc(f, p, t)
setName(e)
return e
def MakeArcCenter(c, f, t):
p = fkl(c, f, t)
- e = geom.MakeArc(f, p, t)
+ e = geompy.MakeArc(f, p, t)
setName(e)
return e
@@ -89,8 +88,8 @@ def MakeQuadFace(e1, e2, e3, e4):
l.append(e2)
l.append(e3)
l.append(e4)
- w = geom.MakeWire(l)
- f = geom.MakeFace(w, 1)
+ w = geompy.MakeWire(l)
+ f = geompy.MakeFace(w, 1)
setName(f)
return f
@@ -112,8 +111,8 @@ def MakeQuadFaceVertex(v1, v2, v3, v4):
l.append(e)
e = MakeEdge(v4, v1)
l.append(e)
- w = geom.MakeWire(l)
- f = geom.MakeFace(w, 1)
+ w = geompy.MakeWire(l)
+ f = geompy.MakeFace(w, 1)
setName(f)
return f
@@ -131,11 +130,11 @@ def MakeHexaSolid(f1, f2, f3, f4, f5, f6):
l.append(f4)
l.append(f5)
l.append(f6)
- s = geom.MakeShell(l)
+ s = geompy.MakeShell(l)
# FKL: bad shell
l = []
l.append(s)
- s = geom.MakeSolid(l)
+ s = geompy.MakeSolid(l)
# FKL: MakeSolid crash
setName(s)
return s
@@ -155,8 +154,8 @@ def MakeRevolution(g, pt, ve, angle):
Creates a face by rotation of an edge with an angle around an axis defined by a point and a vector or
creates a solid by rotation of a face with an angle around an axis defined by a point and a vector
"""
- axis = geom.MakeAxisStruct(pt.x, pt.y, pt.z, ve.x, ve.y, ve.z)
- s = geom.MakeRevolution(g, axis, angle)
+ axis = geompy.MakeAxisStruct(pt.x, pt.y, pt.z, ve.x, ve.y, ve.z)
+ s = geompy.MakeRevolution(g, axis, angle)
setName(s)
return s
@@ -167,7 +166,7 @@ def MakeSewing(ls):
Creates a face by sewing common edges between a list of faces or
Creates a solid by sewing common faces between a list of solids
"""
- s = geom.MakeSewing(ls)
+ s = geompy.MakeSewing(ls)
setName(s)
return s
@@ -178,7 +177,7 @@ def MakeCommon(s1, s2):
Creates the common face between 2 faces or
Creates the common solid between 2 solids
"""
- s = geom.MakeBoolean(s1, s2, 1)
+ s = geompy.MakeBoolean(s1, s2, 1)
setName(s)
return s
@@ -188,7 +187,7 @@ def MakeFuse(s1, s2):
"""
Fuses 2 faces or 2 solids
"""
- s = geom.MakeBoolean(s1, s2, 3)
+ s = geompy.MakeBoolean(s1, s2, 3)
setName(s)
return s
@@ -198,7 +197,7 @@ def MakeCut(s1, s2):
"""
Cuts 2 faces or 2 solids
"""
- s = geom.MakeBoolean(s1, s2, 2)
+ s = geompy.MakeBoolean(s1, s2, 2)
setName(s)
return s
@@ -214,7 +213,7 @@ def MakePrism(s, v):
Creates a face defined by a edge and along a vector
Creates a solid defined by a face and along a vector
"""
- r = geom.MakePrism(s, point(0, 0, 0), v)
+ r = geompy.MakePrism(s, point(0, 0, 0), v)
setName(r)
return r
@@ -224,7 +223,7 @@ def MakeScaleTransform(s, center, factor):
"""
Creates a homothety of a geometric object
"""
- r = geom.MakeScaleTransform(s, center, factor)
+ r = geompy.MakeScaleTransform(s, center, factor)
setName(r)
return r
@@ -237,7 +236,7 @@ def MakeTranslation(s, vx, vy, vz):
"""
Translates a vertex, an edge, a face or a solid
"""
- r = geom.MakeTranslation(s, vx, vy, vz)
+ r = geompy.MakeTranslation(s, vx, vy, vz)
setName(r)
return r
@@ -247,8 +246,8 @@ def MakeRotation(g, pt, ve, angle):
"""
Creates a rotation of the geometric object with an angle around an axis defined by a point and a vector
"""
- axis = geom.MakeAxisStruct(pt.x, pt.y, pt.z, ve.x, ve.y, ve.z)
- s = geom.MakeRotation(g, axis, angle)
+ axis = geompy.MakeAxisStruct(pt.x, pt.y, pt.z, ve.x, ve.y, ve.z)
+ s = geompy.MakeRotation(g, axis, angle)
setName(s)
return s
@@ -275,7 +274,7 @@ def MakeMirrorByPlane(s, pt, ve):
Creates a symmetric object by plane symetry defined by a point and a normal vector
"""
p = plane(pt, ve)
- r = geom.MakeMirrorByplane(s, p)
+ r = geompy.MakeMirrorByplane(s, p)
setName(r)
return r
@@ -349,37 +348,35 @@ def CheckHexaSolid(s):
# ------------------
def point(x, y, z):
- p = geom.MakeVertex(x, y, z)
+ p = geompy.MakeVertex(x, y, z)
return p
def plane(pt, dir):
- p = geom.MakePlane(pt, d, 100)
+ p = geompy.MakePlane(pt, d, 100)
return p
# Solid
# -----
def MakeCylinder(center, dir, radius, height):
- s = geom.MakeCylinder(center, dir, radius, height)
+ s = geompy.MakeCylinder(center, dir, radius, height)
setName(s)
return s
def MakeBox(p1, p2):
- s = geom.MakeBoxTwoPnt(p1, p2)
+ s = geompy.MakeBoxTwoPnt(p1, p2)
setName(s)
return s
# Compound
# --------
-ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
-
def MakePartitionList(solids, tools):
"""
Creates a list of shape by a partition of a list of solids by a list of tools
"""
- p = geom.Partition(solids, tools, [], [], ShapeType["SHAPE"]);
- l = geom.SubShapeAll(p, ShapeType["SHAPE"])
+ p = geompy.Partition(solids, tools, [], [], geompy.ShapeType["SHAPE"]);
+ l = geompy.SubShapeAll(p, geompy.ShapeType["SHAPE"])
return l
def MakePartition(solids, tools):
@@ -392,25 +389,25 @@ def MakePartition(solids, tools):
return c
def BlockMakeMultiTranslation1D(shape, dir, step, times):
- m = geom.MakeMultiTranslation1D(shape, dir, step, times)
+ m = geompy.MakeMultiTranslation1D(shape, dir, step, times)
c = MakeGlueFaces(m, 1.e-5)
setName(c)
return c
def BlockMakeMultiTranslation2D(shape, dir1, step1, times1, dir2, step2, times2):
- m = geom.MakeMultiTranslation2D(shape, dir1, step1, times1, dir2, step2, times2)
+ m = geompy.MakeMultiTranslation2D(shape, dir1, step1, times1, dir2, step2, times2)
c = MakeGlueFaces(m, 1.e-5)
setName(c)
return c
def BlockMakeMultiRotation1D(shape, dir, point, times):
- m = geom.MakeMultiRotation1D(shape, dir, point, times)
+ m = geompy.MakeMultiRotation1D(shape, dir, point, times)
c = MakeGlueFaces(m, 1.e-5)
setName(c)
return c
def BlockMakeMultiRotation2D(shape, dir, point, angle, times1, step, times2):
- m = geom.MakeMultiRotation2D(shape, dir, point, angle, times1, step, times2)
+ m = geompy.MakeMultiRotation2D(shape, dir, point, angle, times1, step, times2)
c = MakeGlueFaces(m, 1.e-5)
setName(c)
return c
@@ -422,21 +419,21 @@ def MakeCompound(ls):
"""
Creates a compound defined by a list
"""
- c = geom.MakeCompound(ls)
+ c = geompy.MakeCompound(ls)
return c
def MakeSewingShape(s, eps):
"""
Creates a shape fully sewed
"""
- r = geom.MakeSewingShape(s, eps)
+ r = geompy.MakeSewingShape(s, eps)
return r
def MakeGlueFaces(s, eps):
"""
Touched faces are replaced by one
"""
- r = geom.MakeGlueFaces(s, eps)
+ r = geompy.MakeGlueFaces(s, eps)
return r
@@ -697,4 +694,4 @@ piece = MakeCompound(l)
# ------------
idpiece = addToStudy(piece, "Cubes2pyGibi")
-#geom.InsertOp.Export(piece,"piece.brep", "BREP")
+#geompy.InsertOp.Export(piece,"piece.brep", "BREP")
diff --git a/src/GEOM_SWIG/GEOM_tube_geom.py b/src/GEOM_SWIG/GEOM_tube_geom.py
index b8f6e9e0d..a6e84f8f7 100755
--- a/src/GEOM_SWIG/GEOM_tube_geom.py
+++ b/src/GEOM_SWIG/GEOM_tube_geom.py
@@ -31,7 +31,10 @@
# Geometrie du cas test
#
import salome
-from geompy import *
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
#
# base de l'assemblage
@@ -41,16 +44,16 @@ l_base = 150.
h_base = 75.
e_base = 6.
-base_bot = MakeBox(0.,0.,0.,L_base,l_base,e_base)
-base_top = MakeTranslation(base_bot,0.,0.,h_base-e_base)
-base_front = MakeBox(0,0,0,L_base,e_base,h_base)
-base_rear = MakeTranslation(base_front,0.,l_base,0.)
+base_bot = geompy.MakeBox(0.,0.,0.,L_base,l_base,e_base)
+base_top = geompy.MakeTranslation(base_bot,0.,0.,h_base-e_base)
+base_front = geompy.MakeBox(0,0,0,L_base,e_base,h_base)
+base_rear = geompy.MakeTranslation(base_front,0.,l_base,0.)
-tmp = MakeBoolean(base_top,base_rear,3)
-tmp = MakeBoolean(tmp,base_bot,3)
-base = MakeBoolean(tmp,base_front,3)
+tmp = geompy.MakeBoolean(base_top,base_rear,3)
+tmp = geompy.MakeBoolean(tmp,base_bot,3)
+base = geompy.MakeBoolean(tmp,base_front,3)
-addToStudy(base,"base")
+geompy.addToStudy(base,"base")
#
# traverse
#
@@ -59,103 +62,103 @@ h_trav = 300.
e_trav = 7.
marge = 15.
-flange_left = MakeBox(0.,0.,0,e_trav,L_trav,h_trav)
-flange_right = MakeTranslation(flange_left,L_trav-e_trav,0.,0.)
-flange_front = MakeBox(0.,0.,0,L_trav,e_trav,h_trav)
-flange_rear = MakeTranslation(flange_front,0.,L_trav-e_trav,0.)
+flange_left = geompy.MakeBox(0.,0.,0,e_trav,L_trav,h_trav)
+flange_right = geompy.MakeTranslation(flange_left,L_trav-e_trav,0.,0.)
+flange_front = geompy.MakeBox(0.,0.,0,L_trav,e_trav,h_trav)
+flange_rear = geompy.MakeTranslation(flange_front,0.,L_trav-e_trav,0.)
-tmp = MakeBoolean(flange_left,flange_rear,3)
-tmp = MakeBoolean(tmp,flange_right,3)
-flange = MakeBoolean(tmp,flange_front,3)
+tmp = geompy.MakeBoolean(flange_left,flange_rear,3)
+tmp = geompy.MakeBoolean(tmp,flange_right,3)
+flange = geompy.MakeBoolean(tmp,flange_front,3)
#
# left chamfer
#
import math
length = e_trav/math.sin(math.pi/4.)
-p1 = MakeVertex(0,0,0)
-p2 = MakeVertex(0,1,0)
-yaxis = MakeVector(p1, p2)
-cut_left = MakeBox(0.,-marge,0.,-length,L_trav+marge,length)
-cut_left = MakeRotation(cut_left,yaxis,-math.pi/4.)
-cut_left = MakeTranslation(cut_left,e_trav,0.,0.)
+p1 = geompy.MakeVertex(0,0,0)
+p2 = geompy.MakeVertex(0,1,0)
+yaxis = geompy.MakeVector(p1, p2)
+cut_left = geompy.MakeBox(0.,-marge,0.,-length,L_trav+marge,length)
+cut_left = geompy.MakeRotation(cut_left,yaxis,-math.pi/4.)
+cut_left = geompy.MakeTranslation(cut_left,e_trav,0.,0.)
#
# right chamfer
#
-symPlaneYZ = MakePlane(
- MakeVertex(L_trav/2.,0.,0.),
- MakeVector(p1,MakeVertex(1.,0.,0.)), 10000. )
-cut_right = MakeMirrorByPlane(cut_left,symPlaneYZ)
+symPlaneYZ = geompy.MakePlane(
+ geompy.MakeVertex(L_trav/2.,0.,0.),
+ geompy.MakeVector(p1,geompy.MakeVertex(1.,0.,0.)), 10000. )
+cut_right = geompy.MakeMirrorByPlane(cut_left,symPlaneYZ)
#
# front chamfer
#
-xaxis = MakeVector(p1,MakeVertex(1.,0.,0.))
-cut_front = MakeBox(-marge,0.,0.,L_trav+marge,length,length)
-cut_front = MakeRotation(cut_front,xaxis,3.*math.pi/4.)
-cut_front = MakeTranslation(cut_front,0.,e_trav,0.)
+xaxis = geompy.MakeVector(p1,geompy.MakeVertex(1.,0.,0.))
+cut_front = geompy.MakeBox(-marge,0.,0.,L_trav+marge,length,length)
+cut_front = geompy.MakeRotation(cut_front,xaxis,3.*math.pi/4.)
+cut_front = geompy.MakeTranslation(cut_front,0.,e_trav,0.)
#
# rear chamfer
#
-symPlaneXZ = MakePlane(
- MakeVertex(0.,L_trav/2.,0.),
- MakeVector(p1,MakeVertex(0.,1.,0.)), 10000. )
-cut_rear = MakeMirrorByPlane(cut_front,symPlaneXZ)
+symPlaneXZ = geompy.MakePlane(
+ geompy.MakeVertex(0.,L_trav/2.,0.),
+ geompy.MakeVector(p1,geompy.MakeVertex(0.,1.,0.)), 10000. )
+cut_rear = geompy.MakeMirrorByPlane(cut_front,symPlaneXZ)
#
# chamfer
#
-trav = MakeBoolean(flange,cut_left,2)
-trav = MakeBoolean(trav,cut_right,2)
-trav = MakeBoolean(trav,cut_front,2)
-trav = MakeBoolean(trav,cut_rear,2)
-trav = MakeTranslation(trav,
+trav = geompy.MakeBoolean(flange,cut_left,2)
+trav = geompy.MakeBoolean(trav,cut_right,2)
+trav = geompy.MakeBoolean(trav,cut_front,2)
+trav = geompy.MakeBoolean(trav,cut_rear,2)
+trav = geompy.MakeTranslation(trav,
L_base/2.-L_trav/2.,
l_base/2.-L_trav/2.,
h_base)
-addToStudy(trav,"trav")
+geompy.addToStudy(trav,"trav")
#
# Welding
#
-ground = MakeBox(-1000.,-1000.,0.,1000.,1000.,-1000.)
-weld_left = MakeBoolean(cut_left,ground,2)
-weld_right = MakeBoolean(cut_right,ground,2)
-weld_front = MakeBoolean(cut_front,ground,2)
-weld_rear = MakeBoolean(cut_rear,ground,2)
+ground = geompy.MakeBox(-1000.,-1000.,0.,1000.,1000.,-1000.)
+weld_left = geompy.MakeBoolean(cut_left,ground,2)
+weld_right = geompy.MakeBoolean(cut_right,ground,2)
+weld_front = geompy.MakeBoolean(cut_front,ground,2)
+weld_rear = geompy.MakeBoolean(cut_rear,ground,2)
#
# Assembly
#
-coarse_weld = MakeBoolean(weld_left,weld_rear,3)
-coarse_weld = MakeBoolean(coarse_weld,weld_right,3)
-coarse_weld = MakeBoolean(coarse_weld,weld_front,3)
+coarse_weld = geompy.MakeBoolean(weld_left,weld_rear,3)
+coarse_weld = geompy.MakeBoolean(coarse_weld,weld_right,3)
+coarse_weld = geompy.MakeBoolean(coarse_weld,weld_front,3)
#
# Cleaners
#
-left_cleaner = MakeBox(0.,-10*marge,0.,-10.*marge,10.*marge,10.*marge)
-left_cleaner = MakeRotation(left_cleaner,yaxis,math.pi/4.)
-left_cleaner = MakeTranslation(left_cleaner,-e_trav-2.*marge,0.,-2.*marge)
+left_cleaner = geompy.MakeBox(0.,-10*marge,0.,-10.*marge,10.*marge,10.*marge)
+left_cleaner = geompy.MakeRotation(left_cleaner,yaxis,math.pi/4.)
+left_cleaner = geompy.MakeTranslation(left_cleaner,-e_trav-2.*marge,0.,-2.*marge)
-right_cleaner = MakeMirrorByPlane(left_cleaner,symPlaneYZ)
+right_cleaner = geompy.MakeMirrorByPlane(left_cleaner,symPlaneYZ)
-front_cleaner = MakeBox(-10*marge,0.,0.,10.*marge,10.*marge,10.*marge)
-front_cleaner = MakeRotation(front_cleaner,xaxis,3.*math.pi/4.)
-front_cleaner = MakeTranslation(front_cleaner,0.,2.*marge-e_trav,2.*marge)
+front_cleaner = geompy.MakeBox(-10*marge,0.,0.,10.*marge,10.*marge,10.*marge)
+front_cleaner = geompy.MakeRotation(front_cleaner,xaxis,3.*math.pi/4.)
+front_cleaner = geompy.MakeTranslation(front_cleaner,0.,2.*marge-e_trav,2.*marge)
-rear_cleaner = MakeMirrorByPlane(front_cleaner,symPlaneXZ)
+rear_cleaner = geompy.MakeMirrorByPlane(front_cleaner,symPlaneXZ)
#
# Welding
#
-weld = MakeBoolean(coarse_weld,left_cleaner,2)
-weld = MakeBoolean(weld,rear_cleaner,2)
-weld = MakeBoolean(weld,right_cleaner,2)
-weld = MakeBoolean(weld,front_cleaner,2)
-weld = MakeTranslation(weld,
+weld = geompy.MakeBoolean(coarse_weld,left_cleaner,2)
+weld = geompy.MakeBoolean(weld,rear_cleaner,2)
+weld = geompy.MakeBoolean(weld,right_cleaner,2)
+weld = geompy.MakeBoolean(weld,front_cleaner,2)
+weld = geompy.MakeTranslation(weld,
L_base/2.-L_trav/2.,
l_base/2.-L_trav/2.,
h_base)
-weldId = addToStudy(weld,"weld")
+weldId = geompy.addToStudy(weld,"weld")
#
# Assembly
#
-assemblage = Partition([base ,weld ,trav])
-assemblageId = addToStudy(assemblage, "assemblage")
+assemblage = geompy.Partition([base ,weld ,trav])
+assemblageId = geompy.addToStudy(assemblage, "assemblage")
salome.sg.updateObjBrowser(1)
#
# Display
diff --git a/src/GEOM_SWIG/GEOM_tube_geom_gg2.py b/src/GEOM_SWIG/GEOM_tube_geom_gg2.py
index 821101af3..7bdfb8d89 100755
--- a/src/GEOM_SWIG/GEOM_tube_geom_gg2.py
+++ b/src/GEOM_SWIG/GEOM_tube_geom_gg2.py
@@ -30,8 +30,11 @@
#==============================================================================
# Geometrie du cas test
#
-from geompy import *
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
#
# base de l'assemblage
#
@@ -40,16 +43,16 @@ l_base = 150.
h_base = 75.
e_base = 6.
-base_bot = MakeBox(0.,0.,0.,L_base,l_base,e_base)
-base_top = MakeTranslation(base_bot,0.,0.,h_base-e_base)
-base_front = MakeBox(0,0,0,L_base,e_base,h_base)
-base_rear = MakeTranslation(base_front,0.,l_base,0.)
+base_bot = geompy.MakeBox(0.,0.,0.,L_base,l_base,e_base)
+base_top = geompy.MakeTranslation(base_bot,0.,0.,h_base-e_base)
+base_front = geompy.MakeBox(0,0,0,L_base,e_base,h_base)
+base_rear = geompy.MakeTranslation(base_front,0.,l_base,0.)
-tmp = MakeBoolean(base_top,base_rear,3)
-tmp = MakeBoolean(tmp,base_bot,3)
-base = MakeBoolean(tmp,base_front,3)
+tmp = geompy.MakeBoolean(base_top,base_rear,3)
+tmp = geompy.MakeBoolean(tmp,base_bot,3)
+base = geompy.MakeBoolean(tmp,base_front,3)
-baseId = addToStudy(base,"base")
+baseId = geompy.addToStudy(base,"base")
#
# traverse
#
@@ -58,112 +61,112 @@ h_trav = 300.
e_trav = 7.
marge = 15.
-flange_left = MakeBox(0.,0.,0,e_trav,L_trav,h_trav)
-flange_right = MakeTranslation(flange_left,L_trav-e_trav,0.,0.)
-flange_front = MakeBox(0.,0.,0,L_trav,e_trav,h_trav)
-flange_rear = MakeTranslation(flange_front,0.,L_trav-e_trav,0.)
+flange_left = geompy.MakeBox(0.,0.,0,e_trav,L_trav,h_trav)
+flange_right = geompy.MakeTranslation(flange_left,L_trav-e_trav,0.,0.)
+flange_front = geompy.MakeBox(0.,0.,0,L_trav,e_trav,h_trav)
+flange_rear = geompy.MakeTranslation(flange_front,0.,L_trav-e_trav,0.)
-tmp = MakeBoolean(flange_left,flange_rear,3)
-tmp = MakeBoolean(tmp,flange_right,3)
-flange = MakeBoolean(tmp,flange_front,3)
+tmp = geompy.MakeBoolean(flange_left,flange_rear,3)
+tmp = geompy.MakeBoolean(tmp,flange_right,3)
+flange = geompy.MakeBoolean(tmp,flange_front,3)
#
# left chamfer
#
import math
length = e_trav/math.sin(math.pi/4.)
-yaxis = MakeVectorDXDYDZ(0.,1.,0.)
-cut_left = MakeBox(0.,-marge,0.,-length,L_trav+marge,length)
-cut_left = MakeRotation(cut_left,yaxis,-math.pi/4.)
-cut_left = MakeTranslation(cut_left,e_trav,0.,0.)
+yaxis = geompy.MakeVectorDXDYDZ(0.,1.,0.)
+cut_left = geompy.MakeBox(0.,-marge,0.,-length,L_trav+marge,length)
+cut_left = geompy.MakeRotation(cut_left,yaxis,-math.pi/4.)
+cut_left = geompy.MakeTranslation(cut_left,e_trav,0.,0.)
#
# right chamfer
#
-symPlaneYZ = MakePlane(
- MakeVertex(L_trav/2.,0.,0.),
- MakeVectorDXDYDZ(1.,0.,0.), 10000. )
-cut_right = MakeMirrorByPlane(cut_left,symPlaneYZ)
+symPlaneYZ = geompy.MakePlane(
+ geompy.MakeVertex(L_trav/2.,0.,0.),
+ geompy.MakeVectorDXDYDZ(1.,0.,0.), 10000. )
+cut_right = geompy.MakeMirrorByPlane(cut_left,symPlaneYZ)
#
# front chamfer
#
-xaxis = MakeVectorDXDYDZ(1.,0.,0.)
-cut_front = MakeBox(-marge,0.,0.,L_trav+marge,length,length)
-cut_front = MakeRotation(cut_front,xaxis,3.*math.pi/4.)
-cut_front = MakeTranslation(cut_front,0.,e_trav,0.)
+xaxis = geompy.MakeVectorDXDYDZ(1.,0.,0.)
+cut_front = geompy.MakeBox(-marge,0.,0.,L_trav+marge,length,length)
+cut_front = geompy.MakeRotation(cut_front,xaxis,3.*math.pi/4.)
+cut_front = geompy.MakeTranslation(cut_front,0.,e_trav,0.)
#
# rear chamfer
#
-symPlaneXZ = MakePlane(
- MakeVertex(0.,L_trav/2.,0.),
- MakeVectorDXDYDZ(0.,1.,0.), 10000. )
-cut_rear = MakeMirrorByPlane(cut_front,symPlaneXZ)
+symPlaneXZ = geompy.MakePlane(
+ geompy.MakeVertex(0.,L_trav/2.,0.),
+ geompy.MakeVectorDXDYDZ(0.,1.,0.), 10000. )
+cut_rear = geompy.MakeMirrorByPlane(cut_front,symPlaneXZ)
#
# chamfer
#
-trav = MakeBoolean(flange,cut_left,2)
-trav = MakeBoolean(trav,cut_right,2)
-trav = MakeBoolean(trav,cut_front,2)
-trav = MakeBoolean(trav,cut_rear,2)
-trav = MakeTranslation(trav,
+trav = geompy.MakeBoolean(flange,cut_left,2)
+trav = geompy.MakeBoolean(trav,cut_right,2)
+trav = geompy.MakeBoolean(trav,cut_front,2)
+trav = geompy.MakeBoolean(trav,cut_rear,2)
+trav = geompy.MakeTranslation(trav,
L_base/2.-L_trav/2.,
l_base/2.-L_trav/2.,
h_base)
-travId = addToStudy(trav,"trav")
+travId = geompy.addToStudy(trav,"trav")
#
# Welding
#
-ground = MakeBox(-1000.,-1000.,0.,1000.,1000.,-1000.)
-weld_left = MakeBoolean(cut_left,ground,2)
-weld_right = MakeBoolean(cut_right,ground,2)
-weld_front = MakeBoolean(cut_front,ground,2)
-weld_rear = MakeBoolean(cut_rear,ground,2)
+ground = geompy.MakeBox(-1000.,-1000.,0.,1000.,1000.,-1000.)
+weld_left = geompy.MakeBoolean(cut_left,ground,2)
+weld_right = geompy.MakeBoolean(cut_right,ground,2)
+weld_front = geompy.MakeBoolean(cut_front,ground,2)
+weld_rear = geompy.MakeBoolean(cut_rear,ground,2)
#
# Assembly
#
-coarse_weld = MakeBoolean(weld_left,weld_rear,3)
-coarse_weld = MakeBoolean(coarse_weld,weld_right,3)
-coarse_weld = MakeBoolean(coarse_weld,weld_front,3)
+coarse_weld = geompy.MakeBoolean(weld_left,weld_rear,3)
+coarse_weld = geompy.MakeBoolean(coarse_weld,weld_right,3)
+coarse_weld = geompy.MakeBoolean(coarse_weld,weld_front,3)
#
# Cleaners
#
-left_cleaner = MakeBox(0.,-10*marge,0.,-10.*marge,10.*marge,10.*marge)
-left_cleaner = MakeRotation(left_cleaner,yaxis,math.pi/4.)
-left_cleaner = MakeTranslation(left_cleaner,-e_trav-2.*marge,0.,-2.*marge)
+left_cleaner = geompy.MakeBox(0.,-10*marge,0.,-10.*marge,10.*marge,10.*marge)
+left_cleaner = geompy.MakeRotation(left_cleaner,yaxis,math.pi/4.)
+left_cleaner = geompy.MakeTranslation(left_cleaner,-e_trav-2.*marge,0.,-2.*marge)
-right_cleaner = MakeMirrorByPlane(left_cleaner,symPlaneYZ)
+right_cleaner = geompy.MakeMirrorByPlane(left_cleaner,symPlaneYZ)
-front_cleaner = MakeBox(-10*marge,0.,0.,10.*marge,10.*marge,10.*marge)
-front_cleaner = MakeRotation(front_cleaner,xaxis,3.*math.pi/4.)
-front_cleaner = MakeTranslation(front_cleaner,0.,2.*marge-e_trav,2.*marge)
+front_cleaner = geompy.MakeBox(-10*marge,0.,0.,10.*marge,10.*marge,10.*marge)
+front_cleaner = geompy.MakeRotation(front_cleaner,xaxis,3.*math.pi/4.)
+front_cleaner = geompy.MakeTranslation(front_cleaner,0.,2.*marge-e_trav,2.*marge)
-rear_cleaner = MakeMirrorByPlane(front_cleaner,symPlaneXZ)
+rear_cleaner = geompy.MakeMirrorByPlane(front_cleaner,symPlaneXZ)
#
# Welding
#
-weld = MakeBoolean(coarse_weld,left_cleaner,2)
-weld = MakeBoolean(weld,rear_cleaner,2)
-weld = MakeBoolean(weld,right_cleaner,2)
-weld = MakeBoolean(weld,front_cleaner,2)
-weld = MakeTranslation(weld,
+weld = geompy.MakeBoolean(coarse_weld,left_cleaner,2)
+weld = geompy.MakeBoolean(weld,rear_cleaner,2)
+weld = geompy.MakeBoolean(weld,right_cleaner,2)
+weld = geompy.MakeBoolean(weld,front_cleaner,2)
+weld = geompy.MakeTranslation(weld,
L_base/2.-L_trav/2.,
l_base/2.-L_trav/2.,
h_base)
-weldId = addToStudy(weld,"weld")
+weldId = geompy.addToStudy(weld,"weld")
#
# Assembly
#
#assemblage = MakePartition([base.,weld.GetName()])
-assemblage = MakePartition([base,weld])
-addToStudy(assemblage, "base+weld")
+assemblage = geompy.MakePartition([base,weld])
+geompy.addToStudy(assemblage, "base+weld")
#print assemblage.GetName()
#print trav.GetName()
-#assemblage = MakePartition([assemblage.GetName(),trav.GetName()])
-assemblage = MakePartition([assemblage,trav])
-assemblageId = addToStudy(assemblage, "assemblage")
+#assemblage = geompy.MakePartition([assemblage.GetName(),trav.GetName()])
+assemblage = geompy.MakePartition([assemblage,trav])
+assemblageId = geompy.addToStudy(assemblage, "assemblage")
#
# Display
#
-gg = ImportComponentGUI("GEOM")
+gg = salome.ImportComponentGUI("GEOM")
import salome_ComponentGUI
if not isinstance(gg, type(salome_ComponentGUI)):
gg.initGeomGen()
diff --git a/src/GEOM_SWIG/GEOM_usinggeom.py b/src/GEOM_SWIG/GEOM_usinggeom.py
index e26c9fd15..c7838fdb8 100644
--- a/src/GEOM_SWIG/GEOM_usinggeom.py
+++ b/src/GEOM_SWIG/GEOM_usinggeom.py
@@ -26,7 +26,10 @@
# Author : Damien COQUERET, Open CASCADE
# Module : GEOM
#
-import geompy
+import salome
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
import math
import GEOM_TestAll
diff --git a/src/GEOM_SWIG/Makefile.am b/src/GEOM_SWIG/Makefile.am
index 545b2d8be..0cea1d426 100644
--- a/src/GEOM_SWIG/Makefile.am
+++ b/src/GEOM_SWIG/Makefile.am
@@ -34,9 +34,6 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
# Scripts to be installed.
dist_salomescript_DATA = \
geompy.py \
- geompyDC.py \
- gsketcher.py \
- batchmode_geompy.py \
GEOM_Spanner.py \
GEOM_blocks.py \
GEOM_example.py \
@@ -70,5 +67,10 @@ dist_salomescript_DATA = \
PAL_MESH_033_geometry.py \
PAL_MESH_035_geometry.py
+mypkgpythondir = $(salomepythondir)/salome/geom
+mypkgpython_PYTHON = \
+ geomBuilder.py \
+ gsketcher.py
+
sharedpkgpython_PYTHON = \
GEOM_shared_modules.py
diff --git a/src/GEOM_SWIG/PAL_MESH_019_020_geometry.py b/src/GEOM_SWIG/PAL_MESH_019_020_geometry.py
index c18422a1f..d1aa0cca7 100755
--- a/src/GEOM_SWIG/PAL_MESH_019_020_geometry.py
+++ b/src/GEOM_SWIG/PAL_MESH_019_020_geometry.py
@@ -27,8 +27,11 @@
#GUI test scenario :PAL-MESH-019 (geometry part), PAL-MESH-020 (geometry part)
#####################################################################################
#
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
#Points creation (2.2)
Vertex_1 = geompy.MakeVertex(0, 0, 0)
diff --git a/src/GEOM_SWIG/PAL_MESH_028_geometry.py b/src/GEOM_SWIG/PAL_MESH_028_geometry.py
index 66fb2f9be..6f40010fe 100755
--- a/src/GEOM_SWIG/PAL_MESH_028_geometry.py
+++ b/src/GEOM_SWIG/PAL_MESH_028_geometry.py
@@ -27,12 +27,15 @@
#GUI test scenario :PAL-MESH-028 (geometry part)
#####################################################################
#
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
import os
#Initialization
-salome.salome_init(1)
#Points construction (2.1)
Vertices = [geompy.MakeVertex(0, 0, 0), geompy.MakeVertex(200, 0, 0), geompy.MakeVertex(200, 200, 0), geompy.MakeVertex(0, 200, 0), geompy.MakeVertex(50, 50, 200), geompy.MakeVertex(150, 50, 200), geompy.MakeVertex(150, 150, 200), geompy.MakeVertex(50, 150, 200)]
diff --git a/src/GEOM_SWIG/PAL_MESH_030_geometry.py b/src/GEOM_SWIG/PAL_MESH_030_geometry.py
index c3c36a4b6..704891d85 100755
--- a/src/GEOM_SWIG/PAL_MESH_030_geometry.py
+++ b/src/GEOM_SWIG/PAL_MESH_030_geometry.py
@@ -28,7 +28,10 @@
#==============================================================================
#
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# Stage 2: "Creation of geometry"
diff --git a/src/GEOM_SWIG/PAL_MESH_033_geometry.py b/src/GEOM_SWIG/PAL_MESH_033_geometry.py
index ae81c04b8..df5215952 100755
--- a/src/GEOM_SWIG/PAL_MESH_033_geometry.py
+++ b/src/GEOM_SWIG/PAL_MESH_033_geometry.py
@@ -27,8 +27,11 @@
#GUI test scenario :PAL-MESH-033 (geometry part)
#####################################################################
#
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
#Points creation (2.2)
Vertex_1 = geompy.MakeVertex(0, 0, 0)
diff --git a/src/GEOM_SWIG/PAL_MESH_035_geometry.py b/src/GEOM_SWIG/PAL_MESH_035_geometry.py
index a1672f9c3..2853ae76f 100755
--- a/src/GEOM_SWIG/PAL_MESH_035_geometry.py
+++ b/src/GEOM_SWIG/PAL_MESH_035_geometry.py
@@ -27,8 +27,11 @@
#GUI test scenario :PAL-MESH-035 (geometry part)
#####################################################################
#
-import geompy
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
#Box creation (2.2)
Box_1 = geompy.MakeBoxDXDYDZ(200, 400, 300)
diff --git a/src/GEOM_SWIG/batchmode_geompy.py b/src/GEOM_SWIG/__init__.py
similarity index 84%
rename from src/GEOM_SWIG/batchmode_geompy.py
rename to src/GEOM_SWIG/__init__.py
index 9dce44513..8bdda67b2 100644
--- a/src/GEOM_SWIG/batchmode_geompy.py
+++ b/src/GEOM_SWIG/__init__.py
@@ -21,10 +21,8 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# GEOM GEOM_SWIG : binding of C++ implementaion with Python
-# File : batchmode_geompy.py
+# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
+# File : __init__.py
# Author : Paul RASCLE, EDF
# Module : GEOM
-# From Salome version 3.2.0 geompy package suits for work in batch mode
#
-from geompy import *
diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geomBuilder.py
similarity index 98%
rename from src/GEOM_SWIG/geompyDC.py
rename to src/GEOM_SWIG/geomBuilder.py
index 01e17c1eb..3aedabb4d 100644
--- a/src/GEOM_SWIG/geompyDC.py
+++ b/src/GEOM_SWIG/geomBuilder.py
@@ -17,13 +17,15 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# File : geompy.py
+
+# GEOM GEOM_SWIG : binding of C++ implementation with Python
+# File : geomBuilder.py
# Author : Paul RASCLE, EDF
# Module : GEOM
"""
- \namespace geompy
- \brief Module geompy
+ \namespace geomBuilder
+ \brief Module geomBuilder
"""
##
@@ -134,7 +136,7 @@
## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
-## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
+## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
## @{
## @defgroup l2_import_export Importing/exporting geometrical objects
## @defgroup l2_creating Creating geometrical objects
@@ -195,12 +197,7 @@ import GEOM
import math
import os
-from gsketcher import Sketcher3D
-
-## Enumeration ShapeType as a dictionary. \n
-## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
-# @ingroup l1_geompy_auxiliary
-ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
+from salome.geom.gsketcher import Sketcher3D
# service function
def _toListOfNames(_names, _size=-1):
@@ -215,13 +212,13 @@ def _toListOfNames(_names, _size=-1):
return l
## Raise an Error, containing the Method_name, if Operation is Failed
-## @ingroup l1_geompy_auxiliary
+## @ingroup l1_geomBuilder_auxiliary
def RaiseIfFailed (Method_name, Operation):
if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
## Return list of variables value from salome notebook
-## @ingroup l1_geompy_auxiliary
+## @ingroup l1_geomBuilder_auxiliary
def ParseParameters(*parameters):
Result = []
StringResult = []
@@ -253,7 +250,7 @@ def ParseParameters(*parameters):
return Result
## Return list of variables value from salome notebook
-## @ingroup l1_geompy_auxiliary
+## @ingroup l1_geomBuilder_auxiliary
def ParseList(list):
Result = []
StringResult = ""
@@ -272,7 +269,7 @@ def ParseList(list):
return Result, StringResult
## Return list of variables value from salome notebook
-## @ingroup l1_geompy_auxiliary
+## @ingroup l1_geomBuilder_auxiliary
def ParseSketcherCommand(command):
Result = ""
StringResult = ""
@@ -314,7 +311,7 @@ def ParseSketcherCommand(command):
## \endcode
## @param data unpacked data - a string containing '1' and '0' symbols
## @return data packed to the byte stream
-## @ingroup l1_geompy_auxiliary
+## @ingroup l1_geomBuilder_auxiliary
def PackData(data):
"""
Helper function which can be used to pack the passed string to the byte data.
@@ -356,18 +353,18 @@ def PackData(data):
## texture bitmap itself.
##
## This function can be used to read the texture to the byte stream in order to pass it to
-## the AddTexture() function of geompy class.
+## the AddTexture() function of geomBuilder class.
## For example,
## \code
-## import geompy
-## geompy.init_geom(salome.myStudy)
+## from salome.geom import geomBuilder
+## geompy = geomBuilder.New(salome.myStudy)
## texture = geompy.readtexture('mytexture.dat')
## texture = geompy.AddTexture(*texture)
## obj.SetMarkerTexture(texture)
## \endcode
## @param fname texture file name
## @return sequence of tree values: texture's width, height in pixels and its byte stream
-## @ingroup l1_geompy_auxiliary
+## @ingroup l1_geomBuilder_auxiliary
def ReadTexture(fname):
"""
Read bitmap texture from the text file.
@@ -376,7 +373,7 @@ def ReadTexture(fname):
The function returns width and height of the pixmap in pixels and byte stream representing
texture bitmap itself.
This function can be used to read the texture to the byte stream in order to pass it to
- the AddTexture() function of geompy class.
+ the AddTexture() function of geomBuilder class.
Parameters:
fname texture file name
@@ -385,8 +382,8 @@ def ReadTexture(fname):
sequence of tree values: texture's width, height in pixels and its byte stream
Example of usage:
- import geompy
- geompy.init_geom(salome.myStudy)
+ from salome.geom import geomBuilder
+ geompy = geomBuilder.New(salome.myStudy)
texture = geompy.readtexture('mytexture.dat')
texture = geompy.AddTexture(*texture)
obj.SetMarkerTexture(texture)
@@ -426,11 +423,11 @@ def ReadTexture(fname):
## Returns a long value from enumeration type
# Can be used for CORBA enumerator types like GEOM.shape_type
# @param theItem enumeration type
-# @ingroup l1_geompy_auxiliary
+# @ingroup l1_geomBuilder_auxiliary
def EnumToLong(theItem):
"""
Returns a long value from enumeration type
- Can be used for CORBA enumerator types like geompy.ShapeType
+ Can be used for CORBA enumerator types like geomBuilder.ShapeType
Parameters:
theItem enumeration type
@@ -439,50 +436,8 @@ def EnumToLong(theItem):
if hasattr(theItem, "_v"): ret = theItem._v
return ret
-## Kinds of shape in terms of GEOM.GEOM_IKindOfShape.shape_kind enumeration
-# and a list of parameters, describing the shape.
-# List of parameters, describing the shape:
-# - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
-# - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
-#
-# - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
-#
-# - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
-#
-# - SPHERE: [xc yc zc R]
-# - CYLINDER: [xb yb zb dx dy dz R H]
-# - BOX: [xc yc zc ax ay az]
-# - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
-# - TORUS: [xc yc zc dx dy dz R_1 R_2]
-# - CONE: [xb yb zb dx dy dz R_1 R_2 H]
-# - POLYHEDRON: [nb_faces nb_edges nb_vertices]
-# - SOLID: [nb_faces nb_edges nb_vertices]
-#
-# - SPHERE2D: [xc yc zc R]
-# - CYLINDER2D: [xb yb zb dx dy dz R H]
-# - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
-# - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
-# - DISK_CIRCLE: [xc yc zc dx dy dz R]
-# - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
-# - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
-# - PLANE: [xo yo zo dx dy dz]
-# - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
-# - FACE: [nb_edges nb_vertices]
-#
-# - CIRCLE: [xc yc zc dx dy dz R]
-# - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
-# - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
-# - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
-# - LINE: [xo yo zo dx dy dz]
-# - SEGMENT: [x1 y1 z1 x2 y2 z2]
-# - EDGE: [nb_vertices]
-#
-# - VERTEX: [x y z]
-# @ingroup l1_geompy_auxiliary
-kind = GEOM.GEOM_IKindOfShape
-
## Information about closed/unclosed state of shell or wire
-# @ingroup l1_geompy_auxiliary
+# @ingroup l1_geomBuilder_auxiliary
class info:
"""
Information about closed/unclosed state of shell or wire
@@ -491,9 +446,102 @@ class info:
CLOSED = 1
UNCLOSED = 2
-class geompyDC(GEOM._objref_GEOM_Gen):
+# Warning: geom is a singleton
+geom = None
+engine = None
+doLcc = False
+created = False
+
+class geomBuilder(object, GEOM._objref_GEOM_Gen):
+
+ ## Enumeration ShapeType as a dictionary. \n
+ ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
+ # @ingroup l1_geomBuilder_auxiliary
+ ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
+
+ ## Kinds of shape in terms of GEOM.GEOM_IKindOfShape.shape_kind enumeration
+ # and a list of parameters, describing the shape.
+ # List of parameters, describing the shape:
+ # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
+ # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
+ #
+ # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
+ #
+ # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
+ #
+ # - SPHERE: [xc yc zc R]
+ # - CYLINDER: [xb yb zb dx dy dz R H]
+ # - BOX: [xc yc zc ax ay az]
+ # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
+ # - TORUS: [xc yc zc dx dy dz R_1 R_2]
+ # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
+ # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
+ # - SOLID: [nb_faces nb_edges nb_vertices]
+ #
+ # - SPHERE2D: [xc yc zc R]
+ # - CYLINDER2D: [xb yb zb dx dy dz R H]
+ # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
+ # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
+ # - DISK_CIRCLE: [xc yc zc dx dy dz R]
+ # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
+ # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
+ # - PLANE: [xo yo zo dx dy dz]
+ # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
+ # - FACE: [nb_edges nb_vertices]
+ #
+ # - CIRCLE: [xc yc zc dx dy dz R]
+ # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
+ # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
+ # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
+ # - LINE: [xo yo zo dx dy dz]
+ # - SEGMENT: [x1 y1 z1 x2 y2 z2]
+ # - EDGE: [nb_vertices]
+ #
+ # - VERTEX: [x y z]
+ # @ingroup l1_geomBuilder_auxiliary
+ kind = GEOM.GEOM_IKindOfShape
+
+ def __new__(cls):
+ global engine
+ global geom
+ global doLcc
+ global created
+ #print "__new__ ", engine, geom, doLcc, created
+ if geom is None:
+ # geom engine is either retrieved from engine, or created
+ geom = engine
+ # Following test avoids a recursive loop
+ if doLcc:
+ if geom is not None:
+ # geom engine not created: existing engine found
+ doLcc = False
+ if doLcc and not created:
+ doLcc = False
+ created = True
+ # FindOrLoadComponent called:
+ # 1. CORBA resolution of server
+ # 2. the __new__ method is called again
+ #print "FindOrLoadComponent ", engine, geom, doLcc, created
+ geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
+ else:
+ # FindOrLoadComponent not called
+ if geom is None:
+ # geomBuilder instance is created from lcc.FindOrLoadComponent
+ created = True
+ #print "super ", engine, geom, doLcc, created
+ geom = super(geomBuilder,cls).__new__(cls)
+ else:
+ # geom engine not created: existing engine found
+ #print "existing ", engine, geom, doLcc, created
+ pass
+
+ return geom
+
+ return geom
def __init__(self):
+ #global created
+ #print "-------- geomBuilder __init__ --- ", created, self
GEOM._objref_GEOM_Gen.__init__(self)
self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
self.myBuilder = None
@@ -4265,7 +4313,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
Quantity of solids.
"""
# Example: see GEOM_TestOthers.py
- nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
+ nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
RaiseIfFailed("NumberOfSolids", self.ShapesOp)
return nb_solids
@@ -5373,7 +5421,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
Explode a shape on sub-shapes of a given type.
Parameters:
- aShape Shape to be exploded (see geompy.ShapeType)
+ aShape Shape to be exploded (see geompy.ShapeType)
aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
Returns:
@@ -6650,7 +6698,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
New GEOM.GEOM_Object, containing the result shapes.
"""
# Example: see GEOM_TestAll.py
- if Limit == ShapeType["AUTO"]:
+ if Limit == self.ShapeType["AUTO"]:
# automatic detection of the most appropriate shape limit type
lim = GEOM.SHAPE
for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
@@ -6698,7 +6746,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
Returns:
New GEOM.GEOM_Object, containing the result shapes.
"""
- if Limit == ShapeType["AUTO"]:
+ if Limit == self.ShapeType["AUTO"]:
# automatic detection of the most appropriate shape limit type
lim = GEOM.SHAPE
for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
@@ -8182,7 +8230,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
New GEOM.GEOM_Object, containing the result shape.
Example of usage:
- filletall = geompy.MakeFilletAll(prism, 10.)
+ filletall = geompy.MakeFilletAll(prism, 10.)
"""
# Example: see GEOM_TestOthers.py
theR,Parameters = ParseParameters(theR)
@@ -8238,7 +8286,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# Example: see GEOM_TestAll.py
theR,Parameters = ParseParameters(theR)
anObj = None
- if theShapeType == ShapeType["EDGE"]:
+ if theShapeType == self.ShapeType["EDGE"]:
anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
RaiseIfFailed("MakeFilletEdges", self.LocalOp)
else:
@@ -8265,7 +8313,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
"""
theR1,theR2,Parameters = ParseParameters(theR1,theR2)
anObj = None
- if theShapeType == ShapeType["EDGE"]:
+ if theShapeType == self.ShapeType["EDGE"]:
anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
else:
@@ -8642,7 +8690,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# Example: see GEOM_TestOthers.py
anObj = None
# note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
- if aShapeType == ShapeType["EDGE"]:
+ if aShapeType == self.ShapeType["EDGE"]:
anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
else:
anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
@@ -9367,11 +9415,11 @@ class geompyDC(GEOM._objref_GEOM_Gen):
"""
# Example: see GEOM_TestMeasures.py
aDict = {}
- for typeSh in ShapeType:
+ for typeSh in self.ShapeType:
if typeSh in ( "AUTO", "SHAPE" ): continue
- listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
+ listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
Nb = len(listSh)
- if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
+ if EnumToLong(theShape.GetShapeType()) == self.ShapeType[typeSh]:
Nb = Nb + 1
pass
aDict[typeSh] = Nb
@@ -9487,7 +9535,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
New GEOM.GEOM_Object, containing the created vertex.
"""
# Example: see GEOM_TestMeasures.py
- nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
+ nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
# note: auto-publishing is done in self.GetVertexByIndex()
anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
RaiseIfFailed("GetLastVertex", self.MeasuOp)
@@ -11432,7 +11480,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
Returns:
a newly created GEOM group of edges.
"""
- edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
+ edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
edges_in_range = []
for edge in edges:
Props = self.BasicProperties(edge)
@@ -11450,7 +11498,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
return None
# note: auto-publishing is done in self.CreateGroup()
- group_edges = self.CreateGroup(theShape, ShapeType["EDGE"], theName)
+ group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
self.UnionList(group_edges, edges_in_range)
return group_edges
@@ -12008,7 +12056,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Add Path to load python scripts from
# @param Path a path to load python scripts from
- # @ingroup l1_geompy_auxiliary
+ # @ingroup l1_geomBuilder_auxiliary
def addPath(self,Path):
"""
Add Path to load python scripts from
@@ -12024,7 +12072,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Load marker texture from the file
# @param Path a path to the texture file
# @return unique texture identifier
- # @ingroup l1_geompy_auxiliary
+ # @ingroup l1_geomBuilder_auxiliary
def LoadTexture(self, Path):
"""
Load marker texture from the file
@@ -12046,7 +12094,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# appropriate reason (e.g. for identification of geometry object).
# @param obj geometry object
# @return unique object identifier
- # @ingroup l1_geompy_auxiliary
+ # @ingroup l1_geomBuilder_auxiliary
def getObjectID(self, obj):
"""
Get internal name of the object based on its study entry.
@@ -12083,7 +12131,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param Texture texture data
# @param RowData if @c True, @a Texture data are packed in the byte stream
# @return unique texture identifier
- # @ingroup l1_geompy_auxiliary
+ # @ingroup l1_geomBuilder_auxiliary
def AddTexture(self, Width, Height, Texture, RowData=False):
"""
Add marker texture. Width and Height parameters
@@ -12108,5 +12156,47 @@ class geompyDC(GEOM._objref_GEOM_Gen):
return ID
import omniORB
-#Register the new proxy for GEOM_Gen
-omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)
+# Register the new proxy for GEOM_Gen
+omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
+
+## Create a new geomBuilder instance.The geomBuilder class provides the Python
+# interface to GEOM operations.
+#
+# Typical use is:
+# \code
+# import salome
+# salome.salome_init()
+# from salome.geom import geomBuilder
+# geompy = geomBuilder.New(salome.myStudy)
+# \endcode
+# @param study SALOME study, generally obtained by salome.myStudy.
+# @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
+# @return geomBuilder instance
+def New( study, instance=None):
+ """
+ Create a new geomBuilder instance.The geomBuilder class provides the Python
+ interface to GEOM operations.
+
+ Typical use is:
+ import salome
+ salome.salome_init()
+ from salome.geom import geomBuilder
+ geompy = geomBuilder.New(salome.myStudy)
+
+ Parameters:
+ study SALOME study, generally obtained by salome.myStudy.
+ instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
+ Returns:
+ geomBuilder instance
+ """
+ #print "New geomBuilder ", study, instance
+ global engine
+ global geom
+ global doLcc
+ engine = instance
+ if engine is None:
+ doLcc = True
+ geom = geomBuilder()
+ assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
+ geom.init_geom(study)
+ return geom
diff --git a/src/GEOM_SWIG/geompy.py b/src/GEOM_SWIG/geompy.py
index 6978afed4..75bbe7a88 100644
--- a/src/GEOM_SWIG/geompy.py
+++ b/src/GEOM_SWIG/geompy.py
@@ -27,25 +27,47 @@
# Module : GEOM
#
import salome
-import geompyDC
+from salome.geom import geomBuilder
from salome import *
# retrieve GEOM engine in try/except block
# to avoid problems in some cases, e.g. when generating documentation
try:
- # get GEOM engine
- geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
- # initialize GEOM with current study
- geom.init_geom( salome.myStudy )
+ # get GEOM engine and initialize GEOM with current study
+ engineGeom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
+ geom = geomBuilder.New(salome.myStudy, engineGeom)
- # export the methods of geompyDC
+ # export the methods of geomBuilder
for k in dir( geom ):
if k[0] == '_': continue
globals()[k] = getattr( geom, k )
pass
del k
- from geompyDC import ShapeType, GEOM, kind, info, PackData, ReadTexture, EnumToLong
+ from geomBuilder import ShapeType, GEOM, kind, info, PackData, ReadTexture, EnumToLong
pass
except:
geom = None
pass
+
+print """
+===============================================================================
+WARNING: |
+Usage of geompy.py is deprecated after SALOME V7.2! |
+geompy.py will be removed in a future version! |
+TODO: |
+The following changes in your scripts are required to avoid this message: |
+ |
+replace |
+------- |
+ |
+import geompy |
+geompy.init_geom(theStudy) |
+ |
+with |
+---- |
+ |
+from salome.geom import geomBuilder |
+geompy = geomBuilder.New(theStudy) |
+ |
+===============================================================================
+"""
diff --git a/src/GEOM_SWIG/gsketcher.py b/src/GEOM_SWIG/gsketcher.py
index 19b10c5e0..572536307 100644
--- a/src/GEOM_SWIG/gsketcher.py
+++ b/src/GEOM_SWIG/gsketcher.py
@@ -275,7 +275,7 @@ class Sketcher3D:
sk.addPointsRelative(0,0,130, 70,0,-130)
a3D_Sketcher_1 = sk.wire()
"""
- from geompyDC import ParseSketcherCommand, RaiseIfFailed
+ from salome.geom.geomBuilder import ParseSketcherCommand, RaiseIfFailed
Command,Parameters = ParseSketcherCommand(self.myCommand)
wire = self.geompyD.CurvesOp.Make3DSketcherCommand(Command)
self.myCommand = "3DSketcher"