1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketchSolver_ConstraintCoincidence.h
4 // Created: 29 Mar 2015
5 // Author: Artem ZHIDKOV
7 #ifndef SketchSolver_ConstraintCoincidence_H_
8 #define SketchSolver_ConstraintCoincidence_H_
10 #include "SketchSolver.h"
11 #include <SketchSolver_Constraint.h>
12 #include <SketchSolver_Storage.h>
14 /** \class SketchSolver_ConstraintCoincidence
16 * \brief Convert coincidence constraint to SolveSpace structure
18 class SketchSolver_ConstraintCoincidence : public SketchSolver_Constraint
21 SketchSolver_ConstraintCoincidence(ConstraintPtr theConstraint) :
22 SketchSolver_Constraint(theConstraint)
25 virtual int getType() const
26 { return SLVS_C_POINTS_COINCIDENT; }
28 /// \brief Tries to remove constraint
29 /// \return \c false, if current constraint contains another SketchPlugin constraints (like for multiple coincidence)
30 virtual bool remove(ConstraintPtr theConstraint = ConstraintPtr());
32 /// \brief Checks the constraint is used by current object
33 virtual bool hasConstraint(ConstraintPtr theConstraint) const;
35 /// \brief Return list of SketchPlugin constraints attached to this object
36 virtual std::list<ConstraintPtr> constraints() const;
38 /// \brief Verifies the two Coincidence constraints are intersects (have shared point)
39 bool isCoincide(std::shared_ptr<SketchSolver_ConstraintCoincidence> theConstraint) const;
41 /// \brief Append all data of coincidence constaint to the current
42 void attach(std::shared_ptr<SketchSolver_ConstraintCoincidence> theConstraint);
45 /// \brief Creates new coincidence constraint
46 Slvs_hConstraint addConstraint(Slvs_hEntity thePoint1, Slvs_hEntity thePoint2);
48 /// \brief Create full SolveSpace structure according to given constraint
49 void addConstraint(ConstraintPtr theConstraint);
52 std::map<Slvs_hConstraint, ConstraintPtr> myExtraCoincidence; ///< multiple coincidence of points
53 std::set<AttributePtr> myCoincidentPoints; ///< list of points under the Coincidence constraint