SHAPER  9.12.0
SolveSpaceSolver_ConstraintWrapper.h
1 // Copyright (C) 2014-2023 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_ConstraintWrapper_H_
21 #define SolveSpaceSolver_ConstraintWrapper_H_
22 
23 #include <SketchSolver_IConstraintWrapper.h>
24 #include <SolveSpaceSolver_Solver.h>
25 
26 
31 {
32 public:
33  SolveSpaceSolver_ConstraintWrapper(const ConstraintPtr& theOriginal,
34  const Slvs_Constraint& theConstraint);
35 
37  const Slvs_Constraint& constraint() const
38  { return mySlvsConstraint; }
40  Slvs_Constraint& changeConstraint()
41  { return mySlvsConstraint; }
42 
44  virtual ConstraintID id() const;
45 
47  virtual void setGroup(const GroupID& theGroup);
49  virtual GroupID group() const
50  { return (GroupID)mySlvsConstraint.group; }
51 
53  virtual SketchSolver_ConstraintType type() const;
54 
56  virtual bool isUsed(FeaturePtr theFeature) const;
58  virtual bool isUsed(AttributePtr theAttribute) const;
59 
61  virtual bool isEqual(const ConstraintWrapperPtr& theOther);
62 
65  virtual bool update(const std::shared_ptr<SketchSolver_IConstraintWrapper>& theOther);
66 
67 private:
68  Slvs_Constraint mySlvsConstraint;
69 };
70 
71 #endif
Wrapper providing operations with SovleSpace constraints.
Definition: SolveSpaceSolver_ConstraintWrapper.h:31
virtual void setGroup(const GroupID &theGroup)
Change group for the constraint.
Definition: SolveSpaceSolver_ConstraintWrapper.cpp:38
virtual SketchSolver_ConstraintType type() const
Return type of current entity.
Definition: SolveSpaceSolver_ConstraintWrapper.cpp:46
virtual bool update(const std::shared_ptr< SketchSolver_IConstraintWrapper > &theOther)
Update values of parameters of this constraint by the parameters of given one.
Definition: SolveSpaceSolver_ConstraintWrapper.cpp:104
virtual bool isEqual(const ConstraintWrapperPtr &theOther)
Compare current constraint with other.
Definition: SolveSpaceSolver_ConstraintWrapper.cpp:69
virtual bool isUsed(FeaturePtr theFeature) const
Verify the feature is used in the constraint.
Definition: SolveSpaceSolver_ConstraintWrapper.cpp:51
Slvs_Constraint & changeConstraint()
Return SolveSpace constraint to change.
Definition: SolveSpaceSolver_ConstraintWrapper.h:40
const Slvs_Constraint & constraint() const
Return SolveSpace constraint.
Definition: SolveSpaceSolver_ConstraintWrapper.h:37
virtual ConstraintID id() const
Return ID of current entity.
Definition: SolveSpaceSolver_ConstraintWrapper.cpp:33
virtual GroupID group() const
Return identifier of the group the constraint belongs to.
Definition: SolveSpaceSolver_ConstraintWrapper.h:49