SHAPER  9.12.0
SketchSolver_ConstraintMultiRotation.h
1 // Copyright (C) 2014-2023 CEA, EDF
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 SketchSolver_ConstraintMultiRotation_H_
21 #define SketchSolver_ConstraintMultiRotation_H_
22 
23 #include <SketchSolver_ConstraintMulti.h>
24 
25 #include "GeomDataAPI_Point2D.h"
26 
32 {
33 public:
35  SketchSolver_ConstraintMultiRotation(ConstraintPtr theConstraint) :
36  SketchSolver_ConstraintMulti(theConstraint)
37  {}
38 
39 protected:
41  virtual void process();
42 
49  void getAttributes(EntityWrapperPtr& theCenter,
50  ScalarWrapperPtr& theAngle,
51  bool& theFullValue,
52  bool& theReversed,
53  std::list<EntityWrapperPtr>& theEntities);
54 
56  virtual void adjustConstraint();
57 
59  virtual void updateLocal();
60 
61 private:
63  virtual void getRelative(double theAbsX, double theAbsY,
64  double& theRelX, double& theRelY);
66  virtual void getAbsolute(double theRelX, double theRelY,
67  double& theAbsX, double& theAbsY);
69  virtual void transformRelative(double& theX, double& theY);
70 
72  virtual const std::string& nameNbObjects();
73 
74 private:
75  AttributePoint2DPtr myCenterPointAttribute;
76  ScalarWrapperPtr myAngle;
77  bool myIsRevered;
78 
79  double myCenterCoord[2];
80  double myRotationVal[2];
81 };
82 
83 #endif
Convert rotated features to the list of SolveSpace constraints.
Definition: SketchSolver_ConstraintMultiRotation.h:32
virtual void updateLocal()
Update parameters (called from base class)
Definition: SketchSolver_ConstraintMultiRotation.cpp:91
virtual void process()
Converts SketchPlugin constraint to a list of SolveSpace constraints.
Definition: SketchSolver_ConstraintMultiRotation.cpp:71
void getAttributes(EntityWrapperPtr &theCenter, ScalarWrapperPtr &theAngle, bool &theFullValue, bool &theReversed, std::list< EntityWrapperPtr > &theEntities)
Generate list of rotated entities.
Definition: SketchSolver_ConstraintMultiRotation.cpp:35
SketchSolver_ConstraintMultiRotation(ConstraintPtr theConstraint)
Constructor based on SketchPlugin constraint.
Definition: SketchSolver_ConstraintMultiRotation.h:35
virtual void adjustConstraint()
This method is used in derived objects to check consistence of constraint.
Definition: SketchSolver_ConstraintMultiRotation.cpp:119
Common base class for the Multi constraints.
Definition: SketchSolver_ConstraintMulti.h:32