Salome HOME
Fix for crash in Object Browser when object was deleted but message not sent
[modules/shaper.git] / src / SketchPlugin / Test / TestConstraintRadius.py
index afe60ba4f4971bb09d57c0ea3e9d08f63e28533e..9349352b32b4f4512ec674be73e694b5b1252517 100644 (file)
@@ -12,9 +12,9 @@
         
     SketchPlugin_ConstraintRadius
         static const std::string MY_CONSTRAINT_RADIUS_ID("SketchConstraintRadius");
-        data()->addAttribute(SketchPlugin_Constraint::VALUE(),    ModelAPI_AttributeDouble::type());
-        data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
-        data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type());
+        data()->addAttribute(SketchPlugin_Constraint::VALUE(),    ModelAPI_AttributeDouble::typeId());
+        data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
+        data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId());
 
 """
 from GeomDataAPI import *
@@ -33,13 +33,11 @@ aDocument = aSession.moduleDocument()
 #=========================================================================
 aSession.startOperation()
 aSketchCommonFeature = aDocument.addFeature("Sketch")
-aSketchFeature = modelAPI_CompositeFeature(aSketchCommonFeature)
+aSketchFeature = featureToCompositeFeature(aSketchCommonFeature)
 origin = geomDataAPI_Point(aSketchFeature.attribute("Origin"))
 origin.setValue(0, 0, 0)
 dirx = geomDataAPI_Dir(aSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
-diry = geomDataAPI_Dir(aSketchFeature.attribute("DirY"))
-diry.setValue(0, 1, 0)
 norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
 aSession.finishOperation()
@@ -107,12 +105,13 @@ assert (anArcPrevEndPointX == 50.)
 assert (anArcPrevEndPointY == 0.)
 # Move one point of the arc
 aSession.startOperation()
-anArcStartPoint.setValue(0., 60)
+anArcStartPoint.setValue(0, 60)
 aSession.finishOperation()
 assert (anArcCentr.x() == 10.)
 assert (anArcCentr.y() == 10.)
-assert (anArcEndPoint.x() != anArcPrevEndPointX)
-assert (anArcEndPoint.y() != anArcPrevEndPointY)
+# MPV: it just projects back to the circle the moved start point
+#assert (anArcEndPoint.x() != anArcPrevEndPointX)
+#assert (anArcEndPoint.y() != anArcPrevEndPointY)
 #=========================================================================
 # 4. Move the centr or the point of the arc
 # 5. Check radius is the same