Salome HOME
b006251ebb329a746c47164a4496673f4d7a1742
[modules/shaper.git] / src / SketchSolver / SolveSpaceSolver / SolveSpaceSolver_EntityWrapper.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    SolveSpaceSolver_EntityWrapper.h
4 // Created: 2 Dec 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SolveSpaceSolver_EntityWrapper_H_
8 #define SolveSpaceSolver_EntityWrapper_H_
9
10 #include <SketchSolver_IEntityWrapper.h>
11 #include <SolveSpaceSolver_Solver.h>
12
13 #include <SketchPlugin_Point.h>
14
15 /**
16  *  Wrapper providing operations with SolveSpace entities.
17  */
18 class SolveSpaceSolver_EntityWrapper : public SketchSolver_IEntityWrapper
19 {
20 public:
21   SolveSpaceSolver_EntityWrapper(const FeaturePtr theFeature, const Slvs_Entity& theEntity);
22   SolveSpaceSolver_EntityWrapper(const AttributePtr theAttribute, const Slvs_Entity& theEntity);
23
24   /// \brief Constructor useful for SketchPlugin_Point only
25   SolveSpaceSolver_EntityWrapper(const std::shared_ptr<SketchPlugin_Point> theFeature,
26                                  const AttributePtr theAttribute,
27                                  const Slvs_Entity& theEntity);
28
29   /// \brief Return SolveSpace entity
30   const Slvs_Entity& entity() const
31   { return myEntity; }
32   /// \brief Return SolveSpace entity to change
33   Slvs_Entity& changeEntity()
34   { return myEntity; }
35
36   /// \brief Return ID of current entity
37   virtual EntityID id() const;
38
39   /// \brief Change group for the entity
40   virtual void setGroup(const GroupID& theGroup);
41   /// \brief Return identifier of the group the entity belongs to
42   virtual GroupID group() const
43   { return (GroupID)myEntity.group; }
44
45   /// \brief Return type of current entity
46   virtual SketchSolver_EntityType type() const;
47
48   /// \brief Verify the feature is used in the entity
49   virtual bool isUsed(FeaturePtr theFeature) const;
50   /// \brief Verify the attribute is used in the entity
51   virtual bool isUsed(AttributePtr theAttribute) const;
52
53   /// \brief Compare current entity with other
54   virtual bool isEqual(const EntityWrapperPtr& theOther);
55
56   /// \brief Update values of parameters of this entity by the parameters of given one
57   /// \return \c true if some parameters change their values
58   virtual bool update(const std::shared_ptr<SketchSolver_IEntityWrapper>& theOther);
59
60 private:
61   Slvs_Entity  myEntity;
62 };
63
64 #endif