1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2 // Name : SketchAPI_Rectangle.cpp
6 // 17/06/16 - Sergey POKHODENKO - Creation of the file
8 //--------------------------------------------------------------------------------------
9 #include "SketchAPI_Rectangle.h"
10 //--------------------------------------------------------------------------------------
11 #include <GeomAPI_Pnt2d.h>
12 //--------------------------------------------------------------------------------------
13 #include <ModelHighAPI_Selection.h>
14 #include <ModelHighAPI_Tools.h>
15 //--------------------------------------------------------------------------------------
16 SketchAPI_Rectangle::SketchAPI_Rectangle(
17 const std::shared_ptr<ModelAPI_Feature> & theFeature)
18 : SketchAPI_SketchEntity(theFeature)
23 SketchAPI_Rectangle::SketchAPI_Rectangle(
24 const std::shared_ptr<ModelAPI_Feature> & theFeature,
25 double theX1, double theY1, double theX2, double theY2)
26 : SketchAPI_SketchEntity(theFeature)
29 setByCoordinates(theX1, theY1, theX2, theY2);
33 SketchAPI_Rectangle::SketchAPI_Rectangle(
34 const std::shared_ptr<ModelAPI_Feature> & theFeature,
35 const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
36 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint)
37 : SketchAPI_SketchEntity(theFeature)
40 setByPoints(theStartPoint, theEndPoint);
44 SketchAPI_Rectangle::~SketchAPI_Rectangle()
48 //--------------------------------------------------------------------------------------
49 void SketchAPI_Rectangle::setByCoordinates(
50 double theX1, double theY1, double theX2, double theY2)
52 fillAttribute(startPoint(), theX1, theY1);
53 fillAttribute(endPoint(), theX2, theY2);
58 void SketchAPI_Rectangle::setByPoints(
59 const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
60 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint)
62 fillAttribute(theStartPoint, startPoint());
63 fillAttribute(theEndPoint, endPoint());
68 //--------------------------------------------------------------------------------------