]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'master' into cgt/devCEA
authorClarisse Genrault <clarisse.genrault@cea.fr>
Tue, 21 Feb 2017 15:14:42 +0000 (16:14 +0100)
committerClarisse Genrault <clarisse.genrault@cea.fr>
Tue, 21 Feb 2017 15:14:42 +0000 (16:14 +0100)
29 files changed:
src/FeaturesAPI/CMakeLists.txt
src/FeaturesAPI/Test/APIParam_Scale.py [deleted file]
src/FeaturesAPI/Test/APIParam_Symmetry.py [deleted file]
src/FeaturesAPI/Test/APIParam_Translation.py [deleted file]
src/GDMLAPI/CMakeLists.txt
src/GDMLAPI/Test/TestConeSegment.py [deleted file]
src/GeomAlgoAPI/CMakeLists.txt
src/GeomAlgoAPI/Test/TestAPI_Box.py [deleted file]
src/GeomAlgoAPI/Test/TestAPI_Cylinder.py [deleted file]
src/GeomAlgoAPI/Test/TestAPI_GDMLConeSegment.py [deleted file]
src/GeomAlgoAPI/Test/TestAPI_Scale.py [deleted file]
src/GeomAlgoAPI/Test/TestAPI_Symmetry.py [deleted file]
src/GeomAlgoAPI/Test/TestAPI_Translation.py [deleted file]
src/PrimitivesAPI/CMakeLists.txt
src/PrimitivesAPI/Test/TestBox.py [deleted file]
src/PrimitivesAPI/Test/TestCylinder.py [deleted file]
src/PythonAPI/model/tests/tests.py
test.API/SHAPER/GDML/TestAPI_ConeSegment.py [new file with mode: 0644]
test.API/SHAPER/GDML/TestConeSegment.py [new file with mode: 0644]
test.API/SHAPER/Primitives/TestAPI_Box.py [new file with mode: 0644]
test.API/SHAPER/Primitives/TestAPI_Cylinder.py [new file with mode: 0644]
test.API/SHAPER/Primitives/TestBox.py [new file with mode: 0644]
test.API/SHAPER/Primitives/TestCylinder.py [new file with mode: 0644]
test.API/SHAPER/Transformations/TestAPI_Scale.py [new file with mode: 0644]
test.API/SHAPER/Transformations/TestAPI_Symmetry.py [new file with mode: 0644]
test.API/SHAPER/Transformations/TestAPI_Translation.py [new file with mode: 0644]
test.API/SHAPER/Transformations/TestScale.py [new file with mode: 0644]
test.API/SHAPER/Transformations/TestSymmetry.py [new file with mode: 0644]
test.API/SHAPER/Transformations/TestTranslation.py [new file with mode: 0644]

index b8ad3fe095d90c0d3cb639b4e08eaf8ef0e48c61..4b94f992a795a675c04155fddb9468a36cfa49c1 100644 (file)
@@ -1,7 +1,6 @@
 ## Copyright (C) 2014-2016 CEA/DEN, EDF R&D
 
 INCLUDE(Common)
-INCLUDE(UnitTest)
 
 SET(PROJECT_HEADERS
   FeaturesAPI.h
@@ -97,7 +96,3 @@ ENDIF(WIN32)
 INSTALL(TARGETS _FeaturesAPI DESTINATION ${SHAPER_INSTALL_SWIG})
 INSTALL(TARGETS FeaturesAPI DESTINATION ${SHAPER_INSTALL_BIN})
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/FeaturesAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
-
-ADD_UNIT_TESTS(APIParam_Scale.py
-               APIParam_Symmetry.py
-               APIParam_Translation.py)
\ No newline at end of file
diff --git a/src/FeaturesAPI/Test/APIParam_Scale.py b/src/FeaturesAPI/Test/APIParam_Scale.py
deleted file mode 100644 (file)
index f0a33e0..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-"""
-Test case for Scale feature. 
-Written on High API.
-"""
-from ModelAPI import *
-from GeomAPI import *
-
-from salome.shaper import model
-
-# Get session
-aSession = ModelAPI_Session.get()
-
-# Create a part
-aDocument = aSession.activeDocument()
-aSession.startOperation()
-model.addPart(aDocument)
-aDocument = aSession.activeDocument()
-aSession.finishOperation()
-
-# Create a box
-aSession.startOperation()
-aCenterPoint = model.addPoint(aDocument, 20, 20, 0).result()
-aBox1 =  model.addBox(aDocument, 10, 10, 10)
-aBox2 =  model.addBox(aDocument, 10, 10, 10)
-aSession.finishOperation()
-
-# Perform a symmetry by a point
-aSession.startOperation()
-aScale1 = model.addScale(aDocument, [model.selection("SOLID", "Box_1_1")], aCenterPoint, 2.0).result()
-aSession.finishOperation()
-assert (aScale1 is not None)
-
-# Perform a symmetry by an axis
-aSession.startOperation()
-aScale2 = model.addScale(aDocument, [model.selection("SOLID", "Box_2_1")], aCenterPoint, -0.5, 2, 3.7).result()
-aSession.finishOperation()
-assert (aScale2 is not None)
\ No newline at end of file
diff --git a/src/FeaturesAPI/Test/APIParam_Symmetry.py b/src/FeaturesAPI/Test/APIParam_Symmetry.py
deleted file mode 100644 (file)
index 97aca11..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-"""
-Test case for Symmetry feature. 
-Written on High API.
-"""
-from ModelAPI import *
-from GeomAPI import *
-
-from salome.shaper import model
-
-# Get session
-aSession = ModelAPI_Session.get()
-
-# Create a part
-aDocument = aSession.activeDocument()
-aSession.startOperation()
-model.addPart(aDocument)
-aDocument = aSession.activeDocument()
-aSession.finishOperation()
-
-# Create a box
-aSession.startOperation()
-aBox1 =  model.addBox(aDocument, 10, 10, 10)
-aBox2 =  model.addBox(aDocument, 10, 10, 10)
-aBox3 =  model.addBox(aDocument, 10, 10, 10)
-aSession.finishOperation()
-
-# Perform a symmetry by a point
-aSession.startOperation()
-aPoint = model.addPoint(aDocument, 0, 0, 0).result()
-aSymmetry1 = model.addSymmetry(aDocument, [model.selection("SOLID", "Box_1_1")], aPoint).result()
-aSession.finishOperation()
-assert (aSymmetry1 is not None)
-
-# Perform a symmetry by an axis
-aSession.startOperation()
-anAxis = model.addAxis(aDocument, 10, 0, 0).result()
-aSymmetry2 = model.addSymmetry(aDocument, [model.selection("SOLID", "Box_2_1")], anAxis).result()
-aSession.finishOperation()
-assert (aSymmetry2 is not None)
-
-# Perform a symmetry by a plane
-aSession.startOperation()
-aPoint1 = model.addPoint(aDocument, 0, 0, 0).result()
-aPoint2 = model.addPoint(aDocument, 10, 10, 0).result()
-aSymmetry3 = model.addSymmetry(aDocument, [model.selection("SOLID", "Box_3_1")], model.selection("FACE", "Box_3_1/Top")).result()
-aSession.finishOperation()
-assert (aSymmetry3 is not None)
\ No newline at end of file
diff --git a/src/FeaturesAPI/Test/APIParam_Translation.py b/src/FeaturesAPI/Test/APIParam_Translation.py
deleted file mode 100644 (file)
index 85657d3..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-"""
-Test case for Translation feature. 
-Written on High API.
-"""
-from ModelAPI import *
-from GeomAPI import *
-
-from salome.shaper import model
-
-# Get session
-aSession = ModelAPI_Session.get()
-
-# Create a part
-aDocument = aSession.activeDocument()
-aSession.startOperation()
-model.addPart(aDocument)
-aDocument = aSession.activeDocument()
-aSession.finishOperation()
-
-# Create a box
-
-aSession.startOperation()
-aBox =  model.addBox(aDocument, 10, 10, 10)
-
-# Perform a translation by an axis and a distance
-aSession.startOperation()
-aTranslation1 = model.addTranslation(aDocument, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "Box_1_1/Front&Box_1_1/Bottom"), 20).result()
-aSession.finishOperation()
-assert (aTranslation1 is not None)
-
-# Perform a translation by DX, DY, DZ vector
-aSession.startOperation()
-aTranslation2 = model.addTranslation(aDocument, [model.selection("SOLID", "Box_1_1")], 10, 10, 10).result()
-aSession.finishOperation()
-assert (aTranslation2 is not None)
-
-# Perform a translation by two points
-aSession.startOperation()
-aPoint1 = model.addPoint(aDocument, 0, 0, 0).result()
-aPoint2 = model.addPoint(aDocument, 10, 10, 0).result()
-aTranslation3 = model.addTranslation(aDocument, [model.selection("SOLID", "Box_1_1")], aPoint1, aPoint2).result()
-aSession.finishOperation()
-assert (aTranslation3 is not None)
index 9084ba827ef1dddc2fc2aaf804e7e4aeda390b3e..0f8db566f64147e0fa44bce40ccb4198192f21c9 100644 (file)
@@ -1,7 +1,6 @@
 ## Copyright (C) 2014-2016 CEA/DEN, EDF R&D
 
 INCLUDE(Common)
-INCLUDE(UnitTest)
 
 SET(PROJECT_HEADERS
   GDMLAPI.h
@@ -65,6 +64,3 @@ ENDIF(WIN32)
 INSTALL(TARGETS _GDMLAPI DESTINATION ${SHAPER_INSTALL_SWIG})
 INSTALL(TARGETS GDMLAPI DESTINATION ${SHAPER_INSTALL_BIN})
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/GDMLAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
-
-# Tests
-ADD_UNIT_TESTS(TestConeSegment.py)
\ No newline at end of file
diff --git a/src/GDMLAPI/Test/TestConeSegment.py b/src/GDMLAPI/Test/TestConeSegment.py
deleted file mode 100644 (file)
index d58b45a..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-"""
-Test case for GDML Primitive Cone Segment feature. 
-Written on High API.
-"""
-from ModelAPI import *
-from GeomAPI import *
-
-from salome.shaper import model
-
-# Get session
-aSession = ModelAPI_Session.get()
-
-# Create a part
-aDocument = aSession.activeDocument()
-aSession.startOperation()
-model.addPart(aDocument)
-aDocument = aSession.activeDocument()
-aSession.finishOperation()
-
-# Create several "cone segment"
-aSession.startOperation()
-aCS1 = model.addConeSegment(aDocument,7.,11.,5.,8.,12.,0.,270.).result()
-aSession.finishOperation()
-assert (aCS1 is not None)
-
-aSession.startOperation()
-aCS2 = model.addConeSegment(aDocument,5.,10.,7.,15.,15.,45.,180.).result()
-aSession.finishOperation()
-assert (aCS2 is not None)
-
-aSession.startOperation()
-aCS3 = model.addConeSegment(aDocument,5.,10.,7.,15.,15.,-45.,180.).result()
-aSession.finishOperation()
-assert (aCS3 is not None)
-
-aSession.startOperation()
-aCS4 = model.addConeSegment(aDocument,0.,10.,2.,7.,3.,0.,270.).result()
-aSession.finishOperation()
-assert (aCS4 is not None)
-
-aSession.startOperation()
-aCS5 = model.addConeSegment(aDocument,5.,8.,0.,6.,10.,45.,270.).result()
-aSession.finishOperation()
-assert (aCS5 is not None)
-
-aSession.startOperation()
-aCS6 = model.addConeSegment(aDocument,0.,6.,0.,4.,17.,0.,270.).result()
-aSession.finishOperation()
-assert (aCS6 is not None)
-
-aSession.startOperation()
-aCS7 = model.addConeSegment(aDocument,7.,11.,5.,8.,12.,0.,360.).result()
-aSession.finishOperation()
-assert (aCS7 is not None)
-
-aSession.startOperation()
-aCS8 = model.addConeSegment(aDocument,-5.,11.,5.,8.,12.,0.,270.)
-aSession.finishOperation()
-assert (len(aCS8.results()) == 0)
-
-aSession.startOperation()
-aCS9 = model.addConeSegment(aDocument,11.,7.,5.,8.,12.,0.,270.)
-aSession.finishOperation()
-assert (len(aCS9.results()) == 0)
-
-aSession.startOperation()
-aCS10 = model.addConeSegment(aDocument,7.,11.,8.,5.,12.,0.,270.)
-aSession.finishOperation()
-assert (len(aCS10.results()) == 0)
-
-aSession.startOperation()
-aCS11 = model.addConeSegment(aDocument,7.,11.,-3.,5.,12.,0.,270.)
-aSession.finishOperation()
-assert (len(aCS11.results()) == 0)
-
-aSession.startOperation()
-aCS12 = model.addConeSegment(aDocument,7.,11.,5.,8.,0.,0.,270.)
-aSession.finishOperation()
-assert (len(aCS12.results()) == 0)
-
-aSession.startOperation()
-aCS13 = model.addConeSegment(aDocument,7.,11.,5.,8.,-10.,0.,270.)
-aSession.finishOperation()
-assert (len(aCS13.results()) == 0)
-
-aSession.startOperation()
-aCS14 = model.addConeSegment(aDocument,7.,11.,5.,8.,12.,-45.,-45.)
-aSession.finishOperation()
-assert (len(aCS14.results()) == 0)
-
-aSession.startOperation()
-aCS15 = model.addConeSegment(aDocument,7.,11.,5.,8.,12.,45.,450.)
-aSession.finishOperation()
-assert (len(aCS15.results()) == 0)
-
-aSession.startOperation()
-model.addParameter(aDocument,"rmin1","7.")
-model.addParameter(aDocument,"rmax1","11.")
-model.addParameter(aDocument,"rmin2","5.")
-model.addParameter(aDocument,"rmax2","8.")
-model.addParameter(aDocument,"z","12.")
-model.addParameter(aDocument,"startphi","0.")
-model.addParameter(aDocument,"deltaphi","270.")
-aCS16 = model.addConeSegment(aDocument,"rmin1","rmax1","rmin2","rmax2","z","startphi","deltaphi").result()
-aSession.finishOperation()
-assert (aCS16 is not None)
index 47a4266decdfab4eb7531f0514355c54f5309026..2b5d6a2c6089ffab441f6356c7cf69fa8dc5b9ae 100644 (file)
@@ -4,7 +4,6 @@ FIND_PACKAGE(SWIG REQUIRED)
 
 INCLUDE(${SWIG_USE_FILE})
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
-INCLUDE(UnitTest)
 
 SET(PROJECT_HEADERS
     GeomAlgoAPI.h
@@ -160,10 +159,3 @@ INSTALL(TARGETS _GeomAlgoAPI DESTINATION ${SHAPER_INSTALL_SWIG})
 INSTALL(TARGETS GeomAlgoAPI DESTINATION ${SHAPER_INSTALL_BIN})
 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
 
-ADD_UNIT_TESTS(TestAPI_Box.py
-               TestAPI_Cylinder.py
-               TestAPI_GDMLConeSegment.py
-               TestAPI_Scale.py
-               TestAPI_Symmetry.py
-               TestAPI_Translation.py)
-
diff --git a/src/GeomAlgoAPI/Test/TestAPI_Box.py b/src/GeomAlgoAPI/Test/TestAPI_Box.py
deleted file mode 100644 (file)
index c3d445d..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-# Copyright (C) 2014-2016 CEA/DEN, EDF R&D
-
-# File:        TestAPI_Box.py
-# Created:     16 Sept 2016
-# Author:      Clarisse Genrault (CEA)
-
-from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
-from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
-from GeomAPI import GeomAPI_Pnt as pnt
-
-# Create a box with dimensions    
-try :    
-  box1 = shaperpy.makeBox(10.,10.,10.)
-  print "box1 : ok"
-  
-except myExcept,ec:
-  print "box1 : ko (" + ec.what() + ")"
-  
-try :    
-  box2 = shaperpy.makeBox(0.,10.,10.)
-  print "box2 : ok"
-  
-except myExcept,ec:
-  print "box2 : ko (" + ec.what() + ")"
-
-try :    
-  box3 = shaperpy.makeBox(10.,0.,10.)
-  print "box3 : ok"
-  
-except myExcept,ec:
-  print "box3 : ko (" + ec.what() + ")"
-  
-try :    
-  box4 = shaperpy.makeBox(10.,10.,0.)
-  print "box4 : ok"
-  
-except myExcept,ec:
-  print "box4 : ko (" + ec.what() + ")"
-  
-try :    
-  box5 = shaperpy.makeBox(-10.,10.,10.)
-  print "box5 : ok"
-  
-except myExcept,ec:
-  print "box5 : ko (" + ec.what() + ")"
-  
-try :    
-  box6 = shaperpy.makeBox(10.,-10.,10.)
-  print "box6 : ok"
-  
-except myExcept,ec:
-  print "box6 : ko (" + ec.what() + ")"
-  
-try :    
-  box7 = shaperpy.makeBox(10.,10.,-10.)
-  print "box7 : ok"
-  
-except myExcept,ec:
-  print "box7 : ko (" + ec.what() + ")"
-
-# Create a box with two points defining the diagonal   
-try :    
-  pnt1 = pnt(0.,0.,0.)
-  pnt2 = pnt(50.,50.,50.)
-  box8 = shaperpy.makeBox(pnt1,pnt2)
-  print "box8 : ok"
-  
-except myExcept,ec:
-  print "box8 : ko (" + ec.what() + ")"
-
-try :    
-  pnt1 = pnt(0.,0.,0.)
-  box9 = shaperpy.makeBox(pnt1,pnt1)
-  print "box9 : ok"
-  
-except myExcept,ec:
-  print "box9 : ko (" + ec.what() + ")"
-  
-try :    
-  pnt1 = pnt(0.,0.,0.)
-  pnt2 = pnt(0.,50.,50.)
-  box10 = shaperpy.makeBox(pnt1,pnt2)
-  print "box10 : ok"
-  
-except myExcept,ec:
-  print "box10 : ko (" + ec.what() + ")"
-  
-try :    
-  pnt1 = pnt(0.,0.,0.)
-  pnt2 = pnt(50.,0.,50.)
-  box11 = shaperpy.makeBox(pnt1,pnt2)
-  print "box11 : ok"
-  
-except myExcept,ec:
-  print "box11 : ko (" + ec.what() + ")"
-  
-try :    
-  pnt1 = pnt(0.,0.,0.)
-  pnt2 = pnt(50.,50.,0.)
-  box12 = shaperpy.makeBox(pnt1,pnt2)
-  print "box12 : ok"
-  
-except myExcept,ec:
-  print "box12 : ko (" + ec.what() + ")"
-  
-try :    
-  pnt1 = pnt(50.,50.,50.)
-  box13 = shaperpy.makeBox(pnt1,None)
-  print "box13 : ok"
-  
-except myExcept,ec:
-  print "box13 : ko (" + ec.what() + ")"
-  
-try :    
-  pnt2 = pnt(50.,50.,50.)
-  box14 = shaperpy.makeBox(None,pnt2)
-  print "box14 : ok"
-  
-except myExcept,ec:
-  print "box14 : ko (" + ec.what() + ")"
-  
diff --git a/src/GeomAlgoAPI/Test/TestAPI_Cylinder.py b/src/GeomAlgoAPI/Test/TestAPI_Cylinder.py
deleted file mode 100644 (file)
index 50a4b87..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2014-201x CEA/DEN, EDF R&D
-
-# File:        TestAPI_Cylinder.py
-# Created:     13 Jan 2017
-# Author:      Clarisse Genrault (CEA)
-
-from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
-from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
-from GeomAlgoAPI import GeomAlgoAPI_EdgeBuilder as edgeBuilder
-from GeomAPI import GeomAPI_Pnt as pnt
-
-aPoint = pnt(10.,5.,0.)
-anEdge = edgeBuilder.line(1.,0.,0.)
-
-# Create a cylinder
-try :    
-  cylinder1 = shaperpy.makeCylinder(5., 20.)
-  
-except myExcept,ec:
-  print ec.what()
-
-# Create a cylinder
-try :    
-  cylinder2 = shaperpy.makeCylinder(5., 20., 100.)
-  
-except myExcept,ec:
-  print ec.what()
-  
-# Create a cylinder
-try :
-  cylinder3 = shaperpy.makeCylinder(aPoint, anEdge, 5., 20.)
-  
-except myExcept,ec:
-  print ec.what()
-  
-# Create a cylinder
-try :
-  cylinder4 = shaperpy.makeCylinder(aPoint, anEdge, 5., 20., 180.)
-  
-except myExcept,ec:
-  print ec.what()
\ No newline at end of file
diff --git a/src/GeomAlgoAPI/Test/TestAPI_GDMLConeSegment.py b/src/GeomAlgoAPI/Test/TestAPI_GDMLConeSegment.py
deleted file mode 100644 (file)
index 59a58dd..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright (C) 2014-2016 CEA/DEN, EDF R&D
-
-# File:        TestAPI_Box.py
-# Created:     29 Nov 2016
-# Author:      Clarisse Genrault (CEA)
-
-from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
-from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
-from GeomAPI import GeomAPI_Pnt as pnt
-
-# Create several "cone segment"
-try :    
-  CS1 = shaperpy.makeConeSegment(7.,11.,5.,8.,12.,0.,270.)
-except myExcept,ec:
-  print ec.what()
-  
-try :    
-  CS2 = shaperpy.makeConeSegment(5.,10.,7.,15.,15.,45.,180.)
-except myExcept,ec:
-  print ec.what()
-
-try :    
-  CS3 = shaperpy.makeConeSegment(5.,10.,7.,15.,15.,-45.,180.)
-except myExcept,ec:
-  print ec.what()
-  
-try :    
-  CS4 = shaperpy.makeConeSegment(0.,10.,2.,7.,3.,0.,270.)
-except myExcept,ec:
-  print ec.what()
-
-try :    
-  CS5 = shaperpy.makeConeSegment(5.,8.,0.,6.,10.,45.,270.)
-except myExcept,ec:
-  print ec.what()
-
-try :    
-  CS6 = shaperpy.makeConeSegment(0.,6.,0.,4.,17.,0.,270.)
-except myExcept,ec:
-  print ec.what()
-
-try :    
-  CS7 = shaperpy.makeConeSegment(7.,11.,5.,8.,12.,0.,360.)
-except myExcept,ec:
-  print ec.what()
-
-try :    
-  CS8 = shaperpy.makeConeSegment(-5.,11.,5.,8.,12.,0.,270.)
-except myExcept,ec:
-  print ec.what()
-
-try :    
-  CS9 = shaperpy.makeConeSegment(11.,7.,5.,8.,12.,0.,270.)
-except myExcept,ec:
-  print ec.what()
-
-try :    
-  CS10 = shaperpy.makeConeSegment(7.,11.,8.,5.,12.,0.,270.)
-except myExcept,ec:
-  print ec.what()
-
-try :    
-  CS11 = shaperpy.makeConeSegment(7.,11.,-3.,5.,12.,0.,270.)
-except myExcept,ec:
-  print ec.what()
-
-try :    
-  CS12 = shaperpy.makeConeSegment(7.,11.,5.,8.,0.,0.,270.)
-except myExcept,ec:
-  print ec.what()
-
-try :    
-  CS13 = shaperpy.makeConeSegment(7.,11.,5.,8.,-10.,0.,270.)
-except myExcept,ec:
-  print ec.what()
-
-try :    
-  CS14 = shaperpy.makeConeSegment(7.,11.,5.,8.,12.,-45.,-45.)
-except myExcept,ec:
-  print ec.what()
-
-try :    
-  CS15 = shaperpy.makeConeSegment(7.,11.,5.,8.,12.,45.,450.)
-except myExcept,ec:
-  print ec.what()
\ No newline at end of file
diff --git a/src/GeomAlgoAPI/Test/TestAPI_Scale.py b/src/GeomAlgoAPI/Test/TestAPI_Scale.py
deleted file mode 100644 (file)
index a601348..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2014-201x CEA/DEN, EDF R&D
-
-# File:        TestAPI_Scale.py
-# Created:     25 Jan 2017
-# Author:      Clarisse Genrault (CEA)
-
-from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
-from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
-from GeomAPI import GeomAPI_Pnt as pnt
-
-# Create a box
-try :
-  box1 = shaperpy.makeBox(10.,10.,10.)
-  box2 = shaperpy.makeBox(10.,10.,10.)
-  centerPoint = pnt(20.,20.,0.)
-except myExcept, ec:
-  print ec.what()
-
-# Perfom a scale by a factor.
-try :
-  scale1 = shaperpy.makeScale(box1,centerPoint, -1.6)
-except myExcept, ec:
-  print ec.what()
-
-# Perfom a scale by dimensions.
-try :
-  scale2 = shaperpy.makeScale(box2,centerPoint, 2, -0.5, 1.3)
-except myExcept, ec:
-  print ec.what()
diff --git a/src/GeomAlgoAPI/Test/TestAPI_Symmetry.py b/src/GeomAlgoAPI/Test/TestAPI_Symmetry.py
deleted file mode 100644 (file)
index 409d398..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (C) 2014-2016 CEA/DEN, EDF R&D
-
-# File:        TestAPI_Symmetry.py
-# Created:     15 Nov 2016
-# Author:      Clarisse Genrault (CEA)
-
-from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
-from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
-from GeomAPI import GeomAPI_Ax1 as axis
-from GeomAPI import GeomAPI_Ax2 as plane
-from GeomAPI import GeomAPI_Pnt as pnt
-from GeomAPI import GeomAPI_Dir as direction
-
-# Create a box
-try :
-  box1 = shaperpy.makeBox(10.,10.,10.)
-  box2 = shaperpy.makeBox(10.,10.,10.)
-  box3 = shaperpy.makeBox(10.,10.,10.)
-except myExcept, ec:
-  print ec.what()
-
-# Perfom a symmetry by a point.
-try :
-  origin = pnt(0.,0.,0.)
-  symmetry1 = shaperpy.makeSymmetry(box1,origin)
-except myExcept, ec:
-  print ec.what()
-
-# Perfom a symmetry by an axis.
-try :
-  xDir = direction(1.,0.,0.)
-  xAxis = axis(origin, xDir)
-  translation2 = shaperpy.makeSymmetry(box2,xAxis)
-except myExcept, ec:
-  print ec.what()
-
-# Perfom a symmetry by a plane.
-try :
-  pnt1 = pnt(0.,0.,10.)
-  pnt2 = pnt(10.,0.,10.)
-  aPlane = plane(origin, xDir)
-  translation3 = shaperpy.makeSymmetry(box3,aPlane)
-except myExcept, ec:
-  print ec.what()
diff --git a/src/GeomAlgoAPI/Test/TestAPI_Translation.py b/src/GeomAlgoAPI/Test/TestAPI_Translation.py
deleted file mode 100644 (file)
index b393391..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2014-2016 CEA/DEN, EDF R&D
-
-# File:        TestAPI_Translation.py
-# Created:     15 Nov 2016
-# Author:      Clarisse Genrault (CEA)
-
-from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
-from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
-from GeomAPI import GeomAPI_Ax1 as axis
-from GeomAPI import GeomAPI_Pnt as pnt
-from GeomAPI import GeomAPI_Dir as direction
-
-# Create a box
-try :
-  box = shaperpy.makeBox(10.,10.,10.)
-except myExcept, ec:
-  print ec.what()
-
-# Perfom a translation with an axis and a distance.
-try :
-  origin = pnt(0.,0.,0.)
-  xDir = direction(1.,0.,0.)
-  xAxis = axis(origin, xDir)
-  translation1 = shaperpy.makeTranslation(box,xAxis,15.)
-except myExcept, ec:
-  print ec.what()
-
-# Perfom a translation with dimensions.
-try :
-  translation2 = shaperpy.makeTranslation(box,10,0,0)
-except myExcept, ec:
-  print ec.what()
-
-# Perfom a translation with two points.
-try :
-  pnt1 = pnt(10.,0.,0.)
-  pnt2 = pnt(10.,15.,0.)
-  translation3 = shaperpy.makeTranslation(box,pnt1,pnt2)
-except myExcept, ec:
-  print ec.what()
index d0fa875935caaa4ea44297e45e07f6d6cd92ebfd..abd9c9f1fa0363a7b91c0aa7b3830d1ad533ce12 100644 (file)
@@ -1,7 +1,6 @@
 ## Copyright (C) 2014-2016 CEA/DEN, EDF R&D
 
 INCLUDE(Common)
-INCLUDE(UnitTest)
 
 SET(PROJECT_HEADERS
   PrimitivesAPI.h
@@ -67,7 +66,3 @@ ENDIF(WIN32)
 INSTALL(TARGETS _PrimitivesAPI DESTINATION ${SHAPER_INSTALL_SWIG})
 INSTALL(TARGETS PrimitivesAPI DESTINATION ${SHAPER_INSTALL_BIN})
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/PrimitivesAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
-
-# Tests
-ADD_UNIT_TESTS(TestBox.py
-               TestCylinder.py)
\ No newline at end of file
diff --git a/src/PrimitivesAPI/Test/TestBox.py b/src/PrimitivesAPI/Test/TestBox.py
deleted file mode 100644 (file)
index bc80102..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-"""
-Test case for Primitive Box feature. 
-Written on High API.
-"""
-from ModelAPI import *
-from GeomAPI import *
-
-from salome.shaper import model
-
-# Get session
-aSession = ModelAPI_Session.get()
-
-# Create a part
-aDocument = aSession.activeDocument()
-aSession.startOperation()
-model.addPart(aDocument)
-aDocument = aSession.activeDocument()
-aSession.finishOperation()
-
-# Create a box with dimensions
-aSession.startOperation()
-aBox1 = model.addBox(aDocument, 10, 10, 10)
-model.testNbResults(aBox1, 1)
-model.testNbSubShapes(aBox1, GeomAPI_Shape.SOLID, [1])
-model.testNbSubShapes(aBox1, GeomAPI_Shape.FACE, [6])
-print "box1 : ok"
-aSession.finishOperation()
-
-aSession.startOperation()
-aBox2 = model.addBox(aDocument, 0, 10, 10)
-model.testNbResults(aBox2, 0)
-print "box2 : ko (" + aBox2.feature().error() + ")"
-aSession.finishOperation()
-
-aSession.startOperation()
-aBox3 = model.addBox(aDocument, 10, 0, 10)
-model.testNbResults(aBox3, 0)
-print "box3 : ko (" + aBox3.feature().error() + ")"
-aSession.finishOperation()
-
-aSession.startOperation()
-aBox4 = model.addBox(aDocument, 10, 10, 0)
-model.testNbResults(aBox4, 0)
-print "box4 : ko (" + aBox4.feature().error() + ")"
-aSession.finishOperation()
-
-aSession.startOperation()
-aBox5 = model.addBox(aDocument, -10, 10, 10)
-model.testNbResults(aBox5, 0)
-print "box5 : ko (" + aBox5.feature().error() + ")"
-aSession.finishOperation()
-
-aSession.startOperation()
-aBox6 = model.addBox(aDocument, 10, -10, 10)
-model.testNbResults(aBox6, 0)
-print "box6 : ko (" + aBox6.feature().error() + ")"
-aSession.finishOperation()
-
-aSession.startOperation()
-aBox7 = model.addBox(aDocument, 10, 10, -10)
-model.testNbResults(aBox7, 0)
-print "box7 : ko (" + aBox7.feature().error() + ")"
-aSession.finishOperation()
-
-# Create a box with 2 points
-aSession.startOperation()
-aPoint1 = model.addPoint(aDocument, 0, 0, 0).result()
-aPoint2 = model.addPoint(aDocument, 50, 50, 50).result()
-aBox8 = model.addBox(aDocument, aPoint1, aPoint2)
-model.testNbResults(aBox8, 1)
-model.testNbSubShapes(aBox8, GeomAPI_Shape.SOLID, [1])
-model.testNbSubShapes(aBox8, GeomAPI_Shape.FACE, [6])
-print "box8 : ok"
-aSession.finishOperation()
-
-aSession.startOperation()
-aPoint1 = model.addPoint(aDocument, 0, 0, 0).result()
-aBox9 = model.addBox(aDocument, aPoint1, aPoint1)
-model.testNbResults(aBox9, 0)
-print "box9 : ko (" + aBox9.feature().error() + ")"
-aSession.finishOperation()
-
-aSession.startOperation()
-aPoint1 = model.addPoint(aDocument, 0, 0, 0).result()
-aPoint2 = model.addPoint(aDocument, 0, 50, 50).result()
-aBox10 = model.addBox(aDocument, aPoint1, aPoint2)
-model.testNbResults(aBox10, 0)
-print "box10 : ko (" + aBox10.feature().error() + ")"
-aSession.finishOperation()
-
-aSession.startOperation()
-aPoint1 = model.addPoint(aDocument, 0, 0, 0).result()
-aPoint2 = model.addPoint(aDocument, 50, 0, 50).result()
-aBox11 = model.addBox(aDocument, aPoint1, aPoint2)
-model.testNbResults(aBox11, 0)
-print "box11 : ko (" + aBox11.feature().error() + ")"
-aSession.finishOperation()
-
-aSession.startOperation()
-aPoint1 = model.addPoint(aDocument, 0, 0, 0).result()
-aPoint2 = model.addPoint(aDocument, 50, 50, 0).result()
-aBox12 = model.addBox(aDocument, aPoint1, aPoint2)
-model.testNbResults(aBox12, 0)
-print "box12 : ko (" + aBox12.feature().error() + ")"
-aSession.finishOperation()
-
-aSession.startOperation()
-aPoint1 = model.selection("VERTEX", "point1")
-aPoint2 = model.addPoint(aDocument, 50, 50, 0).result()
-aBox13 = model.addBox(aDocument, aPoint1, aPoint2)
-model.testNbResults(aBox13, 0)
-print "box13 : ko (" + aBox13.feature().error() + ")"
-aSession.finishOperation()
-
-aSession.startOperation()
-aPoint1 = model.addPoint(aDocument, 0, 0, 0).result()
-aPoint2 = model.selection("VERTEX", "point2")
-aBox14 = model.addBox(aDocument, aPoint1, aPoint2)
-model.testNbResults(aBox14, 0)
-print "box14 : ko (" + aBox14.feature().error() + ")"
-aSession.finishOperation()
-
-aSession.startOperation()
-Sketch_1 = model.addSketch(aDocument, model.defaultPlane("XOY"))
-Sketch_2 = model.addSketch(aDocument, model.defaultPlane("YOZ"))
-SketchLine_1 = Sketch_1.addLine(20, 10, 40, 10)
-SketchLine_2 = Sketch_1.addLine(40, 10, 40, 20)
-SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
-SketchLine_3 = Sketch_1.addLine(40, 20, 20, 20)
-SketchLine_4 = Sketch_1.addLine(20, 20, 20, 10)
-SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
-SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint())
-SketchLine_5 = Sketch_2.addLine(20, 10, 40, 10)
-SketchLine_6 = Sketch_2.addLine(40, 10, 40, 20)
-SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
-SketchLine_7 = Sketch_2.addLine(40, 20, 20, 20)
-SketchLine_8 = Sketch_2.addLine(20, 20, 20, 10)
-SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
-SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_5.startPoint(), SketchLine_8.endPoint())
-aSession.finishOperation()
-
-aSession.startOperation()
-aBox15 = model.addBox(aDocument, model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_4e"),
-                      model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_7s-SketchLine_6e"))
-
-model.testNbResults(aBox15, 1)
-model.testNbSubShapes(aBox15, GeomAPI_Shape.SOLID, [1])
-model.testNbSubShapes(aBox15, GeomAPI_Shape.FACE, [6])
-print "box15 : ok"
-aSession.finishOperation()
-
-aSession.startOperation()
-Extrusion_1 = model.addExtrusion(aDocument, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "PartSet/OZ"), 100, 0)
-Extrusion_2 = model.addExtrusion(aDocument, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "PartSet/OX"), 100, 0)
-aBox16 = model.addBox(aDocument, model.selection("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1"),
-                       model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_1&Extrusion_2_1/To_Face_1"))
-model.testNbResults(aBox16, 1)
-model.testNbSubShapes(aBox16, GeomAPI_Shape.SOLID, [1])
-model.testNbSubShapes(aBox16, GeomAPI_Shape.FACE, [6])
-print "box16 : ok"
-aSession.finishOperation()
-
-aSession.startOperation()
-Vertex_1 = model.addVertex(aDocument, [model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_4e")])
-Vertex_2 = model.addVertex(aDocument, [model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_7s-SketchLine_6e")])
-aBox17 = model.addBox(aDocument, model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_2_1"))
-model.testNbResults(aBox17, 1)
-model.testNbSubShapes(aBox17, GeomAPI_Shape.SOLID, [1])
-model.testNbSubShapes(aBox17, GeomAPI_Shape.FACE, [6])
-print "box17 : ok"
-aSession.finishOperation()
diff --git a/src/PrimitivesAPI/Test/TestCylinder.py b/src/PrimitivesAPI/Test/TestCylinder.py
deleted file mode 100644 (file)
index 38e6d26..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-"""
-Test case for Primitive Cylinder feature. 
-Written on High API.
-"""
-from ModelAPI import *
-from GeomAPI import *
-
-from salome.shaper import model
-
-# Get session
-aSession = ModelAPI_Session.get()
-
-# Create a part
-aDocument = aSession.activeDocument()
-aSession.startOperation()
-model.addPart(aDocument)
-aDocument = aSession.activeDocument()
-aSession.finishOperation()
-
-aSession.startOperation()
-aBasePoint = model.addPoint(aDocument, 0, 0, 0).result()
-anAxis = model.addAxis(aDocument, 10, 0, 0).result()
-aSession.finishOperation()
-
-aSession.startOperation()
-aCylinder1 = model.addCylinder(aDocument, aBasePoint, anAxis, 5., 20.)
-assert (aCylinder1 is not None)
-aSession.finishOperation()
-
-aSession.startOperation()
-aCylinder2 = model.addCylinder(aDocument, aBasePoint, anAxis, 5., 20., 100.)
-assert (aCylinder2 is not None)
-aSession.finishOperation()
-
-aSession.startOperation()
-aCylinder3 = model.addCylinder(aDocument, 5., 20.)
-assert (aCylinder3 is not None)
-aSession.finishOperation()
-
-aSession.startOperation()
-aCylinder4 = model.addCylinder(aDocument, 5., 20., 100.)
-assert (aCylinder4 is not None)
-aSession.finishOperation()
-
index e4dcd74046c6753691454ecda61798bdf59cbc9a..88e0731d4cf2c86e3cc1e3c4257d9ad774c0b70d 100644 (file)
@@ -106,3 +106,36 @@ def testResultsVolumes(theFeature, theExpectedResultsVolumes, theNbSignificantDi
     anExpectedResultVolume = theExpectedResultsVolumes[anIndex]
     anExpectedResultVolumeStr = "{:0.27f}".format(anExpectedResultVolume).lstrip("0").lstrip(".").lstrip("0")
     assert (aResultVolumeStr[:theNbSignificantDigits] == anExpectedResultVolumeStr[:theNbSignificantDigits]), "Volume of result[{}]: {:0.27f}. Expected: {:0.27f}. The first {} significant digits not equal.".format(anIndex, aResultVolume, anExpectedResultVolume, theNbSignificantDigits)
+
+def testHaveNamingFaces(theFeature, theModel, thePartDoc) :
+  """ Tests if all faces of result have a name
+  :param theFeature: feature to test.
+  """
+  # Get feature result/sub-result
+  aResult = theFeature.results()[0].resultSubShapePair()[0]
+  # Get result/sub-result shape
+  shape = aResult.shape()
+  # Create shape explorer with desired shape type
+  shapeExplorer = GeomAPI_ShapeExplorer(shape, GeomAPI_Shape.FACE)
+  # Create list, and store selections in it
+  selectionList = []
+  while shapeExplorer.more():
+    selection = theModel.selection(aResult, shapeExplorer.current()) # First argument should be result/sub-result, second is sub-shape on this result/sub-result
+    selectionList.append(selection)
+    shapeExplorer.next()
+  # Create group with this selection list
+  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")
+  theModel.end()
+  assert(groupSelectionList.size() == len(selectionList))
+  for index in range(0, groupSelectionList.size()):
+    attrSelection = groupSelectionList.value(index)
+    shape = attrSelection.value()
+    name = attrSelection.namingName()
+    assert(shape.isFace())
+    assert(name != ""), "String empty"
diff --git a/test.API/SHAPER/GDML/TestAPI_ConeSegment.py b/test.API/SHAPER/GDML/TestAPI_ConeSegment.py
new file mode 100644 (file)
index 0000000..59a58dd
--- /dev/null
@@ -0,0 +1,85 @@
+# Copyright (C) 2014-2016 CEA/DEN, EDF R&D
+
+# File:        TestAPI_Box.py
+# Created:     29 Nov 2016
+# Author:      Clarisse Genrault (CEA)
+
+from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
+from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
+from GeomAPI import GeomAPI_Pnt as pnt
+
+# Create several "cone segment"
+try :    
+  CS1 = shaperpy.makeConeSegment(7.,11.,5.,8.,12.,0.,270.)
+except myExcept,ec:
+  print ec.what()
+  
+try :    
+  CS2 = shaperpy.makeConeSegment(5.,10.,7.,15.,15.,45.,180.)
+except myExcept,ec:
+  print ec.what()
+
+try :    
+  CS3 = shaperpy.makeConeSegment(5.,10.,7.,15.,15.,-45.,180.)
+except myExcept,ec:
+  print ec.what()
+  
+try :    
+  CS4 = shaperpy.makeConeSegment(0.,10.,2.,7.,3.,0.,270.)
+except myExcept,ec:
+  print ec.what()
+
+try :    
+  CS5 = shaperpy.makeConeSegment(5.,8.,0.,6.,10.,45.,270.)
+except myExcept,ec:
+  print ec.what()
+
+try :    
+  CS6 = shaperpy.makeConeSegment(0.,6.,0.,4.,17.,0.,270.)
+except myExcept,ec:
+  print ec.what()
+
+try :    
+  CS7 = shaperpy.makeConeSegment(7.,11.,5.,8.,12.,0.,360.)
+except myExcept,ec:
+  print ec.what()
+
+try :    
+  CS8 = shaperpy.makeConeSegment(-5.,11.,5.,8.,12.,0.,270.)
+except myExcept,ec:
+  print ec.what()
+
+try :    
+  CS9 = shaperpy.makeConeSegment(11.,7.,5.,8.,12.,0.,270.)
+except myExcept,ec:
+  print ec.what()
+
+try :    
+  CS10 = shaperpy.makeConeSegment(7.,11.,8.,5.,12.,0.,270.)
+except myExcept,ec:
+  print ec.what()
+
+try :    
+  CS11 = shaperpy.makeConeSegment(7.,11.,-3.,5.,12.,0.,270.)
+except myExcept,ec:
+  print ec.what()
+
+try :    
+  CS12 = shaperpy.makeConeSegment(7.,11.,5.,8.,0.,0.,270.)
+except myExcept,ec:
+  print ec.what()
+
+try :    
+  CS13 = shaperpy.makeConeSegment(7.,11.,5.,8.,-10.,0.,270.)
+except myExcept,ec:
+  print ec.what()
+
+try :    
+  CS14 = shaperpy.makeConeSegment(7.,11.,5.,8.,12.,-45.,-45.)
+except myExcept,ec:
+  print ec.what()
+
+try :    
+  CS15 = shaperpy.makeConeSegment(7.,11.,5.,8.,12.,45.,450.)
+except myExcept,ec:
+  print ec.what()
\ No newline at end of file
diff --git a/test.API/SHAPER/GDML/TestConeSegment.py b/test.API/SHAPER/GDML/TestConeSegment.py
new file mode 100644 (file)
index 0000000..d58b45a
--- /dev/null
@@ -0,0 +1,106 @@
+"""
+Test case for GDML Primitive Cone Segment feature. 
+Written on High API.
+"""
+from ModelAPI import *
+from GeomAPI import *
+
+from salome.shaper import model
+
+# Get session
+aSession = ModelAPI_Session.get()
+
+# Create a part
+aDocument = aSession.activeDocument()
+aSession.startOperation()
+model.addPart(aDocument)
+aDocument = aSession.activeDocument()
+aSession.finishOperation()
+
+# Create several "cone segment"
+aSession.startOperation()
+aCS1 = model.addConeSegment(aDocument,7.,11.,5.,8.,12.,0.,270.).result()
+aSession.finishOperation()
+assert (aCS1 is not None)
+
+aSession.startOperation()
+aCS2 = model.addConeSegment(aDocument,5.,10.,7.,15.,15.,45.,180.).result()
+aSession.finishOperation()
+assert (aCS2 is not None)
+
+aSession.startOperation()
+aCS3 = model.addConeSegment(aDocument,5.,10.,7.,15.,15.,-45.,180.).result()
+aSession.finishOperation()
+assert (aCS3 is not None)
+
+aSession.startOperation()
+aCS4 = model.addConeSegment(aDocument,0.,10.,2.,7.,3.,0.,270.).result()
+aSession.finishOperation()
+assert (aCS4 is not None)
+
+aSession.startOperation()
+aCS5 = model.addConeSegment(aDocument,5.,8.,0.,6.,10.,45.,270.).result()
+aSession.finishOperation()
+assert (aCS5 is not None)
+
+aSession.startOperation()
+aCS6 = model.addConeSegment(aDocument,0.,6.,0.,4.,17.,0.,270.).result()
+aSession.finishOperation()
+assert (aCS6 is not None)
+
+aSession.startOperation()
+aCS7 = model.addConeSegment(aDocument,7.,11.,5.,8.,12.,0.,360.).result()
+aSession.finishOperation()
+assert (aCS7 is not None)
+
+aSession.startOperation()
+aCS8 = model.addConeSegment(aDocument,-5.,11.,5.,8.,12.,0.,270.)
+aSession.finishOperation()
+assert (len(aCS8.results()) == 0)
+
+aSession.startOperation()
+aCS9 = model.addConeSegment(aDocument,11.,7.,5.,8.,12.,0.,270.)
+aSession.finishOperation()
+assert (len(aCS9.results()) == 0)
+
+aSession.startOperation()
+aCS10 = model.addConeSegment(aDocument,7.,11.,8.,5.,12.,0.,270.)
+aSession.finishOperation()
+assert (len(aCS10.results()) == 0)
+
+aSession.startOperation()
+aCS11 = model.addConeSegment(aDocument,7.,11.,-3.,5.,12.,0.,270.)
+aSession.finishOperation()
+assert (len(aCS11.results()) == 0)
+
+aSession.startOperation()
+aCS12 = model.addConeSegment(aDocument,7.,11.,5.,8.,0.,0.,270.)
+aSession.finishOperation()
+assert (len(aCS12.results()) == 0)
+
+aSession.startOperation()
+aCS13 = model.addConeSegment(aDocument,7.,11.,5.,8.,-10.,0.,270.)
+aSession.finishOperation()
+assert (len(aCS13.results()) == 0)
+
+aSession.startOperation()
+aCS14 = model.addConeSegment(aDocument,7.,11.,5.,8.,12.,-45.,-45.)
+aSession.finishOperation()
+assert (len(aCS14.results()) == 0)
+
+aSession.startOperation()
+aCS15 = model.addConeSegment(aDocument,7.,11.,5.,8.,12.,45.,450.)
+aSession.finishOperation()
+assert (len(aCS15.results()) == 0)
+
+aSession.startOperation()
+model.addParameter(aDocument,"rmin1","7.")
+model.addParameter(aDocument,"rmax1","11.")
+model.addParameter(aDocument,"rmin2","5.")
+model.addParameter(aDocument,"rmax2","8.")
+model.addParameter(aDocument,"z","12.")
+model.addParameter(aDocument,"startphi","0.")
+model.addParameter(aDocument,"deltaphi","270.")
+aCS16 = model.addConeSegment(aDocument,"rmin1","rmax1","rmin2","rmax2","z","startphi","deltaphi").result()
+aSession.finishOperation()
+assert (aCS16 is not None)
diff --git a/test.API/SHAPER/Primitives/TestAPI_Box.py b/test.API/SHAPER/Primitives/TestAPI_Box.py
new file mode 100644 (file)
index 0000000..0249e92
--- /dev/null
@@ -0,0 +1,93 @@
+# Copyright (C) 2014-2016 CEA/DEN, EDF R&D
+
+# File:        TestAPI_Box.py
+# Created:     16 Sept 2016
+# Author:      Clarisse Genrault (CEA)
+
+from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
+from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
+from GeomAPI import GeomAPI_Pnt as pnt
+
+# Create a box with dimensions   
+Box_1 = shaperpy.makeBox(10.,10.,10.)
+  
+try :    
+  Box_2 = shaperpy.makeBox(0.,10.,10.)
+  
+except myExcept,ec:
+  assert(ec.what() == "Box builder with dimensions :: Dx is null or negative.")
+
+try :    
+  Box_3 = shaperpy.makeBox(10.,0.,10.)
+  
+except myExcept,ec:
+  assert(ec.what() == "Box builder with dimensions :: Dy is null or negative.")
+  
+try :    
+  Box_4 = shaperpy.makeBox(10.,10.,0.)
+  
+except myExcept,ec:
+  assert(ec.what() == "Box builder with dimensions :: Dz is null or negative.")
+  
+try :    
+  Box_5 = shaperpy.makeBox(-10.,10.,10.)
+  
+except myExcept,ec:
+  assert(ec.what() == "Box builder with dimensions :: Dx is null or negative.")
+  
+try :    
+  Box_6 = shaperpy.makeBox(10.,-10.,10.)
+  
+except myExcept,ec:
+  assert(ec.what() == "Box builder with dimensions :: Dy is null or negative.")
+  
+try :    
+  Box_7 = shaperpy.makeBox(10.,10.,-10.)
+  
+except myExcept,ec:
+  assert(ec.what() == "Box builder with dimensions :: Dz is null or negative.")
+
+# Create a box with two points defining the diagonal
+pnt1 = pnt(0.,0.,0.)
+pnt2 = pnt(50.,50.,50.)
+Box_8 = shaperpy.makeBox(pnt1,pnt2)
+
+try :  
+  Box_9 = shaperpy.makeBox(pnt1,pnt1)
+  
+except myExcept,ec:
+  assert(ec.what() == "Box builder with points :: the distance between the two points is null.")
+  
+try :    
+  pnt3 = pnt(0.,50.,50.)
+  Box_10 = shaperpy.makeBox(pnt1,pnt3)
+  
+except myExcept,ec:
+  assert(ec.what() == "Box builder with points :: the points belong both to one of the OXY, OYZ or OZX planes.")
+  
+try :    
+  pnt4 = pnt(50.,0.,50.)
+  Box_11 = shaperpy.makeBox(pnt1,pnt4)
+  
+except myExcept,ec:
+  assert(ec.what() == "Box builder with points :: the points belong both to one of the OXY, OYZ or OZX planes.")
+  
+try :    
+  pnt5 = pnt(50.,50.,0.)
+  Box_12 = shaperpy.makeBox(pnt1,pnt5)
+  
+except myExcept,ec:
+  assert(ec.what() == "Box builder with points :: the points belong both to one of the OXY, OYZ or OZX planes.")
+  
+try :    
+  Box_13 = shaperpy.makeBox(pnt2,None)
+  
+except myExcept,ec:
+  assert(ec.what() == "Box builder with points :: the second point is not correct.")
+  
+try :    
+  Box_14 = shaperpy.makeBox(None,pnt2)
+  
+except myExcept,ec:
+  assert(ec.what() == "Box builder with points :: the first point is not correct.")
+  
diff --git a/test.API/SHAPER/Primitives/TestAPI_Cylinder.py b/test.API/SHAPER/Primitives/TestAPI_Cylinder.py
new file mode 100644 (file)
index 0000000..50a4b87
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright (C) 2014-201x CEA/DEN, EDF R&D
+
+# File:        TestAPI_Cylinder.py
+# Created:     13 Jan 2017
+# Author:      Clarisse Genrault (CEA)
+
+from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
+from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
+from GeomAlgoAPI import GeomAlgoAPI_EdgeBuilder as edgeBuilder
+from GeomAPI import GeomAPI_Pnt as pnt
+
+aPoint = pnt(10.,5.,0.)
+anEdge = edgeBuilder.line(1.,0.,0.)
+
+# Create a cylinder
+try :    
+  cylinder1 = shaperpy.makeCylinder(5., 20.)
+  
+except myExcept,ec:
+  print ec.what()
+
+# Create a cylinder
+try :    
+  cylinder2 = shaperpy.makeCylinder(5., 20., 100.)
+  
+except myExcept,ec:
+  print ec.what()
+  
+# Create a cylinder
+try :
+  cylinder3 = shaperpy.makeCylinder(aPoint, anEdge, 5., 20.)
+  
+except myExcept,ec:
+  print ec.what()
+  
+# Create a cylinder
+try :
+  cylinder4 = shaperpy.makeCylinder(aPoint, anEdge, 5., 20., 180.)
+  
+except myExcept,ec:
+  print ec.what()
\ No newline at end of file
diff --git a/test.API/SHAPER/Primitives/TestBox.py b/test.API/SHAPER/Primitives/TestBox.py
new file mode 100644 (file)
index 0000000..5fc71ca
--- /dev/null
@@ -0,0 +1,144 @@
+"""
+Test case for Primitive Box feature. 
+Written on High API.
+"""
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+
+# Init
+Point_1 = model.addPoint(Part_1_doc, 0, 0, 0).result()
+Point_2 = model.addPoint(Part_1_doc, 50, 50, 50).result()
+Point_3 = model.addPoint(Part_1_doc, 0, 50, 50).result()
+Point_4 = model.addPoint(Part_1_doc, 50, 0, 50).result()
+Point_5 = model.addPoint(Part_1_doc, 50, 50, 0).result()
+Vertex_3 = model.selection("VERTEX", "pnt")
+
+# Sketch
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
+SketchLine_1 = Sketch_1.addLine(20, 10, 40, 10)
+SketchLine_2 = Sketch_1.addLine(40, 10, 40, 20)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(40, 20, 20, 20)
+SketchLine_4 = Sketch_1.addLine(20, 20, 20, 10)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint())
+SketchLine_5 = Sketch_2.addLine(20, 10, 40, 10)
+SketchLine_6 = Sketch_2.addLine(40, 10, 40, 20)
+SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchLine_7 = Sketch_2.addLine(40, 20, 20, 20)
+SketchLine_8 = Sketch_2.addLine(20, 20, 20, 10)
+SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_5.startPoint(), SketchLine_8.endPoint())
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_4e")])
+Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_7s-SketchLine_6e")])
+
+# Extrusion
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "PartSet/OZ"), 100, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "PartSet/OX"), 100, 0)
+
+# Parameters
+model.addParameter(Part_1_doc, "dx", "10")
+model.addParameter(Part_1_doc, "dy", "10")
+model.addParameter(Part_1_doc, "dz", "10")
+
+# Tests
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Box_2 = model.addBox(Part_1_doc, 0, 10, 10)
+Box_3 = model.addBox(Part_1_doc, 10, 0, 10)
+Box_4 = model.addBox(Part_1_doc, 10, 10, 0)
+Box_5 = model.addBox(Part_1_doc, -10, 10, 10)
+Box_6 = model.addBox(Part_1_doc, 10, -10, 10)
+Box_7 = model.addBox(Part_1_doc, 10, 10, -10)
+Box_8 = model.addBox(Part_1_doc, Point_1, Point_2)
+Box_9 = model.addBox(Part_1_doc, Point_1, Point_1)
+Box_10 = model.addBox(Part_1_doc, Point_1, Point_3)
+Box_11 = model.addBox(Part_1_doc, Point_1, Point_4)
+Box_12 = model.addBox(Part_1_doc, Point_1, Point_5)
+Box_13 = model.addBox(Part_1_doc, Vertex_3, Point_2)
+Box_14 = model.addBox(Part_1_doc, Point_2, Vertex_3)
+Box_15 = model.addBox(Part_1_doc, model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_4e"), model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_7s-SketchLine_6e"))
+Box_16 = model.addBox(Part_1_doc, model.selection("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_1&Extrusion_2_1/To_Face_1"))
+Box_17 = model.addBox(Part_1_doc, model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_2_1"))
+Box_18 = model.addBox(Part_1_doc, "dx", "dy", "dz")
+model.do()
+model.end()
+
+# Checks
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Box_1, 1)
+model.testNbSubResults(Box_1, [0])
+model.testNbSubShapes(Box_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Box_1, GeomAPI_Shape.FACE, [6])
+model.testHaveNamingFaces(Box_1, model, Part_1_doc)
+
+model.testNbResults(Box_8, 1)
+model.testNbSubResults(Box_8, [0])
+model.testNbSubShapes(Box_8, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Box_8, GeomAPI_Shape.FACE, [6])
+model.testHaveNamingFaces(Box_8, model, Part_1_doc)
+
+model.testNbResults(Box_15, 1)
+model.testNbSubResults(Box_15, [0])
+model.testNbSubShapes(Box_15, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Box_15, GeomAPI_Shape.FACE, [6])
+model.testHaveNamingFaces(Box_15, model, Part_1_doc)
+
+model.testNbResults(Box_16, 1)
+model.testNbSubResults(Box_16, [0])
+model.testNbSubShapes(Box_16, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Box_16, GeomAPI_Shape.FACE, [6])
+model.testHaveNamingFaces(Box_16, model, Part_1_doc)
+
+model.testNbResults(Box_17, 1)
+model.testNbSubResults(Box_17, [0])
+model.testNbSubShapes(Box_17, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Box_17, GeomAPI_Shape.FACE, [6])
+model.testHaveNamingFaces(Box_17, model, Part_1_doc)
+
+model.testNbResults(Box_18, 1)
+model.testNbSubResults(Box_18, [0])
+model.testNbSubShapes(Box_18, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Box_18, GeomAPI_Shape.FACE, [6])
+model.testHaveNamingFaces(Box_18, model, Part_1_doc)
+
+model.testNbResults(Box_2, 0)
+assert(Box_2.feature().error() == "Box builder with dimensions :: Dx is null or negative.")
+
+model.testNbResults(Box_3, 0)
+assert(Box_3.feature().error() == "Box builder with dimensions :: Dy is null or negative.")
+
+model.testNbResults(Box_4, 0)
+assert(Box_4.feature().error() == "Box builder with dimensions :: Dz is null or negative.")
+
+model.testNbResults(Box_5, 0)
+assert(Box_5.feature().error() == "Box builder with dimensions :: Dx is null or negative.")
+
+model.testNbResults(Box_6, 0)
+assert(Box_6.feature().error() == "Box builder with dimensions :: Dy is null or negative.")
+
+model.testNbResults(Box_7, 0)
+assert(Box_7.feature().error() == "Box builder with dimensions :: Dz is null or negative.")
+
+model.testNbResults(Box_9, 0)
+assert(Box_9.feature().error() == "Box builder with points :: the distance between the two points is null.")
+
+model.testNbResults(Box_10, 0)
+assert(Box_10.feature().error() == "Box builder with points :: the points belong both to one of the OXY, OYZ or OZX planes.")
+
+model.testNbResults(Box_11, 0)
+assert(Box_11.feature().error() == "Box builder with points :: the points belong both to one of the OXY, OYZ or OZX planes.")
+
+model.testNbResults(Box_12, 0)
+assert(Box_12.feature().error() == "Box builder with points :: the points belong both to one of the OXY, OYZ or OZX planes.")
+
+model.testNbResults(Box_13, 0)
+assert(Box_13.feature().error() == "Attribute \"FirstPoint\" is not initialized.")
+
+model.testNbResults(Box_14, 0)
+assert(Box_14.feature().error() == "Attribute \"SecondPoint\" is not initialized.")
diff --git a/test.API/SHAPER/Primitives/TestCylinder.py b/test.API/SHAPER/Primitives/TestCylinder.py
new file mode 100644 (file)
index 0000000..38e6d26
--- /dev/null
@@ -0,0 +1,44 @@
+"""
+Test case for Primitive Cylinder feature. 
+Written on High API.
+"""
+from ModelAPI import *
+from GeomAPI import *
+
+from salome.shaper import model
+
+# Get session
+aSession = ModelAPI_Session.get()
+
+# Create a part
+aDocument = aSession.activeDocument()
+aSession.startOperation()
+model.addPart(aDocument)
+aDocument = aSession.activeDocument()
+aSession.finishOperation()
+
+aSession.startOperation()
+aBasePoint = model.addPoint(aDocument, 0, 0, 0).result()
+anAxis = model.addAxis(aDocument, 10, 0, 0).result()
+aSession.finishOperation()
+
+aSession.startOperation()
+aCylinder1 = model.addCylinder(aDocument, aBasePoint, anAxis, 5., 20.)
+assert (aCylinder1 is not None)
+aSession.finishOperation()
+
+aSession.startOperation()
+aCylinder2 = model.addCylinder(aDocument, aBasePoint, anAxis, 5., 20., 100.)
+assert (aCylinder2 is not None)
+aSession.finishOperation()
+
+aSession.startOperation()
+aCylinder3 = model.addCylinder(aDocument, 5., 20.)
+assert (aCylinder3 is not None)
+aSession.finishOperation()
+
+aSession.startOperation()
+aCylinder4 = model.addCylinder(aDocument, 5., 20., 100.)
+assert (aCylinder4 is not None)
+aSession.finishOperation()
+
diff --git a/test.API/SHAPER/Transformations/TestAPI_Scale.py b/test.API/SHAPER/Transformations/TestAPI_Scale.py
new file mode 100644 (file)
index 0000000..a601348
--- /dev/null
@@ -0,0 +1,32 @@
+# Copyright (C) 2014-201x CEA/DEN, EDF R&D
+
+# File:        TestAPI_Scale.py
+# Created:     25 Jan 2017
+# Author:      Clarisse Genrault (CEA)
+
+from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
+from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
+from GeomAPI import GeomAPI_Pnt as pnt
+
+# Create a box
+try :
+  box1 = shaperpy.makeBox(10.,10.,10.)
+  box2 = shaperpy.makeBox(10.,10.,10.)
+  centerPoint = pnt(20.,20.,0.)
+except myExcept, ec:
+  print ec.what()
+
+# Perfom a scale by a factor.
+try :
+  scale1 = shaperpy.makeScale(box1,centerPoint, -1.6)
+except myExcept, ec:
+  print ec.what()
+
+# Perfom a scale by dimensions.
+try :
+  scale2 = shaperpy.makeScale(box2,centerPoint, 2, -0.5, 1.3)
+except myExcept, ec:
+  print ec.what()
diff --git a/test.API/SHAPER/Transformations/TestAPI_Symmetry.py b/test.API/SHAPER/Transformations/TestAPI_Symmetry.py
new file mode 100644 (file)
index 0000000..409d398
--- /dev/null
@@ -0,0 +1,48 @@
+# Copyright (C) 2014-2016 CEA/DEN, EDF R&D
+
+# File:        TestAPI_Symmetry.py
+# Created:     15 Nov 2016
+# Author:      Clarisse Genrault (CEA)
+
+from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
+from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
+from GeomAPI import GeomAPI_Ax1 as axis
+from GeomAPI import GeomAPI_Ax2 as plane
+from GeomAPI import GeomAPI_Pnt as pnt
+from GeomAPI import GeomAPI_Dir as direction
+
+# Create a box
+try :
+  box1 = shaperpy.makeBox(10.,10.,10.)
+  box2 = shaperpy.makeBox(10.,10.,10.)
+  box3 = shaperpy.makeBox(10.,10.,10.)
+except myExcept, ec:
+  print ec.what()
+
+# Perfom a symmetry by a point.
+try :
+  origin = pnt(0.,0.,0.)
+  symmetry1 = shaperpy.makeSymmetry(box1,origin)
+except myExcept, ec:
+  print ec.what()
+
+# Perfom a symmetry by an axis.
+try :
+  xDir = direction(1.,0.,0.)
+  xAxis = axis(origin, xDir)
+  translation2 = shaperpy.makeSymmetry(box2,xAxis)
+except myExcept, ec:
+  print ec.what()
+
+# Perfom a symmetry by a plane.
+try :
+  pnt1 = pnt(0.,0.,10.)
+  pnt2 = pnt(10.,0.,10.)
+  aPlane = plane(origin, xDir)
+  translation3 = shaperpy.makeSymmetry(box3,aPlane)
+except myExcept, ec:
+  print ec.what()
diff --git a/test.API/SHAPER/Transformations/TestAPI_Translation.py b/test.API/SHAPER/Transformations/TestAPI_Translation.py
new file mode 100644 (file)
index 0000000..b393391
--- /dev/null
@@ -0,0 +1,44 @@
+# Copyright (C) 2014-2016 CEA/DEN, EDF R&D
+
+# File:        TestAPI_Translation.py
+# Created:     15 Nov 2016
+# Author:      Clarisse Genrault (CEA)
+
+from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
+from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
+from GeomAPI import GeomAPI_Ax1 as axis
+from GeomAPI import GeomAPI_Pnt as pnt
+from GeomAPI import GeomAPI_Dir as direction
+
+# Create a box
+try :
+  box = shaperpy.makeBox(10.,10.,10.)
+except myExcept, ec:
+  print ec.what()
+
+# Perfom a translation with an axis and a distance.
+try :
+  origin = pnt(0.,0.,0.)
+  xDir = direction(1.,0.,0.)
+  xAxis = axis(origin, xDir)
+  translation1 = shaperpy.makeTranslation(box,xAxis,15.)
+except myExcept, ec:
+  print ec.what()
+
+# Perfom a translation with dimensions.
+try :
+  translation2 = shaperpy.makeTranslation(box,10,0,0)
+except myExcept, ec:
+  print ec.what()
+
+# Perfom a translation with two points.
+try :
+  pnt1 = pnt(10.,0.,0.)
+  pnt2 = pnt(10.,15.,0.)
+  translation3 = shaperpy.makeTranslation(box,pnt1,pnt2)
+except myExcept, ec:
+  print ec.what()
diff --git a/test.API/SHAPER/Transformations/TestScale.py b/test.API/SHAPER/Transformations/TestScale.py
new file mode 100644 (file)
index 0000000..f0a33e0
--- /dev/null
@@ -0,0 +1,37 @@
+"""
+Test case for Scale feature. 
+Written on High API.
+"""
+from ModelAPI import *
+from GeomAPI import *
+
+from salome.shaper import model
+
+# Get session
+aSession = ModelAPI_Session.get()
+
+# Create a part
+aDocument = aSession.activeDocument()
+aSession.startOperation()
+model.addPart(aDocument)
+aDocument = aSession.activeDocument()
+aSession.finishOperation()
+
+# Create a box
+aSession.startOperation()
+aCenterPoint = model.addPoint(aDocument, 20, 20, 0).result()
+aBox1 =  model.addBox(aDocument, 10, 10, 10)
+aBox2 =  model.addBox(aDocument, 10, 10, 10)
+aSession.finishOperation()
+
+# Perform a symmetry by a point
+aSession.startOperation()
+aScale1 = model.addScale(aDocument, [model.selection("SOLID", "Box_1_1")], aCenterPoint, 2.0).result()
+aSession.finishOperation()
+assert (aScale1 is not None)
+
+# Perform a symmetry by an axis
+aSession.startOperation()
+aScale2 = model.addScale(aDocument, [model.selection("SOLID", "Box_2_1")], aCenterPoint, -0.5, 2, 3.7).result()
+aSession.finishOperation()
+assert (aScale2 is not None)
\ No newline at end of file
diff --git a/test.API/SHAPER/Transformations/TestSymmetry.py b/test.API/SHAPER/Transformations/TestSymmetry.py
new file mode 100644 (file)
index 0000000..97aca11
--- /dev/null
@@ -0,0 +1,47 @@
+"""
+Test case for Symmetry feature. 
+Written on High API.
+"""
+from ModelAPI import *
+from GeomAPI import *
+
+from salome.shaper import model
+
+# Get session
+aSession = ModelAPI_Session.get()
+
+# Create a part
+aDocument = aSession.activeDocument()
+aSession.startOperation()
+model.addPart(aDocument)
+aDocument = aSession.activeDocument()
+aSession.finishOperation()
+
+# Create a box
+aSession.startOperation()
+aBox1 =  model.addBox(aDocument, 10, 10, 10)
+aBox2 =  model.addBox(aDocument, 10, 10, 10)
+aBox3 =  model.addBox(aDocument, 10, 10, 10)
+aSession.finishOperation()
+
+# Perform a symmetry by a point
+aSession.startOperation()
+aPoint = model.addPoint(aDocument, 0, 0, 0).result()
+aSymmetry1 = model.addSymmetry(aDocument, [model.selection("SOLID", "Box_1_1")], aPoint).result()
+aSession.finishOperation()
+assert (aSymmetry1 is not None)
+
+# Perform a symmetry by an axis
+aSession.startOperation()
+anAxis = model.addAxis(aDocument, 10, 0, 0).result()
+aSymmetry2 = model.addSymmetry(aDocument, [model.selection("SOLID", "Box_2_1")], anAxis).result()
+aSession.finishOperation()
+assert (aSymmetry2 is not None)
+
+# Perform a symmetry by a plane
+aSession.startOperation()
+aPoint1 = model.addPoint(aDocument, 0, 0, 0).result()
+aPoint2 = model.addPoint(aDocument, 10, 10, 0).result()
+aSymmetry3 = model.addSymmetry(aDocument, [model.selection("SOLID", "Box_3_1")], model.selection("FACE", "Box_3_1/Top")).result()
+aSession.finishOperation()
+assert (aSymmetry3 is not None)
\ No newline at end of file
diff --git a/test.API/SHAPER/Transformations/TestTranslation.py b/test.API/SHAPER/Transformations/TestTranslation.py
new file mode 100644 (file)
index 0000000..85657d3
--- /dev/null
@@ -0,0 +1,43 @@
+"""
+Test case for Translation feature. 
+Written on High API.
+"""
+from ModelAPI import *
+from GeomAPI import *
+
+from salome.shaper import model
+
+# Get session
+aSession = ModelAPI_Session.get()
+
+# Create a part
+aDocument = aSession.activeDocument()
+aSession.startOperation()
+model.addPart(aDocument)
+aDocument = aSession.activeDocument()
+aSession.finishOperation()
+
+# Create a box
+
+aSession.startOperation()
+aBox =  model.addBox(aDocument, 10, 10, 10)
+
+# Perform a translation by an axis and a distance
+aSession.startOperation()
+aTranslation1 = model.addTranslation(aDocument, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "Box_1_1/Front&Box_1_1/Bottom"), 20).result()
+aSession.finishOperation()
+assert (aTranslation1 is not None)
+
+# Perform a translation by DX, DY, DZ vector
+aSession.startOperation()
+aTranslation2 = model.addTranslation(aDocument, [model.selection("SOLID", "Box_1_1")], 10, 10, 10).result()
+aSession.finishOperation()
+assert (aTranslation2 is not None)
+
+# Perform a translation by two points
+aSession.startOperation()
+aPoint1 = model.addPoint(aDocument, 0, 0, 0).result()
+aPoint2 = model.addPoint(aDocument, 10, 10, 0).result()
+aTranslation3 = model.addTranslation(aDocument, [model.selection("SOLID", "Box_1_1")], aPoint1, aPoint2).result()
+aSession.finishOperation()
+assert (aTranslation3 is not None)