]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_ConstraintWrapper.h
Salome HOME
Merge branch 'V9_2_2_BR'
[modules/shaper.git] / src / SketchSolver / PlaneGCSSolver / PlaneGCSSolver_ConstraintWrapper.h
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
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 /**
27  *  Wrapper providing operations with PlaneGCS constraints.
28  */
29 class PlaneGCSSolver_ConstraintWrapper
30 {
31 public:
32   PlaneGCSSolver_ConstraintWrapper(const GCSConstraintPtr&            theConstraint,
33                                    const SketchSolver_ConstraintType& theType);
34   PlaneGCSSolver_ConstraintWrapper(const std::list<GCSConstraintPtr>& theConstraints,
35                                    const SketchSolver_ConstraintType& theType);
36
37   /// \brief Return list of constraints
38   const std::list<GCSConstraintPtr>& constraints() const
39   { return myGCSConstraints; }
40   /// \brief Change list of constraints
41   void setConstraints(const std::list<GCSConstraintPtr>& theConstraints)
42   { myGCSConstraints = theConstraints; }
43
44   /// \brief Return ID of current constraint
45   const ConstraintID& id() const
46   { return myID; }
47   /// \brief Change constraint ID
48   virtual void setId(const ConstraintID& theID);
49
50   /// \brief Return type of current entity
51   virtual SketchSolver_ConstraintType type() const
52   { return myType; }
53
54   /// \brief Assign numeric parameter of constraint
55   virtual void setValue(const double& theValue);
56   /// \brief Return numeric parameter of constraint
57   virtual double value() const;
58
59   /// \brief Change parameter representing the value of constraint
60   void setValueParameter(const ScalarWrapperPtr& theValue);
61   /// \brief Return parametric representation of constraint value
62   const ScalarWrapperPtr& valueParameter() const
63   { return myValueParam; }
64
65 private:
66   ConstraintID                myID;
67   SketchSolver_ConstraintType myType;
68   ScalarWrapperPtr            myValueParam;
69   std::list<GCSConstraintPtr> myGCSConstraints;
70 };
71
72 typedef std::shared_ptr<PlaneGCSSolver_ConstraintWrapper> ConstraintWrapperPtr;
73
74 #endif