X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Tools.h;h=ac2a6cd36d86cf61cfbca084308dba705a968d34;hb=b5893b0a30fac08134c24de4565cb513a43affa6;hp=9123cab7a29d450b0cd8550fd411839574f4ef24;hpb=75ef657b4bf17c7805df0b0bc3aab14611f4268c;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Tools.h b/src/SketchPlugin/SketchPlugin_Tools.h index 9123cab7a..ac2a6cd36 100644 --- a/src/SketchPlugin/SketchPlugin_Tools.h +++ b/src/SketchPlugin/SketchPlugin_Tools.h @@ -10,24 +10,61 @@ #include #include +#include +#include +#include + +class SketchPlugin_Feature; namespace SketchPlugin_Tools { -/// Clears text expressions for all attributes of the feature +/// Clears text expressions for all attributes of the feature void clearExpressions(FeaturePtr theFeature); /// \return coincidence point /// \param[in] theStartCoin coincidence feature -std::shared_ptr getCoincidencePoint(FeaturePtr theStartCoin); +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 /// \param[out] theList list of lines -void findCoincidences(FeaturePtr theStartCoin, - std::string theAttr, +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. +/// \param[in] theObject object for constraint +/// \param[in] theIsCanBeTangent if true constraint can be tangent or coincidence, depending on +/// the selection in the attribute with passed ID. +void createConstraint(SketchPlugin_Feature* theFeature, + const std::string& theId, + 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