Salome HOME
Update copyrights
[modules/shaper.git] / test.API / SHAPER / Transformations / TestMultiTranslation.py
index f6e56a82cef4ce67acbbc9682449baa7fea61c4e..8fcce7cac5cb26df40fa8019f15494d16df30f0a 100644 (file)
@@ -1,5 +1,24 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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, or (at your option) any later version.
+#
+# 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
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
 """
-Test case for MultiTranslation feature. 
+Test case for MultiTranslation feature.
 Written on High API.
 """
 from salome.shaper import model
@@ -35,11 +54,11 @@ SketchCircle_1 = Sketch_2.addCircle(3.420516499282639, 6.702654232424678, 2.6604
 model.do()
 
 # Create Wire & Extrusion
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_3")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection("EDGE", "PartSet/OZ"), 50, 0)
 
 # Revolution of the circle
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_1_2f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2r_wire")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
 
 # Create MultiTranslations
 MultiTranslation_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "PartSet/OX"), 15, 5)
@@ -96,7 +115,7 @@ model.testNbResults(MultiTranslation_10, 2)
 model.testNbSubResults(MultiTranslation_10, [3, 3])
 
 def testSubResult(theFeature, theModel, thePartDoc, resultIndex, nbSolidsExpected, nbFacesExpected):
-    result = theFeature.results()[resultIndex].resultSubShapePair()[0] 
+    result = theFeature.results()[resultIndex].resultSubShapePair()[0]
     shape = result.shape()
     shapeExplorer = GeomAPI_ShapeExplorer(shape, GeomAPI_Shape.SOLID)
     nbSolids = 0
@@ -104,7 +123,7 @@ def testSubResult(theFeature, theModel, thePartDoc, resultIndex, nbSolidsExpecte
         nbSolids += 1
         shapeExplorer.next()
     assert(nbSolids == nbSolidsExpected)
-    
+
     shapeExplorer = GeomAPI_ShapeExplorer(shape, GeomAPI_Shape.FACE)
     nbFaces = 0
     selectionList = []
@@ -118,7 +137,7 @@ def testSubResult(theFeature, theModel, thePartDoc, resultIndex, nbSolidsExpecte
     Group_1 = theModel.addGroup(thePartDoc, selectionList)
     theModel.do()
     theModel.end()
-    
+
     # Now you can check that all selected shapes in group have right shape type and name.
     groupFeature = Group_1.feature()
     groupSelectionList = groupFeature.selectionList("group_list")
@@ -155,4 +174,4 @@ assert(MultiTranslation_8.feature().error() == 'Attribute "axis_second_dir" is n
 #model.testNbSubShapes(MultiTranslation_9, GeomAPI_Shape.SOLID, [0])
 #model.testNbSubShapes(MultiTranslation_9, GeomAPI_Shape.SHELL, [10])
 #model.testNbSubShapes(MultiTranslation_9, GeomAPI_Shape.FACE, [30])
-#model.testHaveNamingFaces(MultiTranslation_9, model, Part_1_doc)
\ No newline at end of file
+#model.testHaveNamingFaces(MultiTranslation_9, model, Part_1_doc)