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>
13 /** \class SketchSolver_ConstraintCoincidence
15 * \brief Convert coincidence constraint to SolveSpace structure
17 class SketchSolver_ConstraintCoincidence : public SketchSolver_Constraint
20 /// Constructor based on SketchPlugin constraint
21 SKETCHSOLVER_EXPORT SketchSolver_ConstraintCoincidence(ConstraintPtr theConstraint) :
22 SketchSolver_Constraint(theConstraint)
25 //// /// \brief Tries to remove constraint
26 //// /// \return \c false, if current constraint contains another SketchPlugin constraints (like for multiple coincidence)
27 //// virtual bool remove(ConstraintPtr theConstraint = ConstraintPtr());
29 //// /// \brief Checks the constraint is used by current object
30 //// virtual bool hasConstraint(ConstraintPtr theConstraint) const;
32 //// /// \brief Return list of SketchPlugin constraints attached to this object
33 //// virtual std::list<ConstraintPtr> constraints() const;
35 //// /// \brief Verifies the two Coincidence constraints are intersects (have shared point)
36 //// bool isCoincide(std::shared_ptr<SketchSolver_ConstraintCoincidence> theConstraint) const;
38 //// /// \brief Append all data of coincidence constraint to the current
39 //// void attach(std::shared_ptr<SketchSolver_ConstraintCoincidence> theConstraint);
42 //// /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
43 //// virtual void process();
45 /// \brief Generate list of attributes of constraint in order useful for constraints
46 /// \param[out] theValue numerical characteristic of constraint (e.g. distance)
47 /// \param[out] theAttributes list of attributes to be filled
48 virtual void getAttributes(double& theValue, std::vector<EntityWrapperPtr>& theAttributes);
50 //// /// \brief Generate list of attributes of constraint in order useful for SolveSpace constraints
51 //// /// \param[out] theValue numerical characteristic of constraint (e.g. distance)
52 //// /// \param[out] theAttributes list of attributes to be filled
53 //// virtual void getAttributes(double& theValue, std::vector<Slvs_hEntity>& theAttributes);
56 //// /// \brief Creates new coincidence constraint
57 //// Slvs_hConstraint addConstraint(Slvs_hEntity thePoint1, Slvs_hEntity thePoint2);
59 //// /// \brief Create full SolveSpace structure according to given constraint
60 //// void addConstraint(ConstraintPtr theConstraint);
62 //// /// \brief Create constraint of point coincident to the line or circle
63 //// Slvs_hConstraint addPointOnEntity(Slvs_hEntity thePoint, Slvs_hEntity theEntity);
66 //// int myType; ///< type of constraint (applicable SLVS_C_POINTS_COINCIDENT or SLVS_C_PT_ON_LINE or SLVS_C_PT_ON_CIRCLE)
67 //// std::map<ConstraintPtr, Slvs_hConstraint> myExtraCoincidence; ///< multiple coincidence of points
68 //// std::set<AttributePtr> myCoincidentPoints; ///< list of points under the Coincidence constraint