1 // File: PartSet_ConstraintLengthPrs.h
2 // Created: 16 Jun 2014
3 // Author: Natalia ERMOLAEVA
5 #ifndef PartSet_ConstraintLengthPrs_H
6 #define PartSet_ConstraintLengthPrs_H
10 #include "PartSet_FeaturePrs.h"
11 #include "PartSet_Constants.h"
13 class GeomDataAPI_Point2D;
14 class Handle_AIS_InteractiveObject;
17 \class PartSet_ConstraintLengthPrs
18 * \brief The class to define the circle feature manipulation. It is created for
19 * the feature create operation to move out the feature properties set and use one operation
20 * for any type of features.
22 class PARTSET_EXPORT PartSet_ConstraintLengthPrs : public PartSet_FeaturePrs
25 /// Returns the feature type processed by this presentation
26 /// \return the feature kind
27 static std::string getKind();
30 /// \param theSketch the sketch feature
31 PartSet_ConstraintLengthPrs(FeaturePtr theSketch);
33 virtual ~PartSet_ConstraintLengthPrs() {};
35 /// Sets the feature to to a feature attribute depending on the selection mode
36 /// \param theFeature a feature instance
37 /// \param theMode the selection mode
38 /// \return whether the feature is set
39 virtual bool setFeature(FeaturePtr theFeature, const PartSet_SelectionMode& theMode);
41 /// Sets the point to the feature in an attribute depending on the selection mode
42 /// \param theX the 2D point horizontal coordinate
43 /// \param theY the 2D point vertical coordinate
44 /// \param theMode the selection mode
45 /// \return the new selection mode
46 virtual PartSet_SelectionMode setPoint(double theX, double theY,
47 const PartSet_SelectionMode& theMode);
49 /// Creates an AIS presentation if the previous is null or update the given one
50 /// \param theFeature a feature
51 /// \param theSketch a feature sketch
52 /// \param thePrevious a previuos AIS presentation
53 /// \return a created/changed AIS object with the feature parameters
54 static Handle_AIS_InteractiveObject createPresentation(FeaturePtr theFeature,
56 Handle_AIS_InteractiveObject thePreviuos);
58 /// Returns the feature attribute name for the selection mode
59 /// \param theMode the current operation selection mode. The feature attribute depends on the mode
60 virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const;
62 /// Returns the next selection mode after the attribute
63 /// \param theAttribute the feature attribute name
64 /// \return next attribute selection mode
65 virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const;
67 /// \brief Move the full feature.
68 /// \param theDeltaX the delta for X coordinate is moved
69 /// \param theDeltaY the delta for Y coordinate is moved
70 virtual void move(double theDeltaX, double theDeltaY);
72 /// Return the distance between the feature and the point
73 /// \param theFeature feature object
74 /// \param theX the horizontal coordinate of the point
75 /// \param theX the vertical coordinate of the point
76 virtual double distanceToPoint(FeaturePtr theFeature, double theX, double theY);
78 /// Find a point in the line with given coordinates
79 /// \param theFeature the line feature
80 /// \param theX the horizontal point coordinate
81 /// \param theY the vertical point coordinate
82 virtual boost::shared_ptr<GeomDataAPI_Point2D> findPoint(FeaturePtr theFeature, double theX,
85 /// Returns the feature point in the selection mode position.
86 /// \param theMode the current operation selection mode. The feature attribute depends on the mode
87 virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode);