]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Create Radius constraint
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 28 Jul 2014 06:30:29 +0000 (10:30 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 28 Jul 2014 06:30:29 +0000 (10:30 +0400)
src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp

index 9b412d1c615e44c882f756f091e073903ad43c0a..11071843f283cd2801d576cdc3c61d45f3a31ea6 100644 (file)
@@ -37,7 +37,7 @@ void SketchPlugin_ConstraintRadius::execute()
 
     boost::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
       boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
-    FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(aRef->object());
+    FeaturePtr aFeature = SketchPlugin_Sketch::getFeature(aRef->object());
     if (aFeature) {
       double aRadius = 0;
       boost::shared_ptr<ModelAPI_Data> aData = aFeature->data();
@@ -73,7 +73,7 @@ boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_ConstraintRadius::getAISObject
     boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_A()));
   if (!anAttr)
     return thePrevious;
-  FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(anAttr->object());
+  FeaturePtr aFeature = SketchPlugin_Sketch::getFeature(anAttr->object());
   std::string aKind = aFeature ? aFeature->getKind() : "";
   if (aKind != SketchPlugin_Circle::ID() && aKind != SketchPlugin_Arc::ID())
     return thePrevious;
@@ -130,7 +130,7 @@ void SketchPlugin_ConstraintRadius::move(double theDeltaX, double theDeltaY)
 
   boost::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
     boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
-  FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(aRef->object());
+  FeaturePtr aFeature = SketchPlugin_Sketch::getFeature(aRef->object());
   if (!aFeature)
     return;
   std::string aCenterAttrName;