Salome HOME
Updated copyright comment
[modules/shaper.git] / src / SketchSolver / PlaneGCSSolver / PlaneGCSSolver_ConstraintWrapper.cpp
1 // Copyright (C) 2014-2024  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 #include <PlaneGCSSolver_ConstraintWrapper.h>
21
22 PlaneGCSSolver_ConstraintWrapper::PlaneGCSSolver_ConstraintWrapper(
23     const GCSConstraintPtr& theConstraint,
24     const SketchSolver_ConstraintType& theType)
25   : myGCSConstraints(1, theConstraint),
26     myType(theType)
27 {
28   myID = CID_UNKNOWN;
29 }
30
31 PlaneGCSSolver_ConstraintWrapper::PlaneGCSSolver_ConstraintWrapper(
32     const std::list<GCSConstraintPtr>& theConstraints,
33     const SketchSolver_ConstraintType& theType)
34   : myGCSConstraints(theConstraints),
35     myType(theType)
36 {
37   myID = CID_UNKNOWN;
38 }
39
40 void PlaneGCSSolver_ConstraintWrapper::setId(const ConstraintID& theID)
41 {
42   myID = theID;
43 }
44
45 void PlaneGCSSolver_ConstraintWrapper::setValueParameter(const ScalarWrapperPtr& theValue)
46 {
47   myValueParam = theValue;
48 }
49
50 void PlaneGCSSolver_ConstraintWrapper::setValue(const double& theValue)
51 {
52   myValueParam->setValue(theValue);
53 }
54
55 double PlaneGCSSolver_ConstraintWrapper::value() const
56 {
57   return myValueParam ? myValueParam->value() : 0.0;
58 }