1 // File: PartSet_FeatureDistancePrs.h
2 // Created: 16 Jun 2014
3 // Author: Natalia ERMOLAEVA
5 #ifndef PartSet_FeatureDistancePrs_H
6 #define PartSet_FeatureDistancePrs_H
10 #include "PartSet_FeaturePrs.h"
11 #include "PartSet_Constants.h"
13 class GeomDataAPI_Point2D;
16 \class PartSet_FeatureDistancePrs
17 * \brief The class to define the circle feature manipulation. It is created for
18 * the feature create operation to move out the feature properties set and use one operation
19 * for any type of features.
21 class PARTSET_EXPORT PartSet_FeatureDistancePrs : public PartSet_FeaturePrs
24 /// Returns the feature type processed by this presentation
25 /// \return the feature kind
26 static std::string getKind();
29 /// \param theSketch the sketch feature
30 PartSet_FeatureDistancePrs(FeaturePtr theSketch);
32 virtual ~PartSet_FeatureDistancePrs() {};
34 /// Sets the feature to to a feature attribute depending on the selection mode
35 /// \param theFeature a feature instance
36 /// \param theMode the selection mode
37 /// \return whether the feature is set
38 virtual bool setFeature(FeaturePtr theFeature, const PartSet_SelectionMode& theMode);
40 /// Sets the point to the feature in an attribute depending on the selection mode
41 /// \param theX the 2D point horizontal coordinate
42 /// \param theY the 2D point vertical coordinate
43 /// \param theMode the selection mode
44 /// \return the new selection mode
45 virtual PartSet_SelectionMode setPoint(double theX, double theY,
46 const PartSet_SelectionMode& theMode);
48 /// Returns the feature attribute name for the selection mode
49 /// \param theMode the current operation selection mode. The feature attribute depends on the mode
50 virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const;
52 /// Returns the next selection mode after the attribute
53 /// \param theAttribute the feature attribute name
54 /// \return next attribute selection mode
55 virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const;
57 /// \brief Move the full feature.
58 /// \param theDeltaX the delta for X coordinate is moved
59 /// \param theDeltaY the delta for Y coordinate is moved
60 virtual void move(double theDeltaX, double theDeltaY);
62 /// Return the distance between the feature and the point
63 /// \param theFeature feature object
64 /// \param theX the horizontal coordinate of the point
65 /// \param theX the vertical coordinate of the point
66 virtual double distanceToPoint(FeaturePtr theFeature, double theX, double theY);
68 /// Find a point in the line with given coordinates
69 /// \param theFeature the line feature
70 /// \param theX the horizontal point coordinate
71 /// \param theY the vertical point coordinate
72 virtual boost::shared_ptr<GeomDataAPI_Point2D> findPoint(FeaturePtr theFeature, double theX,
75 /// Returns the feature point in the selection mode position.
76 /// \param theMode the current operation selection mode. The feature attribute depends on the mode
77 virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode);