void CmdSketcherViewSketch::activated(int iMsg) { Gui::Document *doc = getActiveGuiDocument(); SketcherGui::ViewProviderSketch* vp = dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit()); doCommand(Gui,"Gui.ActiveDocument.ActiveView.setCameraOrientation(App.ActiveDocument.%s.Placement.Rotation.Q)" ,vp->getObject()->getNameInDocument()); }
bool CmdSketcherViewSketch::isActive(void) { Gui::Document *doc = getActiveGuiDocument(); if (doc) { // checks if a Sketch Viewprovider is in Edit and is in no special mode SketcherGui::ViewProviderSketch* vp = dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit()); if (vp && vp->getSketchMode() == ViewProviderSketch::STATUS_NONE) return true; } return false; }
void CmdSketcherLeaveSketch::activated(int iMsg) { Gui::Document *doc = getActiveGuiDocument(); if (doc) { // checks if a Sketch Viewprovider is in Edit and is in no special mode SketcherGui::ViewProviderSketch* vp = dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit()); if (vp && vp->getSketchMode() != ViewProviderSketch::STATUS_NONE) vp->purgeHandler(); } openCommand("Sketch changed"); doCommand(Gui,"Gui.activeDocument().resetEdit()"); doCommand(Doc,"App.ActiveDocument.recompute()"); commitCommand(); }