]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/SMESH_SWIG/smeshDC.py
Salome HOME
0020279: [CEA 334] control the "random" use when using mesh algorithms
[modules/smesh.git] / src / SMESH_SWIG / smeshDC.py
index c9d99bf92085da080656857e756d3fbe5b962825..9afa95394f43c45d392c62b735c30e7572d15303 100644 (file)
@@ -1,4 +1,6 @@
-#  Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
 #  This library is free software; you can redistribute it and/or
@@ -20,7 +22,7 @@
 #  File   : smesh.py
 #  Author : Francis KLOSS, OCC
 #  Module : SMESH
-
+#
 """
  \namespace smesh
  \brief Module smesh
@@ -237,9 +239,7 @@ class smeshDC(SMESH._objref_SMESH_Gen):
     ## Sets the current study and Geometry component
     #  @ingroup l1_auxiliary
     def init_smesh(self,theStudy,geompyD):
-        self.geompyD=geompyD
-        self.SetGeomEngine(geompyD)
-        self.SetCurrentStudy(theStudy)
+        self.SetCurrentStudy(theStudy,geompyD)
 
     ## Creates an empty Mesh. This mesh can have an underlying geometry.
     #  @param obj the Geometrical object on which the mesh is built. If not defined,
@@ -330,8 +330,14 @@ class smeshDC(SMESH._objref_SMESH_Gen):
 
     ## Sets the current study
     #  @ingroup l1_auxiliary
-    def SetCurrentStudy( self, theStudy ):
+    def SetCurrentStudy( self, theStudy, geompyD = None ):
         #self.SetCurrentStudy(theStudy)
+       if not geompyD:
+           import geompy
+           geompyD = geompy.geom
+           pass
+        self.geompyD=geompyD
+        self.SetGeomEngine(geompyD)
         SMESH._objref_SMESH_Gen.SetCurrentStudy(self,theStudy)
 
     ## Gets the current study
@@ -3902,7 +3908,9 @@ class Mesh_Projection3D(Mesh_Algorithm):
         if not mesh is None and isinstance(mesh, Mesh):
             mesh = mesh.GetMesh()
         hyp.SetSourceMesh( mesh )
-        hyp.SetVertexAssociation( srcV1, srcV2, tgtV1, tgtV2 )
+        if srcV1 and srcV2 and tgtV1 and tgtV2:
+            hyp.SetVertexAssociation( srcV1, srcV2, tgtV1, tgtV2 )
+        #elif srcV1 or srcV2 or tgtV1 or tgtV2:
         return hyp
 
     ## Checks if the given "SourceShape3D" hypothesis has the same parameters as given arguments