SHAPER 9.16.0
SketchSolver_ConstraintMultiTranslation.h
1// Copyright (C) 2014-2026 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_ConstraintMultiTranslation_H_
21#define SketchSolver_ConstraintMultiTranslation_H_
22
23#include <SketchSolver_ConstraintMulti.h>
24
25#include "GeomDataAPI_Point2D.h"
26
32{
33public:
35 SketchSolver_ConstraintMultiTranslation(ConstraintPtr theConstraint) :
36 SketchSolver_ConstraintMulti(theConstraint)
37 {}
38
39protected:
41 virtual void process();
42
48 void getAttributes(EntityWrapperPtr& theStartPoint, EntityWrapperPtr& theEndPoint,
49 bool& theFullValue, std::list<EntityWrapperPtr>& theEntities);
50
52 virtual void adjustConstraint();
53
55 virtual void updateLocal();
56
57private:
59 virtual void getRelative(double theAbsX, double theAbsY,
60 double& theRelX, double& theRelY);
62 virtual void getAbsolute(double theRelX, double theRelY,
63 double& theAbsX, double& theAbsY);
65 virtual void transformRelative(double& theX, double& theY);
66
68 virtual const std::string& nameNbObjects();
69
70private:
71 AttributePoint2DPtr myStartPointAttribute;
72 AttributePoint2DPtr myEndPointAttribute;
73
74 double myDelta[2];
75};
76
77#endif
Convert translated features to the list of SolveSpace constraints.
Definition: SketchSolver_ConstraintMultiTranslation.h:32
virtual void process()
Converts SketchPlugin constraint to a list of SolveSpace constraints.
Definition: SketchSolver_ConstraintMultiTranslation.cpp:68
void getAttributes(EntityWrapperPtr &theStartPoint, EntityWrapperPtr &theEndPoint, bool &theFullValue, std::list< EntityWrapperPtr > &theEntities)
Generate list of translated entities.
Definition: SketchSolver_ConstraintMultiTranslation.cpp:32
virtual void updateLocal()
Update parameters (called from base class)
Definition: SketchSolver_ConstraintMultiTranslation.cpp:93
virtual void adjustConstraint()
This method is used in derived objects to check consistence of constraint.
Definition: SketchSolver_ConstraintMultiTranslation.cpp:118
SketchSolver_ConstraintMultiTranslation(ConstraintPtr theConstraint)
Constructor based on SketchPlugin constraint.
Definition: SketchSolver_ConstraintMultiTranslation.h:35
Common base class for the Multi constraints.
Definition: SketchSolver_ConstraintMulti.h:32