from GeomDataAPI import *
from ModelAPI import *
import math
+from salome.shaper import model
#=========================================================================
# Auxiliary functions
aSession.startOperation()
aFeaturesList = createSketch(aSketchFeature)
aSession.finishOperation()
+assert(model.dof(aSketchFeature) == 5)
#=========================================================================
# Global variables
#=========================================================================
aRotationPointPoint = geomDataAPI_Point2D(aRotationPoint.attribute("PointCoordindates"))
aRotationPointPoint.setValue(CENTER_X, CENTER_Y)
aSession.finishOperation()
+assert(model.dof(aSketchFeature) == 7)
#=========================================================================
# Create the Rotation constraint
#=========================================================================
aNbCopies.setValue(2)
aMultiRotation.execute()
aSession.finishOperation()
+assert(model.dof(aSketchFeature) == 7)
#=========================================================================
# Verify the objects are moved for the specified distance
#=========================================================================
aSession.finishOperation()
aRotated = aMultiRotation.reflist("ConstraintEntityB")
checkRotation(aRotated, aNbCopies.value(), CENTER_X, CENTER_Y, ANGLE)
+assert(model.dof(aSketchFeature) == 7)
#=========================================================================
# Create new feature and add it into the Rotation
aRotList.append(aResult)
aSession.finishOperation()
checkRotation(aRotated, aNbCopies.value(), CENTER_X, CENTER_Y, ANGLE)
+assert(model.dof(aSketchFeature) == 11)
#=========================================================================
# Move line and check the copies are moved too
#=========================================================================
aStartPoint.setValue(12., 5.)
aSession.finishOperation()
checkRotation(aRotated, aNbCopies.value(), CENTER_X, CENTER_Y, ANGLE)
+assert(model.dof(aSketchFeature) == 11)
#=========================================================================
# Change number of copies and verify Rotation
#=========================================================================
aNbCopies.setValue(2)
aSession.finishOperation()
checkRotation(aRotated, aNbCopies.value(), CENTER_X, CENTER_Y, ANGLE)
+assert(model.dof(aSketchFeature) == 11)
#=========================================================================
# Remove a feature from the Rotation
aRotList.remove(aRemoveIt)
aSession.finishOperation()
checkRotation(aRotated, aNbCopies.value(), CENTER_X, CENTER_Y, ANGLE)
+assert(model.dof(aSketchFeature) == 11)
#=========================================================================
# Clear the list of rotated features
aRotList.append(aResult)
aSession.finishOperation()
checkRotation(aRotated, aNbCopies.value(), CENTER_X, CENTER_Y, ANGLE)
+assert(model.dof(aSketchFeature) == 11)
#=========================================================================
# End of test
#=========================================================================
-from salome.shaper import model
assert(model.checkPythonDump())