X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Line.cpp;h=9e0cffb4711621aad0532c0305137ef9b6dba81b;hb=50a8df0c6a66da8067b16155e5ae39f8f26a7ebc;hp=e5284719311c0f2beed9b62948160717992e536f;hpb=661aafa65364b86fdbfc9fde9462d31bdf3ae151;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Line.cpp b/src/SketchPlugin/SketchPlugin_Line.cpp index e52847193..9e0cffb47 100644 --- a/src/SketchPlugin/SketchPlugin_Line.cpp +++ b/src/SketchPlugin/SketchPlugin_Line.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 @@ -47,9 +47,6 @@ void SketchPlugin_Line::initAttributes() /// new attributes should be added to end of the feature in order to provide /// correct attribute values in previous saved studies data()->addAttribute(LENGTH_ID(), ModelAPI_AttributeDouble::typeId()); - - data()->addAttribute(PARENT_ID(), ModelAPI_AttributeReference::typeId()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), PARENT_ID()); } void SketchPlugin_Line::initDerivedClassAttributes() @@ -107,28 +104,6 @@ std::string SketchPlugin_Line::processEvent(const std::shared_ptr& thePoint) -{ - double aDelta = 0; - - std::shared_ptr aData = data(); - std::shared_ptr aPoint1 = - std::dynamic_pointer_cast(aData->attribute(START_ID())); - std::shared_ptr aPoint2 = - std::dynamic_pointer_cast(aData->attribute(END_ID())); - - GeomAPI_Lin2d aLin2d(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y()); - - if (false/*projection*/) { // TODO: if it has not been necessary, remove this block - std::shared_ptr aResult = aLin2d.project(thePoint); - aDelta = aResult->distance(thePoint); - } else { // distance - aDelta = aLin2d.distance(thePoint); - } - - return aDelta; -} - const std::string& SketchPlugin_Line::getKind() { static std::string MY_KIND = SketchPlugin_Line::ID();