20 #ifndef SketchSolver_Manager_H_
21 #define SketchSolver_Manager_H_
23 #include <SketchSolver_Group.h>
25 #include <Events_Listener.h>
53 virtual void processEvent(
const std::shared_ptr<Events_Message>& theMessage);
69 bool updateFeature(
const std::shared_ptr<SketchPlugin_Feature>& theFeature);
75 bool updateSketch(
const std::shared_ptr<ModelAPI_CompositeFeature>& theSketch);
83 bool moveFeature(
const std::shared_ptr<SketchPlugin_Feature>& theMovedFeature,
84 const std::shared_ptr<GeomAPI_Pnt2d>& theFromPoint,
85 const std::shared_ptr<GeomAPI_Pnt2d>& theToPoint);
94 bool moveAttribute(
const std::shared_ptr<ModelAPI_Attribute>& theMovedAttribute,
95 const int theMovedPointIndex,
96 const std::shared_ptr<GeomAPI_Pnt2d>& theFromPoint,
97 const std::shared_ptr<GeomAPI_Pnt2d>& theToPoint);
116 SketchGroupPtr findGroup(std::shared_ptr<SketchPlugin_Feature> theFeature);
121 SketchGroupPtr findGroup(std::shared_ptr<ModelAPI_CompositeFeature> theSketch);
125 bool stopSendUpdate()
const;
127 void allowSendUpdate()
const;
130 void releaseFeaturesIfEventsBlocked()
const;
133 std::list<SketchGroupPtr> myGroups;
Base interface for any event listener.
Definition: Events_Listener.h:37
2D point defined by two coordinates
Definition: GeomAPI_Pnt2d.h:36
Attribute that contains 2D point coordinates.
Definition: GeomDataAPI_Point2D.h:37
Feature that consists of other features: like sketcher with edges inside.
Definition: ModelAPI_CompositeFeature.h:33
Abstract interface to the SketchPlugin_ConstraintBase For more info see: SketchPlugin_ConstraintBase....
Definition: SketchPlugin_Constraint.h:37
Listens the changes of SketchPlugin features and transforms the Constraint feature into the format un...
Definition: SketchSolver_Manager.h:43
bool moveAttribute(const std::shared_ptr< ModelAPI_Attribute > &theMovedAttribute, const int theMovedPointIndex, const std::shared_ptr< GeomAPI_Pnt2d > &theFromPoint, const std::shared_ptr< GeomAPI_Pnt2d > &theToPoint)
Move feature using its moved attribute.
Definition: SketchSolver_Manager.cpp:365
bool updateFeature(const std::shared_ptr< SketchPlugin_Feature > &theFeature)
Adds or updates a constraint or an entity in the suitable group.
Definition: SketchSolver_Manager.cpp:309
bool updateSketch(const std::shared_ptr< ModelAPI_CompositeFeature > &theSketch)
Updates the sketch and related constraints, if the sketch plane is changed.
Definition: SketchSolver_Manager.cpp:290
virtual void processEvent(const std::shared_ptr< Events_Message > &theMessage)
Implementation of Event Listener method.
Definition: SketchSolver_Manager.cpp:148
bool removeConstraint(std::shared_ptr< SketchPlugin_Constraint > theConstraint)
Removes a constraint from the manager.
virtual bool groupMessages()
The solver needs all the updated objects are transferred in one group, not one by one.
Definition: SketchSolver_Manager.cpp:139
bool resolveConstraints()
Goes through the list of groups and solve the constraints.
Definition: SketchSolver_Manager.cpp:439
bool moveFeature(const std::shared_ptr< SketchPlugin_Feature > &theMovedFeature, const std::shared_ptr< GeomAPI_Pnt2d > &theFromPoint, const std::shared_ptr< GeomAPI_Pnt2d > &theToPoint)
Move feature.
Definition: SketchSolver_Manager.cpp:334
static SketchSolver_Manager * instance()
Main method to create constraint manager.
Definition: SketchSolver_Manager.cpp:109