Salome HOME
Issue #2130: arc is done not as desired
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Tools.h
index ef26d67c0560f73d29f8d3e9d025bd9bc1d1b53b..ac2a6cd36d86cf61cfbca084308dba705a968d34 100644 (file)
@@ -11,6 +11,8 @@
 
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Attribute.h>
+#include <ModelAPI_AttributeRefAttr.h>
+#include <GeomDataAPI_Point2D.h>
 
 class SketchPlugin_Feature;
 
@@ -23,6 +25,9 @@ void clearExpressions(FeaturePtr theFeature);
 /// \param[in] theStartCoin coincidence feature
 std::shared_ptr<GeomAPI_Pnt2d> getCoincidencePoint(const FeaturePtr theStartCoin);
 
+/// Find all Coincident constraints referred to the feature or its attribute
+std::set<FeaturePtr> findCoincidentConstraints(const FeaturePtr& theFeature);
+
 /// Finds lines coincident at point
 /// \param[in] theStartCoin coincidence feature
 /// \param[in] theAttr attribute name
@@ -31,6 +36,14 @@ void findCoincidences(const FeaturePtr theStartCoin,
                       const std::string& theAttr,
                       std::set<FeaturePtr>& theList);
 
+/// Find all features the point is coincident to.
+std::set<FeaturePtr> findFeaturesCoincidentToPoint(const AttributePoint2DPtr& thePoint);
+
+/// Find all points the given point is coincident to.
+std::set<AttributePoint2DPtr> findPointsCoincidentToPoint(const AttributePoint2DPtr& thePoint);
+
+void resetAttribute(SketchPlugin_Feature* theFeature, const std::string& theId);
+
 /// Creates coincidence or tangent constraint.
 /// \param[in] theFeature to get selected attribute or object
 /// \param[in] theId ID of attribute where selection is.
@@ -42,6 +55,16 @@ void createConstraint(SketchPlugin_Feature* theFeature,
                       const AttributePtr theAttr,
                       const ObjectPtr theObject,
                       const bool theIsCanBeTangent);
+
+/// Creates passing point or tangent curve basing on the given attributes are initialized.
+/// \param[in]  theRefAttr       prefered attribute to be converted
+/// \param[in]  theDefaultAttr   default attribute if theRefAttr is not initialized
+/// \param[out] theTangentCurve  tangent curve if theRefAttr refers to an edge
+/// \param[out] thePassingPoint  passing point if theRefAttr does not refer to an edge
+void convertRefAttrToPointOrTangentCurve(const AttributeRefAttrPtr&      theRefAttr,
+                                         const AttributePtr&             theDefaultAttr,
+                                         std::shared_ptr<GeomAPI_Shape>& theTangentCurve,
+                                         std::shared_ptr<GeomAPI_Pnt2d>& thePassingPoint);
 }; // namespace SketchPlugin_Tools
 
 #endif // SKETCHPLUGIN_TOOLS_H_
\ No newline at end of file