X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_MacroEllipse.h;h=f1a87525757a5f4c5f973c6a88f85fc801ef56c7;hb=4cb749258f33b7de231da5bb50140407c0599d30;hp=d31d0d55f3fb3b83d5af430bb57e2aa6a2d7e97f;hpb=a94fc319f2aa64b43c9a73b5ff7063923648faec;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_MacroEllipse.h b/src/SketchPlugin/SketchPlugin_MacroEllipse.h index d31d0d55f..f1a875257 100644 --- a/src/SketchPlugin/SketchPlugin_MacroEllipse.h +++ b/src/SketchPlugin/SketchPlugin_MacroEllipse.h @@ -1,4 +1,4 @@ -// Copyright (C) 2017 CEA/DEN, EDF R&D +// Copyright (C) 2017-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,16 +12,11 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// 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_ @@ -30,7 +25,6 @@ #include #include -////class GeomAPI_Circ2d; class GeomAPI_Pnt2d; /**\class SketchPlugin_MacroEllipse @@ -49,35 +43,58 @@ class SketchPlugin_MacroEllipse: public SketchPlugin_SketchEntity, return ID; } - /// 2D point - center of the ellipse. + 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& CENTER_POINT_ID() { - static const std::string ID("center_point"); + static const std::string ID("first_point"); return ID; } - /// Reference for center point selection. + /// Reference to the first selected point. inline static const std::string& CENTER_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. + /// Attribute for the second point selected during ellipse creation. inline static const std::string& MAJOR_AXIS_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. + /// Reference to the second selected point. inline static const std::string& MAJOR_AXIS_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"); @@ -91,17 +108,59 @@ class SketchPlugin_MacroEllipse: public SketchPlugin_SketchEntity, return ID; } + /// Attribute for the first point selected during ellipse creation. + inline static const std::string& MAJOR_AXIS_START_ID() + { + static const std::string ID("first_point_1"); + return ID; + } + + /// Reference to the first selected point. + inline static const std::string& MAJOR_AXIS_START_REF_ID() + { + static const std::string ID("first_point_ref_1"); + return ID; + } + + /// Attribute for the second point selected during ellipse creation. + inline static const std::string& MAJOR_AXIS_END_ID() + { + static const std::string ID("second_point_1"); + return ID; + } + + /// Reference to the second selected point. + inline static const std::string& MAJOR_AXIS_END_REF_ID() + { + static const std::string ID("second_point_ref_1"); + return ID; + } + + /// Attribute for the third point selected during ellipse creation. + inline static const std::string& PASSED_POINT_1_ID() + { + static const std::string ID("passed_point_1"); + return ID; + } + + /// Reference for passed point selection. + inline static const std::string& PASSED_POINT_1_REF_ID() + { + static const std::string ID("passed_point_ref_1"); + return ID; + } + /// 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; } @@ -124,12 +183,6 @@ class SketchPlugin_MacroEllipse: public SketchPlugin_SketchEntity, /// Creates a new part document if needed SKETCHPLUGIN_EXPORT virtual void execute(); - /// Moves the feature - /// \param theDeltaX the delta for X coordinate is moved - /// \param theDeltaY the delta for Y coordinate is moved - SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY) - {} - /// Reimplemented from ModelAPI_Feature::isMacro(). /// \returns true SKETCHPLUGIN_EXPORT virtual bool isMacro() const @@ -146,7 +199,8 @@ class SketchPlugin_MacroEllipse: public SketchPlugin_SketchEntity, SketchPlugin_MacroEllipse(); private: - void constraintsForEllipse(FeaturePtr theEllipseFeature); + void constraintsForEllipseByCenterAxisAndPassed(FeaturePtr theEllipseFeature); + void constraintsForEllipseByMajoxAxisAndPassed(FeaturePtr theEllipseFeature); FeaturePtr createEllipseFeature();