SHAPER 9.16.0
PlaneGCSSolver_ConstraintWrapper.h
1// Copyright (C) 2014-2026 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 PlaneGCSSolver_ConstraintWrapper_H_
21#define PlaneGCSSolver_ConstraintWrapper_H_
22
23#include <PlaneGCSSolver_Defs.h>
24#include <PlaneGCSSolver_ScalarWrapper.h>
25
26#include <list>
27
32{
33public:
34 PlaneGCSSolver_ConstraintWrapper(const GCSConstraintPtr& theConstraint,
35 const SketchSolver_ConstraintType& theType);
36 PlaneGCSSolver_ConstraintWrapper(const std::list<GCSConstraintPtr>& theConstraints,
37 const SketchSolver_ConstraintType& theType);
38
40 const std::list<GCSConstraintPtr>& constraints() const
41 { return myGCSConstraints; }
43 void setConstraints(const std::list<GCSConstraintPtr>& theConstraints)
44 { myGCSConstraints = theConstraints; }
45
47 const ConstraintID& id() const
48 { return myID; }
50 virtual void setId(const ConstraintID& theID);
51
53 virtual SketchSolver_ConstraintType type() const
54 { return myType; }
55
57 virtual void setValue(const double& theValue);
59 virtual double value() const;
60
62 void setValueParameter(const ScalarWrapperPtr& theValue);
64 const ScalarWrapperPtr& valueParameter() const
65 { return myValueParam; }
66
67private:
68 ConstraintID myID;
69 SketchSolver_ConstraintType myType;
70 ScalarWrapperPtr myValueParam;
71 std::list<GCSConstraintPtr> myGCSConstraints;
72};
73
74typedef std::shared_ptr<PlaneGCSSolver_ConstraintWrapper> ConstraintWrapperPtr;
75
76#endif
Wrapper providing operations with PlaneGCS constraints.
Definition: PlaneGCSSolver_ConstraintWrapper.h:32
virtual void setId(const ConstraintID &theID)
Change constraint ID.
Definition: PlaneGCSSolver_ConstraintWrapper.cpp:40
void setConstraints(const std::list< GCSConstraintPtr > &theConstraints)
Change list of constraints.
Definition: PlaneGCSSolver_ConstraintWrapper.h:43
const ScalarWrapperPtr & valueParameter() const
Return parametric representation of constraint value.
Definition: PlaneGCSSolver_ConstraintWrapper.h:64
virtual SketchSolver_ConstraintType type() const
Return type of current entity.
Definition: PlaneGCSSolver_ConstraintWrapper.h:53
void setValueParameter(const ScalarWrapperPtr &theValue)
Change parameter representing the value of constraint.
Definition: PlaneGCSSolver_ConstraintWrapper.cpp:45
const std::list< GCSConstraintPtr > & constraints() const
Return list of constraints.
Definition: PlaneGCSSolver_ConstraintWrapper.h:40
const ConstraintID & id() const
Return ID of current constraint.
Definition: PlaneGCSSolver_ConstraintWrapper.h:47
virtual void setValue(const double &theValue)
Assign numeric parameter of constraint.
Definition: PlaneGCSSolver_ConstraintWrapper.cpp:50
virtual double value() const
Return numeric parameter of constraint.
Definition: PlaneGCSSolver_ConstraintWrapper.cpp:55