1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SolveSpaceSolver_EntityWrapper.h
5 // Author: Artem ZHIDKOV
7 #ifndef SolveSpaceSolver_EntityWrapper_H_
8 #define SolveSpaceSolver_EntityWrapper_H_
10 #include <SketchSolver_IEntityWrapper.h>
11 #include <SolveSpaceSolver_Solver.h>
14 * Wrapper providing operations with SolveSpace entities.
16 class SolveSpaceSolver_EntityWrapper : public SketchSolver_IEntityWrapper
19 SolveSpaceSolver_EntityWrapper(const FeaturePtr theFeature, const Slvs_Entity& theEntity);
20 SolveSpaceSolver_EntityWrapper(const AttributePtr theAttribute, const Slvs_Entity& theEntity);
22 /// \brief Constructor useful for SketchPlugin_Point only
23 SolveSpaceSolver_EntityWrapper(const FeaturePtr thePointFeature,
24 const AttributePtr thePointAttribute,
25 const Slvs_Entity& theEntity);
27 /// \brief Return SolveSpace entity
28 const Slvs_Entity& entity() const
30 /// \brief Return SolveSpace entity to change
31 Slvs_Entity& changeEntity()
34 /// \brief Return ID of current entity
35 virtual EntityID id() const;
37 /// \brief Change group for the entity
38 virtual void setGroup(const GroupID& theGroup);
39 /// \brief Return identifier of the group the entity belongs to
40 virtual GroupID group() const
41 { return (GroupID)myEntity.group; }
43 /// \brief Return type of current entity
44 virtual SketchSolver_EntityType type() const;
46 /// \brief Verify the feature is used in the entity
47 virtual bool isUsed(FeaturePtr theFeature) const;
48 /// \brief Verify the attribute is used in the entity
49 virtual bool isUsed(AttributePtr theAttribute) const;
51 /// \brief Compare current entity with other
52 virtual bool isEqual(const EntityWrapperPtr& theOther);
54 /// \brief Update values of parameters of this entity by the parameters of given one
55 /// \return \c true if some parameters change their values
56 virtual bool update(const std::shared_ptr<SketchSolver_IEntityWrapper>& theOther);