]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchAPI/SketchAPI_Rectangle.h
Salome HOME
rectangle feature: complete rectangle type by center and end points
[modules/shaper.git] / src / SketchAPI / SketchAPI_Rectangle.h
index a1e6fea6b18c8e51c4ca118e5f6ebe3e7a2aaeb5..b2fd70670ca23e477ccb321a8ea32596d0db384c 100644 (file)
@@ -42,30 +42,31 @@ public:
   /// Constructor with values
   SKETCHAPI_EXPORT
   SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
-                      double theX1, double theY1, double theX2, double theY2);
+                      double theX1, double theY1, double theX2, double theY2, bool isFirstPointCenter = false);
   /// Constructor with values
   SKETCHAPI_EXPORT
   SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
-                      const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
-                      const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
+                      const std::shared_ptr<GeomAPI_Pnt2d> & theFirstPoint,
+                      const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint, bool isFirstPointCenter = false);
   /// Destructor
   SKETCHAPI_EXPORT
   virtual ~SketchAPI_Rectangle();
 
-  INTERFACE_3(SketchPlugin_Rectangle::ID(),
+  INTERFACE_4(SketchPlugin_Rectangle::ID(),
               startPoint, SketchPlugin_Rectangle::START_ID(), GeomDataAPI_Point2D, /** Start point */,
-              endPoint,  SketchPlugin_Rectangle::END_ID(), GeomDataAPI_Point2D, /** End point */,
-              linesList,  SketchPlugin_Rectangle::LINES_LIST_ID(), ModelAPI_AttributeRefList, /** Lines list */
+              endPoint, SketchPlugin_Rectangle::END_ID(), GeomDataAPI_Point2D, /** End point */,
+              centerPoint, SketchPlugin_Rectangle::CENTER_ID(), GeomDataAPI_Point2D, /** Center point */,
+              linesList, SketchPlugin_Rectangle::LINES_LIST_ID(), ModelAPI_AttributeRefList, /** Lines list */
   )
 
   /// Set by coordinates
   SKETCHAPI_EXPORT
-  void setByCoordinates(double theX1, double theY1, double theX2, double theY2);
+  void setByCoordinates(double theX1, double theY1, double theX2, double theY2, bool isFirstPointCenter);
 
   /// Set by points
   SKETCHAPI_EXPORT
-  void setByPoints(const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
-                   const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
+  void setByPoints(const std::shared_ptr<GeomAPI_Pnt2d> & theFirstPoint,
+                   const std::shared_ptr<GeomAPI_Pnt2d> & theSecondPoint, bool isFirstPointCenter);
 
   /// List of lines composing rectangle
   SKETCHAPI_EXPORT std::list<std::shared_ptr<SketchAPI_SketchEntity> > lines() const;