DrawSketchHandler: activation and deactivation via NVI pattern
============================================================== With the introduction of overridable default behaviour for commands, it makes sense to keep control of the execution path of the activation and deactivation. Non-virtual interface pattern enforces execution control of the virtual functions, while allowing the behaviour to be overriden in a case by case basis.
This commit is contained in:
@@ -121,14 +121,25 @@ DrawSketchHandler::DrawSketchHandler() : sketchgui(0) {}
|
||||
|
||||
DrawSketchHandler::~DrawSketchHandler() {}
|
||||
|
||||
void DrawSketchHandler::preActivated(ViewProviderSketch* vp)
|
||||
void DrawSketchHandler::activate(ViewProviderSketch * vp)
|
||||
{
|
||||
ViewProviderSketchDrawSketchHandlerAttorney::setConstraintSelectability(*vp, false);
|
||||
sketchgui = vp;
|
||||
|
||||
this->preActivated();
|
||||
this->activated();
|
||||
}
|
||||
|
||||
void DrawSketchHandler::postDeactivatedAlwaysRun(ViewProviderSketch* vp)
|
||||
void DrawSketchHandler::deactivate()
|
||||
{
|
||||
ViewProviderSketchDrawSketchHandlerAttorney::setConstraintSelectability(*vp, true);
|
||||
this->deactivated();
|
||||
this->postDeactivated();
|
||||
ViewProviderSketchDrawSketchHandlerAttorney::setConstraintSelectability(*sketchgui, true);
|
||||
unsetCursor();
|
||||
}
|
||||
|
||||
void DrawSketchHandler::preActivated()
|
||||
{
|
||||
ViewProviderSketchDrawSketchHandlerAttorney::setConstraintSelectability(*sketchgui, false);
|
||||
}
|
||||
|
||||
void DrawSketchHandler::quit(void)
|
||||
|
||||
Reference in New Issue
Block a user