1 // Copyright (C) 2014-2019 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 email : webmaster.salome@opencascade.com
20 #ifndef PlaneGCSSolver_ConstraintWrapper_H_
21 #define PlaneGCSSolver_ConstraintWrapper_H_
23 #include <PlaneGCSSolver_Defs.h>
24 #include <PlaneGCSSolver_ScalarWrapper.h>
29 * Wrapper providing operations with PlaneGCS constraints.
31 class PlaneGCSSolver_ConstraintWrapper
34 PlaneGCSSolver_ConstraintWrapper(const GCSConstraintPtr& theConstraint,
35 const SketchSolver_ConstraintType& theType);
36 PlaneGCSSolver_ConstraintWrapper(const std::list<GCSConstraintPtr>& theConstraints,
37 const SketchSolver_ConstraintType& theType);
39 /// \brief Return list of constraints
40 const std::list<GCSConstraintPtr>& constraints() const
41 { return myGCSConstraints; }
42 /// \brief Change list of constraints
43 void setConstraints(const std::list<GCSConstraintPtr>& theConstraints)
44 { myGCSConstraints = theConstraints; }
46 /// \brief Return ID of current constraint
47 const ConstraintID& id() const
49 /// \brief Change constraint ID
50 virtual void setId(const ConstraintID& theID);
52 /// \brief Return type of current entity
53 virtual SketchSolver_ConstraintType type() const
56 /// \brief Assign numeric parameter of constraint
57 virtual void setValue(const double& theValue);
58 /// \brief Return numeric parameter of constraint
59 virtual double value() const;
61 /// \brief Change parameter representing the value of constraint
62 void setValueParameter(const ScalarWrapperPtr& theValue);
63 /// \brief Return parametric representation of constraint value
64 const ScalarWrapperPtr& valueParameter() const
65 { return myValueParam; }
69 SketchSolver_ConstraintType myType;
70 ScalarWrapperPtr myValueParam;
71 std::list<GCSConstraintPtr> myGCSConstraints;
74 typedef std::shared_ptr<PlaneGCSSolver_ConstraintWrapper> ConstraintWrapperPtr;