X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_ConstraintRadius.cpp;h=2acbc1ce6989f13e112df4dc11611282ad471ddc;hb=ce72dd01645885d720b731795d676e2feeabc8d6;hp=a58609b2dcc64e814effe66c84f71c77367e46c6;hpb=77d6e03555d0d46232e09ace4178f66f8c9b40ee;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp index a58609b2d..2acbc1ce6 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-2020 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.