Salome HOME
Mantis issues 0021432 and 0021404: MakeFace[Wires] should generate exception on attem...
[modules/geom.git] / src / GEOM_SWIG / GEOM_Spanner.py
index 2e410ca9c674aea5e405719bf7b2c84f57595163..ca8bb0b1237697eced69efe683d007ce9ab525e2 100644 (file)
@@ -1,32 +1,37 @@
-#  GEOM GEOM_SWIG : binding of C++ implementaion with Python
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003  CEA
+# 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
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-#
-#
+
+#  GEOM GEOM_SWIG : binding of C++ implementaion with Python
 #  File   : GEOM_Spanner.py
 #  Author : Julia DOROVSKIKH
 #  Module : GEOM
 #  $Header$
-
+# ! Please, if you edit this example file, update also
+# ! GEOM_SRC/doc/salome/gui/GEOM/input/tui_test_spanner.doc
+# ! as some sequences of symbols from this example are used during
+# ! documentation generation to identify certain places of this file
 ############# MakeSpanner #############
-
+#
 def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):
 
   ### Variables ###
@@ -100,7 +105,7 @@ def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):
   else:
     print "Prism 1 is not a hexahedral solid"
 
-  Prism1_faces = geompy.SubShapeAllSorted(Prism1, geompy.ShapeType["FACE"])
+  Prism1_faces = geompy.SubShapeAllSortedCentres(Prism1, geompy.ShapeType["FACE"])
   ii = 1
   for aFace in  Prism1_faces:
     name = geompy.SubShapeName(aFace, Prism1)
@@ -378,7 +383,7 @@ def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):
 
     # ---- add long edges of the top face in study
 
-    FaceTop_edges = geompy.SubShapeAllSorted(FaceTop, geompy.ShapeType["EDGE"])
+    FaceTop_edges = geompy.SubShapeAllSortedCentres(FaceTop, geompy.ShapeType["EDGE"])
     Edge1 = FaceTop_edges[0]
     Edge2 = FaceTop_edges[3]
     Id_Edge1 = geompy.addToStudyInFather(FaceTop, Edge1, "Edge 1")
@@ -400,8 +405,8 @@ def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):
     print algoReg.GetName()
     print algoReg.GetId()
     algoReg.SetName("Regular_1D")
-      
-      
+
+
     hypNbSeg3 = algoReg.NumberOfSegments(3)
     print hypNbSeg3.GetName()
     print hypNbSeg3.GetId()
@@ -419,7 +424,7 @@ def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):
     algoQuad.SetName("Quadrangle_2D")
 
     print "-------------------------- add hypothesis to the Middle Block"
-    
+
     print "-------------------------- LocalLength"
     algoRegMb = mesh.Segment(BlockMh)
     hypLen1 = algoRegMb.LocalLength(10)
@@ -436,14 +441,14 @@ def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):
     print hypPropE1.GetId()
     smesh.SetName(hypPropE1, "Propagation hypothesis")
     smesh.SetName(algoRegE1.GetSubMesh(), "SubMesh Edge 1 of Top Face")
-    
+
     algoRegE2 = mesh.Segment(Edge2)
     hypPropE2 = algoRegE2.Propagation()
     print hypPropE2.GetName()
     print hypPropE2.GetId()
     smesh.SetName(hypPropE2, "Propagation hypothesis")
     smesh.SetName(algoRegE2.GetSubMesh(), "SubMesh Edge 2 of Top Face")
-    
+
     print "-------------------------- compute the mesh"
     mesh.Compute()