]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchSolver/SketchSolver_ConstraintMultiRotation.h
Salome HOME
First phase of SketchSolver refactoring
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintMultiRotation.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    SketchSolver_ConstraintMultiRotation.h
4 // Created: 1 Apr 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchSolver_ConstraintMultiRotation_H_
8 #define SketchSolver_ConstraintMultiRotation_H_
9
10 #include "SketchSolver.h"
11 #include <SketchSolver_ConstraintMulti.h>
12
13 /** \class   SketchSolver_ConstraintMultiRotation
14  *  \ingroup Plugins
15  *  \brief   Convert rotated features to the list of SolveSpace constraints
16  */
17 class SketchSolver_ConstraintMultiRotation : public SketchSolver_ConstraintMulti
18 {
19 public:
20   /// Constructor based on SketchPlugin constraint
21   SketchSolver_ConstraintMultiRotation(ConstraintPtr theConstraint) :
22       SketchSolver_ConstraintMulti(theConstraint)
23   {}
24
25 ////  virtual int getType() const
26 ////  { return SLVS_C_MULTI_ROTATION; }
27
28 protected:
29   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
30   virtual void process();
31
32   /// \brief Generate list of rotated entities
33   /// \param[out] theCenter   central point of rotation
34   /// \param[out] theAngle    rotation angle
35   /// \param[out] theEntities list of entities and their rotated copies
36   void getAttributes(EntityWrapperPtr& theCenter, double& theAngle,
37                      std::list< std::list<EntityWrapperPtr> >& theEntities);
38
39   /// \brief This method is used in derived objects to check consistence of constraint.
40   virtual void adjustConstraint();
41
42   /// \brief Update parameters (called from base class)
43   virtual void updateLocal();
44
45 ////private:
46 ////  /// \brief Convert absolute coordinates to relative coordinates
47 ////  virtual void getRelative(double theAbsX, double theAbsY, double& theRelX, double& theRelY);
48 ////  /// \brief Convert relative coordinates to absolute coordinates
49 ////  virtual void getAbsolute(double theRelX, double theRelY, double& theAbsX, double& theAbsY);
50 ////  /// \brief Apply transformation for relative coordinates
51 ////  virtual void transformRelative(double& theX, double& theY);
52
53 private:
54   /// \brief Returns name of NUMBER_OF_COPIES parameter for corresponding feature
55   virtual const std::string& nameNbObjects();
56
57 ////private:
58 ////  Slvs_hEntity myRotationCenter; ///< ID of center of rotation
59   double       myAngle;           ///< angle of rotation
60 ////
61 ////  double myCenterCoord[2]; ///< coordinates of rotation center
62 ////  double myRotationVal[2]; ///< sinus and cosine of rotation angle
63 };
64
65 #endif