]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchPlugin/SketchPlugin_Tools.h
Salome HOME
SketchPlugin refactoring
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Tools.h
index 07ea391dfa86ffa0516efd302f4e57d8e9d46ec6..6653b44ff349611d4e3ad338e5f519c8a91ca490 100644 (file)
@@ -29,6 +29,7 @@
 #include <GeomDataAPI_Point2D.h>
 
 class SketchPlugin_Feature;
+class SketchPlugin_Sketch;
 
 namespace SketchPlugin_Tools {
 
@@ -60,17 +61,47 @@ std::set<AttributePoint2DPtr> findPointsCoincidentToPoint(const AttributePoint2D
 
 void resetAttribute(SketchPlugin_Feature* theFeature, const std::string& theId);
 
+/// Create new constraint between given attributes
+/// \param[in] theSketch          a sketch where the constraint will be created
+/// \param[in] theConstraintId    a constraint identifier
+/// \param[in] theFirstAttribute  an attribute of further constraint
+/// \param[in] theSecondAttribute an attribute of further constraint
+FeaturePtr createConstraint(SketchPlugin_Sketch* theSketch,
+                            const std::string& theConstraintId,
+                            const AttributePtr& theFirstAttribute,
+                            const AttributePtr& theSecondAttribute);
+
+/// Create new constraint between given attribute and object
+/// \param[in] theSketch         a sketch where the constraint will be created
+/// \param[in] theConstraintId   a constraint identifier
+/// \param[in] theFirstAttribute an attribute of further constraint
+/// \param[in] theSecondObject   an attribute of further constraint
+FeaturePtr createConstraint(SketchPlugin_Sketch* theSketch,
+                            const std::string& theConstraintId,
+                            const AttributePtr& theFirstAttribute,
+                            const ObjectPtr& theSecondObject);
+
+/// Create new constraint between given objects
+/// \param[in] theSketch       a sketch where the constraint will be created
+/// \param[in] theConstraintId a constraint identifier
+/// \param[in] theFirstObject  an attribute of further constraint
+/// \param[in] theSecondObject an attribute of further constraint
+FeaturePtr createConstraint(SketchPlugin_Sketch* theSketch,
+                            const std::string& theConstraintId,
+                            const ObjectPtr& theFirstObject,
+                            const ObjectPtr& theSecondObject);
+
 /// 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);
+void createCoincidenceOrTangency(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