Salome HOME
bos#35152 [EDF] (2023-T1) Sketch Circle should allow user to position construction...
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_MacroCircle.h
index c810eb06191d1a56c5313777c9af01e086e2f2ff..d5b45c59f738152d187c5f5234b76360f65c010d 100644 (file)
@@ -87,6 +87,19 @@ class SketchPlugin_MacroCircle: public SketchPlugin_SketchEntity,
     return ID;
   }
 
+  /// 2D point - center of the circle.
+  inline static const std::string& ROTATE_POINT_ID()
+  {
+    static const std::string ID("rotate_point");
+    return ID;
+  }
+
+  /// Reference for center point selection.
+  inline static const std::string& ROTATE_POINT_REF_ID()
+  {
+    static const std::string ID("rotate_point_ref");
+    return ID;
+  }
   /// 2D point - passed point of the circle
   inline static const std::string& PASSED_POINT_ID()
   {
@@ -150,6 +163,21 @@ class SketchPlugin_MacroCircle: public SketchPlugin_SketchEntity,
     return ID;
   }
 
+  /// Rotate angle of the circle
+  inline static const std::string& CIRCLE_ROTATE_ANGLE_ID()
+  {
+    static const std::string ID("circle_angle");
+    return ID;
+  }
+
+  /// Attribute name of the version of Circle feature
+  /// Need for compability with old way of creating circle
+  inline static const std::string& VERSION_ID()
+  {
+    static const std::string MY_VERSION_ID("version");
+    return MY_VERSION_ID;
+  }
+
   /// Returns the kind of a feature
   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
   {
@@ -191,11 +219,15 @@ private:
   void constraintsForCircleByCenterAndPassed(FeaturePtr theCircleFeature);
   void constraintsForCircleByThreePoints(FeaturePtr theCircleFeature);
 
+  void computeNewAngle(std::shared_ptr<GeomAPI_Circ2d>& theCircle);
+
   FeaturePtr createCircleFeature();
 
 private:
   std::shared_ptr<GeomAPI_Pnt2d> myCenter;
+  std::shared_ptr<GeomAPI_Pnt2d> myRotPoint;
   double                         myRadius;
+  double                         myAngle;
 };
 
 #endif