Sketcher: Add command to switch arc helper

This commit is contained in:
Florian Foinant-Willig
2023-05-31 22:34:03 +02:00
committed by Florian Foinant-Willig
parent 9dce2525f8
commit 014a4e671a
7 changed files with 422 additions and 325 deletions

View File

@@ -414,6 +414,26 @@ bool SketcherGui::isCommandActive(Gui::Document* doc, bool actsOnSelection)
return false;
}
bool SketcherGui::isSketcherBSplineActive(Gui::Document* doc, bool actsOnSelection)
{
if (doc) {
// checks if a Sketch Viewprovider is in Edit and is in no special mode
if (doc->getInEdit()
&& doc->getInEdit()->isDerivedFrom(SketcherGui::ViewProviderSketch::getClassTypeId())) {
if (static_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit())->getSketchMode()
== ViewProviderSketch::STATUS_NONE) {
if (!actsOnSelection)
return true;
else if (Gui::Selection().countObjectsOfType(
Sketcher::SketchObject::getClassTypeId())
> 0)
return true;
}
}
}
return false;
}
SketcherGui::ViewProviderSketch*
SketcherGui::getInactiveHandlerEditModeSketchViewProvider(Gui::Document* doc)
{