X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomDataAPI%2FGeomDataAPI_Point2D.cpp;h=64a6c343104713252f31b95ff4192c6c8afc0ff7;hb=81baa77e52cb1ade2bfbe5b21e893cc34b03c323;hp=dd8b39ec5d5c6bae09e425d7ad6dba8a783f7aef;hpb=8babac25037f2666dcb422dd68a66dd2ed1383d8;p=modules%2Fshaper.git diff --git a/src/GeomDataAPI/GeomDataAPI_Point2D.cpp b/src/GeomDataAPI/GeomDataAPI_Point2D.cpp index dd8b39ec5..64a6c3431 100644 --- a/src/GeomDataAPI/GeomDataAPI_Point2D.cpp +++ b/src/GeomDataAPI/GeomDataAPI_Point2D.cpp @@ -1,11 +1,24 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: GeomDataAPI_Point2D.cpp -// Created: 24 Apr 2014 -// Author: Mikhail PONIKAROV - +// 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include +#include void GeomDataAPI_Point2D::move(const double theDeltaX, const double theDeltaY) { @@ -17,6 +30,22 @@ std::string GeomDataAPI_Point2D::attributeType() return typeId(); } +std::shared_ptr GeomDataAPI_Point2D::getPoint2D( + const DataPtr& theData, const std::string& theAttribute) +{ + std::shared_ptr aPointAttr; + if (!theData) + return aPointAttr; + + std::shared_ptr anAttr = std::dynamic_pointer_cast< + ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute)); + if (anAttr && anAttr->attr()) { + aPointAttr = std::dynamic_pointer_cast(anAttr->attr()); + } + return aPointAttr; +} + + GeomDataAPI_Point2D::GeomDataAPI_Point2D() { }