1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketchSolver_ConstraintMirror.h
5 // Author: Artem ZHIDKOV
7 #ifndef SketchSolver_ConstraintMirror_H_
8 #define SketchSolver_ConstraintMirror_H_
10 #include "SketchSolver.h"
11 #include <SketchSolver_Constraint.h>
13 /** \class SketchSolver_ConstraintMirror
15 * \brief Convert fillet constraint to SolveSpace structure
17 class SketchSolver_ConstraintMirror : public SketchSolver_Constraint
20 /// Constructor based on SketchPlugin constraint
21 SketchSolver_ConstraintMirror(ConstraintPtr theConstraint) :
22 SketchSolver_Constraint(theConstraint),
26 /// \brief Update constraint
27 virtual void update();
30 /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
31 virtual void process();
33 /// \brief Generate list of attributes of constraint in order useful for constraints
34 /// \param[out] theValue numerical characteristic of constraint (e.g. distance)
35 /// \param[out] theAttributes list of attributes to be filled
36 virtual void getAttributes(double& theValue, std::vector<EntityWrapperPtr>& theAttributes)
37 { /* do nothing here */ }
39 /// \brief Generate list of entities of mirror constraint
40 /// \param[out] theMirrorLine entity corresponding to mirror line
41 /// \param[out] theBaseEntities list of entities to mirror
42 /// \param[out] theMirrorEntities list of mirrored entities
43 void getAttributes(EntityWrapperPtr& theMirrorLine,
44 std::vector<EntityWrapperPtr>& theBaseEntities,
45 std::vector<EntityWrapperPtr>& theMirrorEntities);
47 /// \brief This method is used in derived objects to check consistence of constraint.
48 /// E.g. the distance between line and point may be signed.
49 virtual void adjustConstraint();
52 size_t myNumberOfObjects; ///< number of previously mirrored objects