]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchSolver/SketchSolver_ConstraintFixed.h
Salome HOME
First phase of SketchSolver refactoring
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintFixed.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    SketchSolver_ConstraintFixed.h
4 // Created: 30 Mar 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchSolver_ConstraintFixed_H_
8 #define SketchSolver_ConstraintFixed_H_
9
10 #include "SketchSolver.h"
11 #include <SketchSolver_Constraint.h>
12
13 /** \class   SketchSolver_ConstraintFixed
14  *  \ingroup Plugins
15  *  \brief   Stores data of the Fixed constraint
16  *
17  *  Fixed constraint may have NULL basic SketchPlugin constraint,
18  *  because the Fixed constraint may be temporary for correct moving of objects.
19  *
20  *  Fixed constraint does not create a constraint, but builds the entities in separate group,
21  *  so they will not be moved while resolving the set of constraints.
22  */
23 class SketchSolver_ConstraintFixed : public SketchSolver_Constraint
24 {
25 public:
26   /// Creates constraint to manage the given constraint from plugin
27   SketchSolver_ConstraintFixed(ConstraintPtr theConstraint);
28   /// Creates temporary constraint based on feature
29   SketchSolver_ConstraintFixed(FeaturePtr theFeature);
30
31   /// \brief Tries to remove constraint
32   /// \return \c false, if current constraint contains another SketchPlugin constraints (like for multiple coincidence)
33   virtual bool remove();
34
35 protected:
36   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
37   virtual void process();
38
39   /// \brief Generate list of attributes of constraint in order useful for constraints
40   /// \param[out] theValue      numerical characteristic of constraint (e.g. distance)
41   /// \param[out] theAttributes list of attributes to be filled
42   virtual void getAttributes(ParameterWrapperPtr& theValue, std::vector<EntityWrapperPtr>& theAttributes);
43
44   /// \brief Fixed feature basing on its type
45   /// \param theFeature [in]  feature, converted to solver specific format
46   virtual void fixFeature(EntityWrapperPtr theFeature);
47
48 ////  /// \brief Fix given point
49 ////  /// \return ID of the Fixed constraint
50 ////  Slvs_hConstraint fixPoint(const Slvs_hEntity& thePointID);
51 ////
52 ////  /// \brief Returns ID of fixed entity
53 ////  Slvs_hEntity fixedEntity() const;
54 ////
55 ////  /// \brief Fixing line position (start and end points)
56 ////  void fixLine(const Slvs_Entity& theLine);
57 ////  /// \brief Fixing circle (center and radius)
58 ////  void fixCircle(const Slvs_Entity& theCircle);
59 ////  /// \brief The arc is fixed differently to avoid SolveSpace problems (overconstraint)
60 ////  ///
61 ////  /// There will be fixed start and end points and the radius of the arc.
62 ////  void fixArc(const Slvs_Entity& theArc);
63
64 protected:
65   FeaturePtr myBaseFeature; ///< fixed feature (when it is set, myBaseConstraint should be NULL)
66
67 private:
68   AttributeRefAttrPtr myFixedAttribute; ///< attribute of a fixed constraint (for correct remove)
69 };
70
71 #endif