X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FFeaturesPlugin%2FTest%2FTestMultiBoolean.py;h=b6a6e742cba94fc89c79b54b69d1c992c258d0d4;hb=cb3b1befb8fa7b3067d9263f94391108429d691a;hp=8ff8dabb1273db26bf3c726c8ad0440c43a14077;hpb=f60865d3a392bb23530a2f59532c4701d318e0d6;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/Test/TestMultiBoolean.py b/src/FeaturesPlugin/Test/TestMultiBoolean.py index 8ff8dabb1..b6a6e742c 100644 --- a/src/FeaturesPlugin/Test/TestMultiBoolean.py +++ b/src/FeaturesPlugin/Test/TestMultiBoolean.py @@ -90,8 +90,11 @@ for i in xrange(0, N * N): anExtrusionFt.selectionList("base").append( aSketchResult, aSketchFaces[0]) - anExtrusionFt.real("size").setValue(10) - anExtrusionFt.boolean("reverse").setValue(False) + anExtrusionFt.string("CreationMethod").setValue("BySizes") + 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 # v1.0.2 from master # anExtrusionFt.selection("extrusion_face").setValue( # aSketchResult, aSketchFaces[0]) @@ -151,8 +154,11 @@ GeomAlgoAPI_SketchBuilder.createFaces( aBox = aPart.addFeature("Extrusion") aBox.selectionList("base").append( aSketchResult, aSketchFaces[0]) -aBox.real("size").setValue(10) -aBox.boolean("reverse").setValue(False) +aBox.string("CreationMethod").setValue("BySizes") +aBox.real("from_size").setValue(0) +aBox.real("to_size").setValue(10) +aBox.real("to_offset").setValue(0) #TODO: remove +aBox.real("from_offset").setValue(0) #TODO: remove # v 1.0.2 from master # aBox.selection("extrusion_face").setValue( # aSketchResult, aSketchFaces[0]) @@ -164,20 +170,28 @@ aSession.finishOperation() #========================================================================= # Create a boolean cut of cylinders from the box: -# result of Boolean is the first argument of the next Boolean #========================================================================= -aCurrentResult = aBox.firstResult() +aCurrentResult = modelAPI_ResultBody(aBox.firstResult()) aSession.startOperation() + +aBooleanFt = aPart.addFeature("Boolean") +aBooleanFt.selectionList("main_objects").append(aCurrentResult, aCurrentResult.shape()) for i in xrange(0, N * N): - aBooleanFt = aPart.addFeature("Boolean") - aBooleanFt.reference("main_object").setValue(modelAPI_ResultBody(aCurrentResult)) - aBooleanFt.reference("tool_object").setValue(modelAPI_ResultBody(anExtrusions[i].firstResult())) - kBooleanTypeCut = 0 - aBooleanFt.integer("bool_type").setValue(kBooleanTypeCut) - aBooleanFt.execute() - aCurrentResult = aBooleanFt.firstResult() + anExtrusionResult = modelAPI_ResultBody(anExtrusions[i].firstResult()) + aBooleanFt.selectionList("tool_objects").append(anExtrusionResult, anExtrusionResult.shape()) +kBooleanTypeCut = 0 +aBooleanFt.integer("bool_type").setValue(kBooleanTypeCut) +aBooleanFt.execute() +aFactory = ModelAPI_Session.get().validators() +assert (aFactory.validate(aBooleanFt)) +assert (len(aBooleanFt.results()) > 0) +aCurrentResult = modelAPI_ResultBody(aBooleanFt.firstResult()) +assert (aCurrentResult is not None) aSession.finishOperation() #========================================================================= # End of test #========================================================================= + +import model +assert(model.checkPythonDump())