Salome HOME
Issue #2101: A point cannot be coincident to both, X and Y axises
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintMirror.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    SketchSolver_ConstraintMirror.h
4 // Created: 1 Apr 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchSolver_ConstraintMirror_H_
8 #define SketchSolver_ConstraintMirror_H_
9
10 #include <SketchSolver_Constraint.h>
11
12 /** \class   SketchSolver_ConstraintMirror
13  *  \ingroup Plugins
14  *  \brief   Convert fillet constraint to SolveSpace structure
15  */
16 class SketchSolver_ConstraintMirror : public SketchSolver_Constraint
17 {
18 public:
19   /// Constructor based on SketchPlugin constraint
20   SketchSolver_ConstraintMirror(ConstraintPtr theConstraint) :
21       SketchSolver_Constraint(theConstraint),
22       myNumberOfObjects(0)
23   {}
24
25   /// \brief Update constraint
26   virtual void update();
27
28   /// \brief Notify this object about the feature is changed somewhere
29   virtual void notify(const FeaturePtr& theFeature, PlaneGCSSolver_Update*);
30
31   /// \brief Block or unblock events from this constraint
32   virtual void blockEvents(bool isBlocked);
33
34 protected:
35   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
36   virtual void process();
37
38   /// \brief Generate list of entities of mirror constraint
39   virtual void getAttributes(EntityWrapperPtr&, std::vector<EntityWrapperPtr>&);
40
41   /// \brief This method is used in derived objects to check consistence of constraint.
42   ///        E.g. the distance between line and point may be signed.
43   virtual void adjustConstraint();
44
45 private:
46   size_t myNumberOfObjects;  ///< number of previously mirrored objects
47   std::set<FeaturePtr> myFeatures; ///< mirror line, original and mirrored features
48 };
49
50 #endif