X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_ConstraintRadius.cpp;h=7916442e33e04df9c98698c3d6f104df6e7b1156;hb=cdbbde4803e9c320204d537d22af4ac7ef024962;hp=a58609b2dcc64e814effe66c84f71c77367e46c6;hpb=4bccf0ccd2f13dca7b9d16c59f427dea91c289fa;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp index a58609b2d..7916442e3 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2021 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 @@ -76,27 +76,6 @@ void SketchPlugin_ConstraintRadius::execute() ModelAPI_AttributeRefAttr>(data()->attribute(SketchPlugin_Constraint::ENTITY_A())); FeaturePtr aFeature = ModelAPI_Feature::feature(aRef->object()); if (aFeature) { - double aRadius = 0; - std::shared_ptr aData = aFeature->data(); - if (aFeature->getKind() == SketchPlugin_Circle::ID()) { - AttributeDoublePtr anAttribute = std::dynamic_pointer_cast( - aData->attribute(SketchPlugin_Circle::RADIUS_ID())); - if (anAttribute) - aRadius = anAttribute->value(); - } else if (aFeature->getKind() == SketchPlugin_Arc::ID()) { - std::shared_ptr aCenterAttr = std::dynamic_pointer_cast< - GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Arc::CENTER_ID())); - std::shared_ptr aStartAttr = std::dynamic_pointer_cast< - GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Arc::START_ID())); - if (aCenterAttr && aStartAttr) - aRadius = aCenterAttr->pnt()->distance(aStartAttr->pnt()); - } - //std::shared_ptr aValueAttr = std::dynamic_pointer_cast< - // ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE())); - //if(!aValueAttr->isInitialized()) { - // aValueAttr->setValue(aRadius); - //} - // the value should to be computed here, // not in the getAISObject in order to change the model value // inside the object transaction. This is important for creating a constraint by preselection.