20 #ifndef SketchSolver_Constraint_H_
21 #define SketchSolver_Constraint_H_
23 #include <SketchSolver_Storage.h>
24 #include <PlaneGCSSolver_Update.h>
26 #include <SketchPlugin_Constraint.h>
28 #include <ModelAPI_AttributeDouble.h>
29 #include <ModelAPI_AttributeRefAttr.h>
43 :
myType(CONSTRAINT_UNKNOWN)
55 void process(StoragePtr theStorage,
bool theEvensBlocked);
72 static SketchSolver_ConstraintType
TYPE(ConstraintPtr theConstraint);
75 virtual SketchSolver_ConstraintType
getType()
const
79 const std::string&
error()
const
90 std::vector<EntityWrapperPtr>& theAttributes);
113 typedef std::shared_ptr<SketchSolver_Constraint> SolverConstraintPtr;
Send events to listeners about changing a feature.
Definition: PlaneGCSSolver_Update.h:38
Converts SketchPlugin constraint to the constraint applicable for solver.
Definition: SketchSolver_Constraint.h:39
const std::string & error() const
Shows error message.
Definition: SketchSolver_Constraint.h:79
virtual SketchSolver_ConstraintType getType() const
Returns the type of constraint.
Definition: SketchSolver_Constraint.h:75
SketchSolver_ConstraintType myType
type of constraint
Definition: SketchSolver_Constraint.h:107
ConstraintWrapperPtr mySolverConstraint
wrapper for PlaneGCS constraint
Definition: SketchSolver_Constraint.h:103
virtual void process()
Converts SketchPlugin constraint to a list of solver's constraints.
Definition: SketchSolver_Constraint.cpp:114
virtual void blockEvents(bool isBlocked)
Block or unblock events from this constraint.
Definition: SketchSolver_Constraint.cpp:71
virtual bool remove()
Tries to remove constraint.
Definition: SketchSolver_Constraint.cpp:190
virtual void adjustConstraint()
This method is used in derived objects to check consistency of constraint.
Definition: SketchSolver_Constraint.h:94
SketchSolver_Constraint()
Default constructor.
Definition: SketchSolver_Constraint.h:42
void cleanErrorMsg()
Removes last error.
Definition: SketchSolver_Constraint.h:98
virtual void getAttributes(EntityWrapperPtr &theValue, std::vector< EntityWrapperPtr > &theAttributes)
Generate list of attributes of constraint in order useful for constraints.
Definition: SketchSolver_Constraint.cpp:198
ConstraintPtr myBaseConstraint
base SketchPlugin constraint
Definition: SketchSolver_Constraint.h:102
std::list< EntityWrapperPtr > myAttributes
attributes of constraint
Definition: SketchSolver_Constraint.h:108
StoragePtr myStorage
storage, which contains all information about entities and constraints
Definition: SketchSolver_Constraint.h:106
virtual void update()
Update constraint.
Definition: SketchSolver_Constraint.cpp:147
static SketchSolver_ConstraintType TYPE(ConstraintPtr theConstraint)
Obtain a type of SketchPlugin constraint.
Definition: SketchSolver_Constraint.cpp:77
virtual void notify(const FeaturePtr &theFeature, PlaneGCSSolver_Update *theUpdater)
Notify this object about the feature is changed somewhere.
Definition: SketchSolver_Constraint.h:58
std::string myErrorMsg
error message
Definition: SketchSolver_Constraint.h:110