SHAPER
9.12.0
|
Interface to map SketchPlugin features to the entities of corresponding solver. More...
Public Member Functions | |
SketchSolver_Storage (SolverPtr theSolver) | |
virtual void | addConstraint (ConstraintPtr theConstraint, ConstraintWrapperPtr theSolverConstraint) |
Change mapping between constraint from SketchPlugin and a constraint applicable for corresponding solver. More... | |
virtual void | addMovementConstraint (const ConstraintWrapperPtr &theSolverConstraint)=0 |
Add a movement constraint which will be destroyed after the next solving of the set of constraints. More... | |
void | addEntity (FeaturePtr theFeature, EntityWrapperPtr theSolverEntity) |
Change mapping feature from SketchPlugin and the entity applicable for corresponding solver. More... | |
void | addEntity (AttributePtr theAttribute, EntityWrapperPtr theSolverEntity) |
Change mapping attribute of a feature and the entity applicable for corresponding solver. More... | |
virtual bool | update (FeaturePtr theFeature, bool theForce=false)=0 |
Convert feature to the form applicable for specific solver and map it. More... | |
virtual bool | update (AttributePtr theAttribute, bool theForce=false)=0 |
Convert attribute to the form applicable for specific solver and map it. More... | |
const ConstraintWrapperPtr & | constraint (const ConstraintPtr &theConstraint) const |
Returns constraint related to corresponding constraint. More... | |
const EntityWrapperPtr & | entity (const FeaturePtr &theFeature) const |
Returns entity related to corresponding feature. More... | |
const EntityWrapperPtr & | entity (const AttributePtr &theAttribute) const |
Returns entity related to corresponding attribute. More... | |
virtual void | makeExternal (const EntityWrapperPtr &theEntity)=0 |
Make entity external. More... | |
virtual void | makeNonExternal (const EntityWrapperPtr &theEntity)=0 |
Make entity non-external. More... | |
virtual bool | removeConstraint (ConstraintPtr theConstraint)=0 |
Removes constraint from the storage. More... | |
void | removeFeature (FeaturePtr theFeature) |
Removes feature from the storage. More... | |
void | removeAttribute (AttributePtr theAttribute) |
Removes attribute from the storage. More... | |
virtual void | removeInvalidEntities ()=0 |
Remove all features became invalid. More... | |
bool | areFeaturesValid () const |
Check the features have not been removed. More... | |
virtual bool | isEmpty () const |
Check the storage has constraints. More... | |
virtual bool | isNeedToResolve () |
Shows the sketch should be resolved. More... | |
void | setNeedToResolve (bool theFlag) |
Changes the flag of group to be resolved. More... | |
std::set< ObjectPtr > | getConflictingConstraints (SolverPtr theSolver) const |
Return list of conflicting constraints. More... | |
virtual void | getUnderconstrainedGeometry (std::set< ObjectPtr > &theFeatures) const =0 |
Return list of features which are not fully constrained. More... | |
virtual PlaneGCSSolver_Solver::SolveStatus | checkDegeneratedGeometry () const =0 |
Verify, the sketch contains degenerated geometry after resolving the set of constraints. More... | |
virtual void | refresh () const =0 |
Update SketchPlugin features after resolving constraints. More... | |
void | blockEvents (bool isBlocked) |
Block or unblock events when refreshing features. More... | |
void | subscribeUpdates (SketchSolver_Constraint *theSubscriber, const std::string &theGroup) const |
Subscribe for updates of features. More... | |
void | unsubscribeUpdates (SketchSolver_Constraint *theSubscriber) const |
Unsubscribe for updates of features. More... | |
void | notify (const FeaturePtr &theFeature) const |
Notify all subscribers about update of the feature. More... | |
virtual void | adjustParametrizationOfArcs ()=0 |
Make parametrization of arcs consistent. More... | |
Static Protected Member Functions | |
static void | resultToFeatureOrAttribute (const ObjectPtr &theResult, FeaturePtr &theFeature, AttributePtr &theAttribute) |
Convert result to feature or attribute if theResult is linked to center of circle/arc. More... | |
Protected Attributes | |
SolverPtr | mySketchSolver |
Sketch solver, prepared in corresponding group. More... | |
bool | myNeedToResolve |
parameters are changed and group needs to be resolved More... | |
bool | myEventsBlocked |
indicates that features do not send events More... | |
std::map< ConstraintPtr, ConstraintWrapperPtr > | myConstraintMap |
map SketchPlugin constraint to a list of solver's constraints More... | |
std::map< FeaturePtr, EntityWrapperPtr > | myFeatureMap |
map SketchPlugin feature to solver's entity More... | |
std::map< AttributePtr, EntityWrapperPtr > | myAttributeMap |
map attribute to solver's entity More... | |
UpdaterPtr | myUpdaters |
Interface to map SketchPlugin features to the entities of corresponding solver.
|
virtual |
Change mapping between constraint from SketchPlugin and a constraint applicable for corresponding solver.
theConstraint | [in] original SketchPlugin constraint |
theSolverConstraint | [in] solver's constraint |
Reimplemented in PlaneGCSSolver_Storage.
|
pure virtual |
Add a movement constraint which will be destroyed after the next solving of the set of constraints.
theSolverConstraint | [in] solver's constraint |
Implemented in PlaneGCSSolver_Storage.
void SketchSolver_Storage::addEntity | ( | FeaturePtr | theFeature, |
EntityWrapperPtr | theSolverEntity | ||
) |
Change mapping feature from SketchPlugin and the entity applicable for corresponding solver.
theFeature | [in] original SketchPlugin feature |
theSolverEntity | [in] solver's entity, created outside |
void SketchSolver_Storage::addEntity | ( | AttributePtr | theAttribute, |
EntityWrapperPtr | theSolverEntity | ||
) |
Change mapping attribute of a feature and the entity applicable for corresponding solver.
theAttribute | [in] original attribute |
theSolverEntity | [in] solver's entity, created outside |
|
pure virtual |
Convert feature to the form applicable for specific solver and map it.
theFeature | [in] feature to convert |
theForce | [in] forced feature creation |
true
if the feature has been created or updated Implemented in PlaneGCSSolver_Storage.
|
pure virtual |
Convert attribute to the form applicable for specific solver and map it.
theAttribute | [in] attribute to convert |
theForce | [in] forced feature creation |
true
if the attribute has been created or updated Implemented in PlaneGCSSolver_Storage.
const ConstraintWrapperPtr & SketchSolver_Storage::constraint | ( | const ConstraintPtr & | theConstraint | ) | const |
Returns constraint related to corresponding constraint.
const EntityWrapperPtr & SketchSolver_Storage::entity | ( | const FeaturePtr & | theFeature | ) | const |
Returns entity related to corresponding feature.
const EntityWrapperPtr & SketchSolver_Storage::entity | ( | const AttributePtr & | theAttribute | ) | const |
Returns entity related to corresponding attribute.
TODO: Check resultToFeatureOrAttribute() precisely. Create additional unit-test
|
pure virtual |
Make entity external.
Implemented in PlaneGCSSolver_Storage.
|
pure virtual |
Make entity non-external.
Implemented in PlaneGCSSolver_Storage.
|
pure virtual |
Removes constraint from the storage.
true
if the constraint and all its parameters are removed successfully Implemented in PlaneGCSSolver_Storage.
void SketchSolver_Storage::removeFeature | ( | FeaturePtr | theFeature | ) |
Removes feature from the storage.
void SketchSolver_Storage::removeAttribute | ( | AttributePtr | theAttribute | ) |
Removes attribute from the storage.
|
pure virtual |
Remove all features became invalid.
Implemented in PlaneGCSSolver_Storage.
bool SketchSolver_Storage::areFeaturesValid | ( | ) | const |
Check the features have not been removed.
|
inlinevirtual |
Check the storage has constraints.
Reimplemented in PlaneGCSSolver_Storage.
|
inlinevirtual |
Shows the sketch should be resolved.
|
inline |
Changes the flag of group to be resolved.
std::set< ObjectPtr > SketchSolver_Storage::getConflictingConstraints | ( | SolverPtr | theSolver | ) | const |
Return list of conflicting constraints.
|
pure virtual |
Return list of features which are not fully constrained.
Implemented in PlaneGCSSolver_Storage.
|
pure virtual |
Verify, the sketch contains degenerated geometry after resolving the set of constraints.
Implemented in PlaneGCSSolver_Storage.
|
pure virtual |
Update SketchPlugin features after resolving constraints.
Implemented in PlaneGCSSolver_Storage.
void SketchSolver_Storage::blockEvents | ( | bool | isBlocked | ) |
Block or unblock events when refreshing features.
void SketchSolver_Storage::subscribeUpdates | ( | SketchSolver_Constraint * | theSubscriber, |
const std::string & | theGroup | ||
) | const |
Subscribe for updates of features.
theSubscriber | [in] object which wants to revceive notifications |
theGroup | [in] group of updates features to be send |
void SketchSolver_Storage::unsubscribeUpdates | ( | SketchSolver_Constraint * | theSubscriber | ) | const |
Unsubscribe for updates of features.
theSubscriber | [in] object which does not want to revceive notifications anymore |
void SketchSolver_Storage::notify | ( | const FeaturePtr & | theFeature | ) | const |
Notify all subscribers about update of the feature.
|
pure virtual |
Make parametrization of arcs consistent.
Forward arcs should have the last parameter greater than the first parameter. Reversed arcs should have the last parameter lesser than the first parameter.
Implemented in PlaneGCSSolver_Storage.
|
staticprotected |
Convert result to feature or attribute if theResult is linked to center of circle/arc.
|
protected |
Sketch solver, prepared in corresponding group.
|
protected |
parameters are changed and group needs to be resolved
|
protected |
indicates that features do not send events
|
protected |
map SketchPlugin constraint to a list of solver's constraints
|
protected |
map SketchPlugin feature to solver's entity
|
protected |
map attribute to solver's entity