1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef SolveSpaceSolver_EntityWrapper_H_
22 #define SolveSpaceSolver_EntityWrapper_H_
24 #include <SketchSolver_IEntityWrapper.h>
25 #include <SolveSpaceSolver_Solver.h>
28 * Wrapper providing operations with SolveSpace entities.
30 class SolveSpaceSolver_EntityWrapper : public SketchSolver_IEntityWrapper
33 SolveSpaceSolver_EntityWrapper(const FeaturePtr theFeature, const Slvs_Entity& theEntity);
34 SolveSpaceSolver_EntityWrapper(const AttributePtr theAttribute, const Slvs_Entity& theEntity);
36 /// \brief Constructor useful for SketchPlugin_Point only
37 SolveSpaceSolver_EntityWrapper(const FeaturePtr thePointFeature,
38 const AttributePtr thePointAttribute,
39 const Slvs_Entity& theEntity);
41 /// \brief Return SolveSpace entity
42 const Slvs_Entity& entity() const
44 /// \brief Return SolveSpace entity to change
45 Slvs_Entity& changeEntity()
48 /// \brief Return ID of current entity
49 virtual EntityID id() const;
51 /// \brief Change group for the entity
52 virtual void setGroup(const GroupID& theGroup);
53 /// \brief Return identifier of the group the entity belongs to
54 virtual GroupID group() const
55 { return (GroupID)myEntity.group; }
57 /// \brief Return type of current entity
58 virtual SketchSolver_EntityType type() const;
60 /// \brief Verify the feature is used in the entity
61 virtual bool isUsed(FeaturePtr theFeature) const;
62 /// \brief Verify the attribute is used in the entity
63 virtual bool isUsed(AttributePtr theAttribute) const;
65 /// \brief Compare current entity with other
66 virtual bool isEqual(const EntityWrapperPtr& theOther);
68 /// \brief Update values of parameters of this entity by the parameters of given one
69 /// \return \c true if some parameters change their values
70 virtual bool update(const std::shared_ptr<SketchSolver_IEntityWrapper>& theOther);