SHAPER  9.15.0
SolveSpaceSolver_EntityWrapper.h
1 // Copyright (C) 2014-2025 CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef SolveSpaceSolver_EntityWrapper_H_
21 #define SolveSpaceSolver_EntityWrapper_H_
22 
23 #include <SketchSolver_IEntityWrapper.h>
24 #include <SolveSpaceSolver_Solver.h>
25 
30 {
31 public:
32  SolveSpaceSolver_EntityWrapper(const FeaturePtr theFeature, const Slvs_Entity& theEntity);
33  SolveSpaceSolver_EntityWrapper(const AttributePtr theAttribute, const Slvs_Entity& theEntity);
34 
36  SolveSpaceSolver_EntityWrapper(const FeaturePtr thePointFeature,
37  const AttributePtr thePointAttribute,
38  const Slvs_Entity& theEntity);
39 
41  const Slvs_Entity& entity() const
42  { return myEntity; }
44  Slvs_Entity& changeEntity()
45  { return myEntity; }
46 
48  virtual EntityID id() const;
49 
51  virtual void setGroup(const GroupID& theGroup);
53  virtual GroupID group() const
54  { return (GroupID)myEntity.group; }
55 
57  virtual SketchSolver_EntityType type() const;
58 
60  virtual bool isUsed(FeaturePtr theFeature) const;
62  virtual bool isUsed(AttributePtr theAttribute) const;
63 
65  virtual bool isEqual(const EntityWrapperPtr& theOther);
66 
69  virtual bool update(const std::shared_ptr<SketchSolver_IEntityWrapper>& theOther);
70 
71 private:
72  Slvs_Entity myEntity;
73 };
74 
75 #endif
Wrapper providing operations with SolveSpace entities.
Definition: SolveSpaceSolver_EntityWrapper.h:30
Slvs_Entity & changeEntity()
Return SolveSpace entity to change.
Definition: SolveSpaceSolver_EntityWrapper.h:44
const Slvs_Entity & entity() const
Return SolveSpace entity.
Definition: SolveSpaceSolver_EntityWrapper.h:41
virtual bool update(const std::shared_ptr< SketchSolver_IEntityWrapper > &theOther)
Update values of parameters of this entity by the parameters of given one.
Definition: SolveSpaceSolver_EntityWrapper.cpp:131
virtual EntityID id() const
Return ID of current entity.
Definition: SolveSpaceSolver_EntityWrapper.cpp:47
virtual GroupID group() const
Return identifier of the group the entity belongs to.
Definition: SolveSpaceSolver_EntityWrapper.h:53
virtual bool isUsed(FeaturePtr theFeature) const
Verify the feature is used in the entity.
Definition: SolveSpaceSolver_EntityWrapper.cpp:80
virtual bool isEqual(const EntityWrapperPtr &theOther)
Compare current entity with other.
Definition: SolveSpaceSolver_EntityWrapper.cpp:104
virtual SketchSolver_EntityType type() const
Return type of current entity.
Definition: SolveSpaceSolver_EntityWrapper.cpp:63
virtual void setGroup(const GroupID &theGroup)
Change group for the entity.
Definition: SolveSpaceSolver_EntityWrapper.cpp:52