X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchAPI%2FSketchAPI_Ellipse.h;h=598d41356f086267419e656675dca3e6e99c8688;hb=d5c7ad3c50f89a2ddc2de1866ffb7f09397f3be2;hp=ee79357c866912ef1fce34db7b0023167a452935;hpb=650554fd6236ddcfdac0a456d1031bf15d411a05;p=modules%2Fshaper.git diff --git a/src/SketchAPI/SketchAPI_Ellipse.h b/src/SketchAPI/SketchAPI_Ellipse.h index ee79357c8..598d41356 100644 --- a/src/SketchAPI/SketchAPI_Ellipse.h +++ b/src/SketchAPI/SketchAPI_Ellipse.h @@ -27,6 +27,8 @@ class ModelHighAPI_Selection; +typedef std::pair PairOfStrings; + /// \class SketchAPI_Ellipse /// \ingroup CPPHighAPI /// \brief Interface for Ellipse feature. @@ -113,7 +115,7 @@ public: /// Set center. SKETCHAPI_EXPORT - void setCenter(const std::shared_ptr & theCenter); + void setCenter(const std::shared_ptr& theCenter); /// Set focus. SKETCHAPI_EXPORT @@ -121,20 +123,12 @@ public: /// Set focus. SKETCHAPI_EXPORT - void setFocus(const std::shared_ptr & theCenter); + void setFocus(const std::shared_ptr& theFocus); /// Set radius. SKETCHAPI_EXPORT void setMinorRadius(double theRadius); - /// Return major axis of the ellipse - SKETCHAPI_EXPORT - ModelHighAPI_Selection majorAxis() const; - - /// Return minor axis of the ellipse - SKETCHAPI_EXPORT - ModelHighAPI_Selection minorAxis() const; - /// Create construction elements (focuses, axes etc.). /// Empty value for each parameter shows that the corresponding feature has been removed. /// Value "aux" marks this feature as auxiliary. @@ -154,6 +148,44 @@ public: /// Dump wrapped feature SKETCHAPI_EXPORT virtual void dump(ModelHighAPI_Dumper& theDumper) const; + +private: + /// Find all features connected with theEllipse by the internal coincidence. + /// \param[in] theEllipse ellipse or elliptic arc + /// \param[in] theMajorAxis names of attributes composing a major axis of ellipse + /// \param[in] theMinorAxis names of attributes composing a minor axis of ellipse + /// \param[out] theAttrToFeature map attribute of ellipse and coincident auxiliary feature + static void collectAuxiliaryFeatures(FeaturePtr theEllipse, + const PairOfStrings& theMajorAxis, + const PairOfStrings& theMinorAxis, + std::map& theAttrToFeature); + + /// \brief Dump the construction features (points, axes) for the ellipse. + /// \param[in] theDumper dumper instance + /// \param[in] theAttributes list of attributes the construction points are + /// connected with, and their dump names + /// \param[in] theAuxFeatures list of construction features + static void dumpConstructionEntities(ModelHighAPI_Dumper& theDumper, + const FeaturePtr& theEllipse, + const std::list& theAttributes, + const std::map& theAuxFeatures); + + /// \brief Create construction features for the ellipse connected + /// with corresponding attribute of ellipse. + static std::list > buildConstructionEntities( + const FeaturePtr& theEllipse, + const std::list& theAttributes, + const std::string& theCenter, + const std::string& theFirstFocus, + const std::string& theSecondFocus, + const std::string& theMajorAxisStart, + const std::string& theMajorAxisEnd, + const std::string& theMinorAxisStart, + const std::string& theMinorAxisEnd, + const std::string& theMajorAxis, + const std::string& theMinorAxis); + + friend class SketchAPI_EllipticArc; }; /// Pointer on Ellipse object.