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 protected:
26   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
27   virtual void process();
28
29   /// \brief Generate list of rotated entities
30   /// \param[out] theCenter   central point of rotation
31   /// \param[out] theAngle    rotation angle
32   /// \param[out] theEntities list of entities and their rotated copies
33   void getAttributes(EntityWrapperPtr& theCenter, double& theAngle,
34                      std::list< std::list<EntityWrapperPtr> >& theEntities);
35
36   /// \brief This method is used in derived objects to check consistence of constraint.
37   virtual void adjustConstraint();
38
39   /// \brief Update parameters (called from base class)
40   virtual void updateLocal();
41
42 private:
43   /// \brief Returns name of NUMBER_OF_COPIES parameter for corresponding feature
44   virtual const std::string& nameNbObjects();
45   double       myAngle;           ///< angle of rotation
46 };
47
48 #endif