X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Tools.h;h=ac2a6cd36d86cf61cfbca084308dba705a968d34;hb=b5893b0a30fac08134c24de4565cb513a43affa6;hp=ef26d67c0560f73d29f8d3e9d025bd9bc1d1b53b;hpb=bd953380ed26bbef84337e8b2148d930969b5abe;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Tools.h b/src/SketchPlugin/SketchPlugin_Tools.h index ef26d67c0..ac2a6cd36 100644 --- a/src/SketchPlugin/SketchPlugin_Tools.h +++ b/src/SketchPlugin/SketchPlugin_Tools.h @@ -11,6 +11,8 @@ #include #include +#include +#include class SketchPlugin_Feature; @@ -23,6 +25,9 @@ void clearExpressions(FeaturePtr theFeature); /// \param[in] theStartCoin coincidence feature std::shared_ptr getCoincidencePoint(const FeaturePtr theStartCoin); +/// Find all Coincident constraints referred to the feature or its attribute +std::set 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& theList); +/// Find all features the point is coincident to. +std::set findFeaturesCoincidentToPoint(const AttributePoint2DPtr& thePoint); + +/// Find all points the given point is coincident to. +std::set 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& theTangentCurve, + std::shared_ptr& thePassingPoint); }; // namespace SketchPlugin_Tools #endif // SKETCHPLUGIN_TOOLS_H_ \ No newline at end of file