X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchAPI%2FSketchAPI_Rectangle.cpp;h=bf7e3d44b4e7adc39023e4e6ea2347166488704c;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=135285e6a0b3cc78b71deb244eaaf721ee27156c;hpb=7074394f8f08413d885f63be01df6bd5007b868c;p=modules%2Fshaper.git diff --git a/src/SketchAPI/SketchAPI_Rectangle.cpp b/src/SketchAPI/SketchAPI_Rectangle.cpp index 135285e6a..bf7e3d44b 100644 --- a/src/SketchAPI/SketchAPI_Rectangle.cpp +++ b/src/SketchAPI/SketchAPI_Rectangle.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // 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 +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SketchAPI_Rectangle.h" @@ -24,32 +23,32 @@ //-------------------------------------------------------------------------------------- #include #include +#include + //-------------------------------------------------------------------------------------- SketchAPI_Rectangle::SketchAPI_Rectangle( const std::shared_ptr & theFeature) -: SketchAPI_SketchEntity(theFeature) + : SketchAPI_SketchEntity(theFeature) { initialize(); } -SketchAPI_Rectangle::SketchAPI_Rectangle( - const std::shared_ptr & theFeature, - double theX1, double theY1, double theX2, double theY2) -: SketchAPI_SketchEntity(theFeature) +SketchAPI_Rectangle::SketchAPI_Rectangle(const std::shared_ptr & theFeature, + double theX1, double theY1, double theX2, double theY2) + : SketchAPI_SketchEntity(theFeature) { if (initialize()) { setByCoordinates(theX1, theY1, theX2, theY2); } } -SketchAPI_Rectangle::SketchAPI_Rectangle( - const std::shared_ptr & theFeature, - const std::shared_ptr & theStartPoint, - const std::shared_ptr & theEndPoint) -: SketchAPI_SketchEntity(theFeature) +SketchAPI_Rectangle::SketchAPI_Rectangle(const std::shared_ptr & theFeature, + const std::shared_ptr & theFirstPoint, + const std::shared_ptr & theEndPoint) + : SketchAPI_SketchEntity(theFeature) { if (initialize()) { - setByPoints(theStartPoint, theEndPoint); + setByPoints(theFirstPoint, theEndPoint); } } @@ -61,19 +60,18 @@ SketchAPI_Rectangle::~SketchAPI_Rectangle() void SketchAPI_Rectangle::setByCoordinates( double theX1, double theY1, double theX2, double theY2) { + fillAttribute("RectangleTypeByCorners", type()); fillAttribute(startPoint(), theX1, theY1); fillAttribute(endPoint(), theX2, theY2); - execute(); } -void SketchAPI_Rectangle::setByPoints( - const std::shared_ptr & theStartPoint, - const std::shared_ptr & theEndPoint) +void SketchAPI_Rectangle::setByPoints(const std::shared_ptr & theFirstPoint, + const std::shared_ptr & theSecondPoint) { - fillAttribute(theStartPoint, startPoint()); - fillAttribute(theEndPoint, endPoint()); - + fillAttribute("RectangleTypeByCorners", type()); + fillAttribute(theFirstPoint, startPoint()); + fillAttribute(theSecondPoint, endPoint()); execute(); }