]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchSolver/SketchSolver_ConstraintAngle.h
Salome HOME
Update calculation of angle value (issue #788)
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintAngle.h
diff --git a/src/SketchSolver/SketchSolver_ConstraintAngle.h b/src/SketchSolver/SketchSolver_ConstraintAngle.h
new file mode 100644 (file)
index 0000000..a4a65a4
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:    SketchSolver_ConstraintAngle.h
+// Created: 24 August 2015
+// Author:  Artem ZHIDKOV
+
+#ifndef SketchSolver_ConstraintAngle_H_
+#define SketchSolver_ConstraintAngle_H_
+
+#include <SketchSolver_Constraint.h>
+
+/** \class   SketchSolver_ConstraintAngle
+ *  \ingroup Plugins
+ *  \brief   Convert Agnle constraint to SolveSpace structure
+ */
+class SketchSolver_ConstraintAngle : public SketchSolver_Constraint
+{
+public:
+  SketchSolver_ConstraintAngle(ConstraintPtr theConstraint) :
+      SketchSolver_Constraint(theConstraint),
+      myAngle(0.0)
+  {}
+
+  virtual int getType() const
+  { return SLVS_C_ANGLE; }
+
+  /// \brief This method is used in derived objects to check consistence of constraint.
+  virtual void adjustConstraint();
+
+protected:
+  /// \brief Generate list of attributes of constraint in order useful for SolveSpace constraints
+  /// \param[out] theValue      numerical characteristic of constraint (e.g. distance)
+  /// \param[out] theAttributes list of attributes to be filled
+  virtual void getAttributes(double& theValue, std::vector<Slvs_hEntity>& theAttributes);
+
+private:
+  double myAngle;
+};
+
+#endif