Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[modules/shaper.git] / src / SketchPlugin / Test / TestMultiRotation.py
index 905117ae394ef5908c7a39abbed283f7f8f2221b..86f3a0f770cf61c17d9ba9c769cb9acfd2c5cb78 100644 (file)
@@ -1,7 +1,27 @@
+## Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+##
+
 """
     TestMultiRotation.py
     Unit test of SketchPlugin_MultiRotation class
-        
+
     SketchPlugin_MultiRotation
         static const std::string MY_CONSTRAINT_ROTATION_ID("SketchMultiRotation");
         data()->addAttribute(ANGLE_TYPE(), ModelAPI_AttributeString::typeId());
@@ -35,7 +55,7 @@ def createSketch(theSketch):
     allFeatures.append(aSketchArc)
     theSketch.execute()
     return allFeatures
-    
+
 def createLine(theSketch):
     aSketchLine = theSketch.addFeature("SketchLine")
     aStartPoint = geomDataAPI_Point2D(aSketchLine.attribute("StartPoint"))
@@ -44,7 +64,7 @@ def createLine(theSketch):
     aEndPoint.setValue(1., 3.)
     theSketch.execute()
     return aSketchLine
-    
+
 def checkRotation(theObjects, theNbObjects, theCenterX, theCenterY, theAngle):
     # Verify distances of the objects and the number of copies
     aFeatures = []
@@ -53,17 +73,17 @@ def checkRotation(theObjects, theNbObjects, theCenterX, theCenterY, theAngle):
         feat = ModelAPI_Feature.feature(theObjects.object(i))
         assert(feat is not None)
         aFeatures.append(feat)
-        
+
     cosA = math.cos(theAngle * math.pi / 180.)
-        
-    anInd = 0 
+
+    anInd = 0
     for feat, next in zip(aFeatures[:-1], aFeatures[1:]):
         anInd = anInd + 1
         if (anInd > theNbObjects-1):
             anInd = 0
             continue
         assert(feat.getKind() == next.getKind())
-        
+
         anAttributes = []
         if (feat.getKind() == "SketchLine"):
             anAttributes.append('StartPoint')
@@ -72,7 +92,7 @@ def checkRotation(theObjects, theNbObjects, theCenterX, theCenterY, theAngle):
             anAttributes.append('center_point')
             anAttributes.append('start_point')
             anAttributes.append('end_point')
-            
+
         for attr in anAttributes:
             aPoint1 = geomDataAPI_Point2D(feat.attribute(attr))
             aPoint2 = geomDataAPI_Point2D(next.attribute(attr))