]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchPlugin/SketchPlugin_MacroEllipse.h
Salome HOME
Task 2.12. New entities: ellipses and arcs of ellipses (issue #3003)
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_MacroEllipse.h
index 8d374df5c8dbc59c5f057052fac8b2a194ccfc8e..5b7d2945a6876518c46578c26e4a2fcb60de8c54 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-// File:        SketchPlugin_MacroEllipse.h
-// Created:     26 April 2017
-// Author:      Artem ZHIDKOV
-
 #ifndef SketchPlugin_MacroEllipse_H_
 #define SketchPlugin_MacroEllipse_H_
 
@@ -48,35 +44,58 @@ class SketchPlugin_MacroEllipse: public SketchPlugin_SketchEntity,
     return ID;
   }
 
-  /// 2D point - center of the ellipse.
-  inline static const std::string& CENTER_POINT_ID()
+  static const std::string& ELLIPSE_TYPE()
+  {
+    static const std::string ID("ellipse_type");
+    return ID;
+  }
+
+  static const std::string& ELLIPSE_TYPE_BY_CENTER_AXIS_POINT()
+  {
+    static const std::string ID("by_center_axis_point");
+    return ID;
+  }
+  static const std::string& ELLIPSE_TYPE_BY_AXIS_AND_POINT()
+  {
+    static const std::string ID("by_major_axis_and_point");
+    return ID;
+  }
+
+  static const std::string& EDIT_ELLIPSE_TYPE()
+  {
+    static const std::string ID("edit_ellipse_type");
+    return ID;
+  }
+
+  /// Attribute for the first point selected during ellipse creation.
+  inline static const std::string& FIRST_POINT_ID()
   {
-    static const std::string ID("center_point");
+    static const std::string ID("first_point");
     return ID;
   }
 
-  /// Reference for center point selection.
-  inline static const std::string& CENTER_POINT_REF_ID()
+  /// Reference to the first selected point.
+  inline static const std::string& FIRST_POINT_REF_ID()
   {
-    static const std::string ID("center_point_ref");
+    static const std::string ID("first_point_ref");
     return ID;
   }
 
-  /// 2D point - major axis point of the ellipse.
-  inline static const std::string& MAJOR_AXIS_POINT_ID()
+  /// Attribute for the second point selected during ellipse creation.
+  inline static const std::string& SECOND_POINT_ID()
   {
-    static const std::string ID("major_axis_point");
+    static const std::string ID("second_point");
     return ID;
   }
 
-  /// Reference for major axis point selection.
-  inline static const std::string& MAJOR_AXIS_POINT_REF_ID()
+  /// Reference to the second selected point.
+  inline static const std::string& SECOND_POINT_REF_ID()
   {
-    static const std::string ID("major_axis_point_ref");
+    static const std::string ID("second_point_ref");
     return ID;
   }
 
-  /// 2D point - passed point of the ellipse
+  /// Attribute for the third point selected during ellipse creation.
   inline static const std::string& PASSED_POINT_ID()
   {
     static const std::string ID("passed_point");
@@ -93,14 +112,14 @@ class SketchPlugin_MacroEllipse: public SketchPlugin_SketchEntity,
   /// Major radius of the ellipse
   inline static const std::string& MAJOR_RADIUS_ID()
   {
-    static const std::string ID("ellipse_major_radius");
+    static const std::string ID("major_radius");
     return ID;
   }
 
   /// Minor radius of the ellipse
   inline static const std::string& MINOR_RADIUS_ID()
   {
-    static const std::string ID("ellipse_minor_radius");
+    static const std::string ID("minor_radius");
     return ID;
   }
 
@@ -139,7 +158,8 @@ class SketchPlugin_MacroEllipse: public SketchPlugin_SketchEntity,
   SketchPlugin_MacroEllipse();
 
 private:
-  void constraintsForEllipse(FeaturePtr theEllipseFeature);
+  void constraintsForEllipseByCenterAxisAndPassed(FeaturePtr theEllipseFeature);
+  void constraintsForEllipseByMajoxAxisAndPassed(FeaturePtr theEllipseFeature);
 
   FeaturePtr createEllipseFeature();