Salome HOME
Implementation of gluing faces by given list (for PAL13191).
[modules/geom.git] / src / GEOM_SWIG / batchmode_geompy.py
index dc34cd4d0e8642b8312317142350d4c35236c725..0f91c8c9dcf4b9e4210e32176a133cf95ea46771 100644 (file)
@@ -31,10 +31,16 @@ import GEOM
 
 g=None
 step = 0
-while step < 50 and g == None:
+sleeping_time = 0.01
+sleeping_time_max = 1.0
+while 1:
     g = lcc.FindOrLoadComponent("FactoryServer", "GEOM")
+    if g is not None: break
     step = step + 1
-    time.sleep(4)
+    if step > 100: break
+    time.sleep(sleeping_time)
+    sleeping_time = max(sleeping_time_max, 2*sleeping_time)
+    pass
 geom = g._narrow( GEOM.GEOM_Gen )
 
 myBuilder = None
@@ -742,6 +748,12 @@ def MakeRotation(aShape,axis,angle):
       print "RotateCopy : ", TrsfOp.GetErrorCode()
     return anObj
 
+def MakeRotationThreePoints(aShape, centpoint, point1, point2):
+    anObj = TrsfOp.RotateThreePointsCopy(aShape, centpoint, point1, point2)
+    if TrsfOp.IsDone() == 0:
+      print "RotateThreePointsCopy : ", TrsfOp.GetErrorCode()
+    return anObj
+
 def MakeScaleTransform(aShape,theCenterofScale,factor):
     anObj = TrsfOp.ScaleShapeCopy(aShape,theCenterofScale,factor)
     if TrsfOp.IsDone() == 0:
@@ -920,7 +932,7 @@ def MakeCDG(aShape):
       print "GetCentreOfMass : ", MeasuOp.GetErrorCode()
     return anObj
 
-def CheckShape(aShape, theIsCheckGeom = 0):
+def CheckShape(theShape, theIsCheckGeom = 0):
     if theIsCheckGeom:
         (IsValid, Status) = MeasuOp.CheckShapeWithGeometry(theShape)
     else: