1 // Name : SketchAPI_Rectangle.cpp
5 // 17/06/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "SketchAPI_Rectangle.h"
9 //--------------------------------------------------------------------------------------
10 #include <GeomAPI_Pnt2d.h>
11 //--------------------------------------------------------------------------------------
12 #include <ModelHighAPI_Selection.h>
13 #include <ModelHighAPI_Tools.h>
14 //--------------------------------------------------------------------------------------
15 SketchAPI_Rectangle::SketchAPI_Rectangle(
16 const std::shared_ptr<ModelAPI_Feature> & theFeature)
17 : SketchAPI_SketchEntity(theFeature)
22 SketchAPI_Rectangle::SketchAPI_Rectangle(
23 const std::shared_ptr<ModelAPI_Feature> & theFeature,
24 double theX1, double theY1, double theX2, double theY2)
25 : SketchAPI_SketchEntity(theFeature)
28 setByCoordinates(theX1, theY1, theX2, theY2);
32 SketchAPI_Rectangle::SketchAPI_Rectangle(
33 const std::shared_ptr<ModelAPI_Feature> & theFeature,
34 const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
35 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint)
36 : SketchAPI_SketchEntity(theFeature)
39 setByPoints(theStartPoint, theEndPoint);
43 SketchAPI_Rectangle::~SketchAPI_Rectangle()
47 //--------------------------------------------------------------------------------------
48 void SketchAPI_Rectangle::setByCoordinates(
49 double theX1, double theY1, double theX2, double theY2)
51 fillAttribute(startPoint(), theX1, theY1);
52 fillAttribute(endPoint(), theX2, theY2);
57 void SketchAPI_Rectangle::setByPoints(
58 const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
59 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint)
61 fillAttribute(theStartPoint, startPoint());
62 fillAttribute(theEndPoint, endPoint());
67 //--------------------------------------------------------------------------------------