]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/FeaturesPlugin/Test/TestSerialBoolean.py
Salome HOME
3.6 Separation of Boolean operations
[modules/shaper.git] / src / FeaturesPlugin / Test / TestSerialBoolean.py
index ce9fa673474e020385339392a5cce9c49b08e99a..08f4887d07488c6f1f049f4ceadef476e6623d10 100644 (file)
@@ -1,13 +1,33 @@
+## 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>
+##
+
 """
       TestExtrusion.py
       Unit test of FeaturesPlugin_Boolean class: many Boolean operations performance
-      
+
       class FeaturesPlugin_Extrusion : public ModelAPI_Feature
         static const std::string MY_EXTRUSION_ID("Extrusion");
         static const std::string MY_FACE_ID("base");
         static const std::string MY_SIZE_ID("size");
         static const std::string MY_REVERSE_ID("reverse");
-          
+
         data()->addAttribute(FeaturesPlugin_Extrusion::FACE_ID(), ModelAPI_AttributeSelection::typeId());
         data()->addAttribute(FeaturesPlugin_Extrusion::SIZE_ID(), ModelAPI_AttributeDouble::typeId());
         data()->addAttribute(FeaturesPlugin_Extrusion::REVERSE_ID(), ModelAPI_AttributeBoolean::typeId());
@@ -58,8 +78,8 @@ for i in xrange(0, N):
         norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm"))
         norm.setValue(0, 0, 1)
         aSketchCircle = aSketchFeature.addFeature("SketchCircle")
-        anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("CircleCenter"))
-        aCircleRadius = aSketchCircle.real("CircleRadius")
+        anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("circle_center"))
+        aCircleRadius = aSketchCircle.real("circle_radius")
         anCircleCentr.setValue(0.5 + step * (0.5 + i), 0.5 + step * (0.5 + j))
         aCircleRadius.setValue(radius)
         aSketchFeatures.append(aSketchFeature)
@@ -94,7 +114,7 @@ for i in xrange(0, N * N):
     anExtrusionFt.real("from_size").setValue(0)
     anExtrusionFt.real("to_size").setValue(10)
     anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
-    anExtrusionFt.real("from_offset").setValue(0) #TODO: remove        
+    anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
     # v1.0.2 from master
     # anExtrusionFt.selection("extrusion_face").setValue(
     #    aSketchResult, aSketchFaces[0])
@@ -177,11 +197,9 @@ aSession.startOperation()
 aFactory = ModelAPI_Session.get().validators()
 for i in xrange(0, N * N):
     anExtrusionResult = modelAPI_ResultBody(anExtrusions[i].firstResult())
-    aBooleanFt = aPart.addFeature("Boolean")
+    aBooleanFt = aPart.addFeature("Cut")
     aBooleanFt.selectionList("main_objects").append(aCurrentResult, aCurrentResult.shape())
     aBooleanFt.selectionList("tool_objects").append(anExtrusionResult, anExtrusionResult.shape())
-    kBooleanTypeCut = 0
-    aBooleanFt.integer("bool_type").setValue(kBooleanTypeCut)
     aBooleanFt.execute()
     assert (aFactory.validate(aBooleanFt))
     assert (len(aBooleanFt.results()) > 0)
@@ -192,3 +210,6 @@ aSession.finishOperation()
 #=========================================================================
 # End of test
 #=========================================================================
+
+from salome.shaper import model
+assert(model.checkPythonDump())