Utils refactor w/o commandcreategeo

This commit is contained in:
Abdullah Tahiri
2022-06-27 18:41:33 +02:00
parent 9da0f369b1
commit c6459bb7d3
5 changed files with 79 additions and 105 deletions

View File

@@ -669,7 +669,7 @@ protected:
virtual void applyConstraint(std::vector<SelIdPair> &, int) {}
virtual void activated(int /*iMsg*/);
virtual bool isActive(void)
{ return isCreateGeoActive(getActiveGuiDocument()); }
{ return isCommandActive(getActiveGuiDocument()); }
};
class DrawSketchHandlerGenConstraint: public DrawSketchHandler
@@ -5704,7 +5704,7 @@ void CmdSketcherCompConstrainRadDia::languageChange()
bool CmdSketcherCompConstrainRadDia::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
// ======================================================================================
@@ -7516,7 +7516,7 @@ void CmdSketcherToggleDrivingConstraint::activated(int iMsg)
bool CmdSketcherToggleDrivingConstraint::isActive(void)
{
return isCreateGeoActive( getActiveGuiDocument() );
return isCommandActive( getActiveGuiDocument() );
}
DEF_STD_CMD_A(CmdSketcherToggleActiveConstraint)

View File

@@ -244,7 +244,7 @@ void CmdSketcherCreateLine::updateAction(int mode)
bool CmdSketcherCreateLine::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -553,7 +553,7 @@ void CmdSketcherCreateRectangle::updateAction(int mode)
bool CmdSketcherCreateRectangle::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
DEF_STD_CMD_AU(CmdSketcherCreateRectangleCenter)
@@ -594,7 +594,7 @@ void CmdSketcherCreateRectangleCenter::updateAction(int mode)
bool CmdSketcherCreateRectangleCenter::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -922,7 +922,7 @@ void CmdSketcherCreateOblong::updateAction(int mode)
bool CmdSketcherCreateOblong::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
/* Rectangles Comp command =========================================*/
@@ -1033,7 +1033,7 @@ void CmdSketcherCompCreateRectangles::languageChange()
bool CmdSketcherCompCreateRectangles::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
// ======================================================================================
@@ -1722,7 +1722,7 @@ void CmdSketcherCreatePolyline::updateAction(int mode)
bool CmdSketcherCreatePolyline::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -1953,7 +1953,7 @@ void CmdSketcherCreateArc::activated(int iMsg)
bool CmdSketcherCreateArc::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -2225,7 +2225,7 @@ void CmdSketcherCreate3PointArc::activated(int iMsg)
bool CmdSketcherCreate3PointArc::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -2325,7 +2325,7 @@ void CmdSketcherCompCreateArc::languageChange()
bool CmdSketcherCompCreateArc::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -2489,7 +2489,7 @@ void CmdSketcherCreateCircle::activated(int iMsg)
bool CmdSketcherCreateCircle::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
// ======================================================================================
@@ -3286,7 +3286,7 @@ void CmdSketcherCreateEllipseByCenter::activated(int iMsg)
bool CmdSketcherCreateEllipseByCenter::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
/// @brief Macro that declares a new sketcher command class 'CmdSketcherCreateEllipseBy3Points'
@@ -3317,7 +3317,7 @@ void CmdSketcherCreateEllipseBy3Points::activated(int iMsg)
bool CmdSketcherCreateEllipseBy3Points::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
class DrawSketchHandlerArcOfEllipse : public DrawSketchHandler
@@ -3647,7 +3647,7 @@ void CmdSketcherCreateArcOfEllipse::activated(int iMsg)
bool CmdSketcherCreateArcOfEllipse::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
class DrawSketchHandlerArcOfHyperbola : public DrawSketchHandler
@@ -3992,7 +3992,7 @@ void CmdSketcherCreateArcOfHyperbola::activated(int /*iMsg*/)
bool CmdSketcherCreateArcOfHyperbola::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
class DrawSketchHandlerArcOfParabola : public DrawSketchHandler
@@ -4292,7 +4292,7 @@ void CmdSketcherCreateArcOfParabola::activated(int /*iMsg*/)
bool CmdSketcherCreateArcOfParabola::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -4438,7 +4438,7 @@ void CmdSketcherCompCreateConic::languageChange()
bool CmdSketcherCompCreateConic::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
// ======================================================================================
@@ -4950,7 +4950,7 @@ void CmdSketcherCreateBSpline::activated(int iMsg)
bool CmdSketcherCreateBSpline::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
/// @brief Macro that declares a new sketcher command class 'CmdSketcherCreateBSpline'
@@ -4981,7 +4981,7 @@ void CmdSketcherCreatePeriodicBSpline::activated(int iMsg)
bool CmdSketcherCreatePeriodicBSpline::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -5092,7 +5092,7 @@ void CmdSketcherCompCreateBSpline::languageChange()
bool CmdSketcherCompCreateBSpline::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -5298,7 +5298,7 @@ void CmdSketcherCreate3PointCircle::activated(int iMsg)
bool CmdSketcherCreate3PointCircle::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -5398,7 +5398,7 @@ void CmdSketcherCompCreateCircle::languageChange()
bool CmdSketcherCompCreateCircle::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -5507,7 +5507,7 @@ void CmdSketcherCreatePoint::activated(int iMsg)
bool CmdSketcherCreatePoint::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
// ======================================================================================
@@ -5790,7 +5790,7 @@ void CmdSketcherCreateFillet::activated(int iMsg)
bool CmdSketcherCreateFillet::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
// ======================================================================================
@@ -5819,7 +5819,7 @@ void CmdSketcherCreatePointFillet::activated(int iMsg)
bool CmdSketcherCreatePointFillet::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
/// @brief Macro that declares a new sketcher command class 'CmdSketcherCompCreateFillets'
@@ -5920,7 +5920,7 @@ void CmdSketcherCompCreateFillets::languageChange()
bool CmdSketcherCompCreateFillets::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
// ======================================================================================
@@ -6082,7 +6082,7 @@ void CmdSketcherTrimming::activated(int iMsg)
bool CmdSketcherTrimming::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -6397,7 +6397,7 @@ void CmdSketcherExtend::activated(int iMsg)
bool CmdSketcherExtend::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -6517,7 +6517,7 @@ void CmdSketcherSplit::activated(int iMsg)
bool CmdSketcherSplit::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -6703,7 +6703,7 @@ void CmdSketcherExternal::activated(int iMsg)
bool CmdSketcherExternal::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
// ======================================================================================
@@ -6881,7 +6881,7 @@ void CmdSketcherCarbonCopy::activated(int iMsg)
bool CmdSketcherCarbonCopy::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
void CmdSketcherCarbonCopy::updateAction(int mode)
@@ -7207,7 +7207,7 @@ void CmdSketcherCreateSlot::updateAction(int mode)
bool CmdSketcherCreateSlot::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
/* Create Regular Polygon ==============================================*/
@@ -7387,7 +7387,7 @@ void CmdSketcherCreateTriangle::activated(int iMsg)
bool CmdSketcherCreateTriangle::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
DEF_STD_CMD_A(CmdSketcherCreateSquare)
@@ -7414,7 +7414,7 @@ void CmdSketcherCreateSquare::activated(int iMsg)
bool CmdSketcherCreateSquare::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
DEF_STD_CMD_A(CmdSketcherCreatePentagon)
@@ -7441,7 +7441,7 @@ void CmdSketcherCreatePentagon::activated(int iMsg)
bool CmdSketcherCreatePentagon::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
@@ -7469,7 +7469,7 @@ void CmdSketcherCreateHexagon::activated(int iMsg)
bool CmdSketcherCreateHexagon::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
DEF_STD_CMD_A(CmdSketcherCreateHeptagon)
@@ -7496,7 +7496,7 @@ void CmdSketcherCreateHeptagon::activated(int iMsg)
bool CmdSketcherCreateHeptagon::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
DEF_STD_CMD_A(CmdSketcherCreateOctagon)
@@ -7523,7 +7523,7 @@ void CmdSketcherCreateOctagon::activated(int iMsg)
bool CmdSketcherCreateOctagon::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
DEF_STD_CMD_A(CmdSketcherCreateRegularPolygon)
@@ -7554,7 +7554,7 @@ void CmdSketcherCreateRegularPolygon::activated(int iMsg)
bool CmdSketcherCreateRegularPolygon::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
DEF_STD_CMD_ACLU(CmdSketcherCompCreateRegularPolygon)
@@ -7712,7 +7712,7 @@ void CmdSketcherCompCreateRegularPolygon::languageChange()
bool CmdSketcherCompCreateRegularPolygon::isActive(void)
{
return isCreateGeoActive(getActiveGuiDocument());
return isCommandActive(getActiveGuiDocument());
}
void CreateSketcherCommandsCreateGeo(void)

View File

@@ -61,38 +61,6 @@ using namespace std;
using namespace SketcherGui;
using namespace Sketcher;
bool isSketcherAcceleratorActive(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())) {
auto mode = static_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit())
->getSketchMode();
if (mode == ViewProviderSketch::STATUS_NONE ||
mode == ViewProviderSketch::STATUS_SKETCH_UseHandler) {
if (!actsOnSelection)
return true;
else if (Gui::Selection().countObjectsOfType(Sketcher::SketchObject::getClassTypeId()) > 0)
return true;
}
}
}
return false;
}
void ActivateAcceleratorHandler(Gui::Document *doc, DrawSketchHandler *handler)
{
std::unique_ptr<DrawSketchHandler> ptr(handler);
if (doc) {
if (doc->getInEdit() && doc->getInEdit()->isDerivedFrom(SketcherGui::ViewProviderSketch::getClassTypeId())) {
SketcherGui::ViewProviderSketch* vp = static_cast<SketcherGui::ViewProviderSketch*> (doc->getInEdit());
vp->purgeHandler();
vp->activateHandler(ptr.release());
}
}
}
// ================================================================================
// Close Shape Command
@@ -202,7 +170,7 @@ void CmdSketcherCloseShape::activated(int iMsg)
bool CmdSketcherCloseShape::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), true);
return isCommandActive(getActiveGuiDocument(), true);
}
// ================================================================================
@@ -289,7 +257,7 @@ void CmdSketcherConnect::activated(int iMsg)
bool CmdSketcherConnect::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), true);
return isCommandActive(getActiveGuiDocument(), true);
}
// ================================================================================
@@ -366,7 +334,7 @@ void CmdSketcherSelectConstraints::activated(int iMsg)
bool CmdSketcherSelectConstraints::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), true);
return isCommandActive(getActiveGuiDocument(), true);
}
// ================================================================================
@@ -412,7 +380,7 @@ void CmdSketcherSelectOrigin::activated(int iMsg)
bool CmdSketcherSelectOrigin::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), false);
return isCommandActive(getActiveGuiDocument(), false);
}
// ================================================================================
@@ -456,7 +424,7 @@ void CmdSketcherSelectVerticalAxis::activated(int iMsg)
bool CmdSketcherSelectVerticalAxis::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), false);
return isCommandActive(getActiveGuiDocument(), false);
}
// ================================================================================
@@ -500,7 +468,7 @@ void CmdSketcherSelectHorizontalAxis::activated(int iMsg)
bool CmdSketcherSelectHorizontalAxis::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), false);
return isCommandActive(getActiveGuiDocument(), false);
}
// ================================================================================
@@ -557,7 +525,7 @@ void CmdSketcherSelectRedundantConstraints::activated(int iMsg)
bool CmdSketcherSelectRedundantConstraints::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), false);
return isCommandActive(getActiveGuiDocument(), false);
}
// ================================================================================
@@ -613,7 +581,7 @@ void CmdSketcherSelectMalformedConstraints::activated(int iMsg)
bool CmdSketcherSelectMalformedConstraints::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), false);
return isCommandActive(getActiveGuiDocument(), false);
}
// ================================================================================
@@ -669,7 +637,7 @@ void CmdSketcherSelectPartiallyRedundantConstraints::activated(int iMsg)
bool CmdSketcherSelectPartiallyRedundantConstraints::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), false);
return isCommandActive(getActiveGuiDocument(), false);
}
// ================================================================================
@@ -724,7 +692,7 @@ void CmdSketcherSelectConflictingConstraints::activated(int iMsg)
bool CmdSketcherSelectConflictingConstraints::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), false);
return isCommandActive(getActiveGuiDocument(), false);
}
// ================================================================================
@@ -845,7 +813,7 @@ void CmdSketcherSelectElementsAssociatedWithConstraints::activated(int iMsg)
bool CmdSketcherSelectElementsAssociatedWithConstraints::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), true);
return isCommandActive(getActiveGuiDocument(), true);
}
// ================================================================================
@@ -936,7 +904,7 @@ void CmdSketcherSelectElementsWithDoFs::activated(int iMsg)
bool CmdSketcherSelectElementsWithDoFs::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), false);
return isCommandActive(getActiveGuiDocument(), false);
}
// ================================================================================
@@ -1049,7 +1017,7 @@ void CmdSketcherRestoreInternalAlignmentGeometry::activated(int iMsg)
bool CmdSketcherRestoreInternalAlignmentGeometry::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), true);
return isCommandActive(getActiveGuiDocument(), true);
}
// ================================================================================
@@ -1251,7 +1219,7 @@ void CmdSketcherSymmetry::activated(int iMsg)
bool CmdSketcherSymmetry::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), true);
return isCommandActive(getActiveGuiDocument(), true);
}
// ================================================================================
@@ -1573,7 +1541,7 @@ void SketcherCopy::activate(SketcherCopy::Op op)
}
*/
ActivateAcceleratorHandler(getActiveGuiDocument(),
ActivateHandler(getActiveGuiDocument(),
new DrawSketchHandlerCopy(geoIdList, LastGeoId, LastPointPos, geoids, op));
}
@@ -1619,7 +1587,7 @@ void CmdSketcherCopy::activate()
bool CmdSketcherCopy::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), true);
return isCommandActive(getActiveGuiDocument(), true);
}
// ================================================================================
@@ -1664,7 +1632,7 @@ void CmdSketcherClone::activate()
bool CmdSketcherClone::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), true);
return isCommandActive(getActiveGuiDocument(), true);
}
class CmdSketcherMove : public SketcherCopy
@@ -1707,7 +1675,7 @@ void CmdSketcherMove::activate()
bool CmdSketcherMove::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), true);
return isCommandActive(getActiveGuiDocument(), true);
}
// ================================================================================
@@ -1807,7 +1775,7 @@ void CmdSketcherCompCopy::languageChange()
bool CmdSketcherCompCopy::isActive(void)
{
return isSketcherAcceleratorActive( getActiveGuiDocument(), true );
return isCommandActive( getActiveGuiDocument(), true );
}
// ================================================================================
@@ -2120,7 +2088,7 @@ void CmdSketcherRectangularArray::activated(int iMsg)
SketchRectangularArrayDialog slad;
if (slad.exec() == QDialog::Accepted) {
ActivateAcceleratorHandler(getActiveGuiDocument(),
ActivateHandler(getActiveGuiDocument(),
new DrawSketchHandlerRectangularArray(geoIdList, LastGeoId, LastPointPos, geoids, slad.Clone,
slad.Rows, slad.Cols, slad.ConstraintSeparation,
slad.EqualVerticalHorizontalSpacing));
@@ -2129,7 +2097,7 @@ void CmdSketcherRectangularArray::activated(int iMsg)
bool CmdSketcherRectangularArray::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), true);
return isCommandActive(getActiveGuiDocument(), true);
}
// ================================================================================
@@ -2192,7 +2160,7 @@ void CmdSketcherDeleteAllGeometry::activated(int iMsg)
bool CmdSketcherDeleteAllGeometry::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), false);
return isCommandActive(getActiveGuiDocument(), false);
}
// ================================================================================
@@ -2255,7 +2223,7 @@ void CmdSketcherDeleteAllConstraints::activated(int iMsg)
bool CmdSketcherDeleteAllConstraints::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), false);
return isCommandActive(getActiveGuiDocument(), false);
}
// ================================================================================
@@ -2373,7 +2341,7 @@ void CmdSketcherRemoveAxesAlignment::activated(int iMsg)
bool CmdSketcherRemoveAxesAlignment::isActive(void)
{
return isSketcherAcceleratorActive(getActiveGuiDocument(), true);
return isCommandActive(getActiveGuiDocument(), true);
}
void CreateSketcherCommandsConstraintAccel(void)

View File

@@ -302,17 +302,23 @@ void SketcherGui::ActivateHandler(Gui::Document *doc, DrawSketchHandler *handler
}
}
bool SketcherGui::isCreateGeoActive(Gui::Document *doc)
bool SketcherGui::isCommandActive(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 (dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit())->
getSketchMode() == ViewProviderSketch::STATUS_NONE)*/
return true;
if (doc->getInEdit() && doc->getInEdit()->isDerivedFrom(SketcherGui::ViewProviderSketch::getClassTypeId())) {
auto mode = static_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit())
->getSketchMode();
if (mode == ViewProviderSketch::STATUS_NONE ||
mode == ViewProviderSketch::STATUS_SKETCH_UseHandler) {
if (!actsOnSelection)
return true;
else if (Gui::Selection().countObjectsOfType(Sketcher::SketchObject::getClassTypeId()) > 0)
return true;
}
}
}
return false;
}

View File

@@ -112,7 +112,7 @@ double GetPointAngle (const Base::Vector2d &p1, const Base::Vector2d &p2);
void ActivateHandler(Gui::Document *doc, DrawSketchHandler *handler);
bool isCreateGeoActive(Gui::Document *doc);
bool isCommandActive(Gui::Document *doc, bool actsOnSelection = false);
SketcherGui::ViewProviderSketch* getSketchViewprovider(Gui::Document *doc);