void TaskPocketParameters::onButtonFace(const bool pressed) { PartDesign::Pocket* pcPocket = static_cast<PartDesign::Pocket*>(PocketView->getObject()); Part::Feature* support = pcPocket->getSupport(); if (support == NULL) { // There is no support, so we can't select from it... return; } if (pressed) { Gui::Document* doc = Gui::Application::Instance->activeDocument(); if (doc) { doc->setHide(PocketView->getObject()->getNameInDocument()); doc->setShow(support->getNameInDocument()); } Gui::Selection().clearSelection(); Gui::Selection().addSelectionGate (new ReferenceSelection(support, false, true, false)); } else { Gui::Selection().rmvSelectionGate(); Gui::Document* doc = Gui::Application::Instance->activeDocument(); if (doc) { doc->setShow(PocketView->getObject()->getNameInDocument()); doc->setHide(support->getNameInDocument()); } } // Update button if onButtonFace() is called explicitly ui->buttonFace->setChecked(pressed); }
void TaskSketchBasedParameters::onSelectReference(const bool pressed, const bool edge, const bool face, const bool planar) { // Note: Even if there is no solid, App::Plane and Part::Datum can still be selected PartDesign::ProfileBased* pcSketchBased = static_cast<PartDesign::ProfileBased*>(vp->getObject()); // The solid this feature will be fused to App::DocumentObject* prevSolid = pcSketchBased->getBaseObject( /* silent =*/ true ); if (pressed) { Gui::Document* doc = Gui::Application::Instance->activeDocument(); if (doc) { if (pcSketchBased) doc->setHide(pcSketchBased->getNameInDocument()); if (prevSolid) doc->setShow(prevSolid->getNameInDocument()); } Gui::Selection().clearSelection(); Gui::Selection().addSelectionGate (new ReferenceSelection(prevSolid, edge, face, planar)); } else { Gui::Selection().rmvSelectionGate(); Gui::Document* doc = Gui::Application::Instance->activeDocument(); if (doc) { if (pcSketchBased) doc->setShow(pcSketchBased->getNameInDocument()); if (prevSolid) doc->setHide(prevSolid->getNameInDocument()); } } }
void TaskTransformedParameters::showObject() { Gui::Document* doc = Gui::Application::Instance->activeDocument(); if (doc) if (insideMultiTransform) { doc->setShow(parentTask->TransformedView->getObject()->getNameInDocument()); } else { doc->setShow(TransformedView->getObject()->getNameInDocument()); } }
void TaskTransformedParameters::showObject() { Gui::Document* doc = Gui::Application::Instance->activeDocument(); if (doc) { doc->setShow(getTopTransformedObject()->getNameInDocument()); } }
void TaskDressUpParameters::showObject() { Gui::Document* doc = Gui::Application::Instance->activeDocument(); App::DocumentObject* base = getBase(); if (doc != NULL && base != NULL) { doc->setShow(DressUpView->getObject()->getNameInDocument()); doc->setHide(base->getNameInDocument()); } }
void TaskTransformedParameters::showOriginals() { Gui::Document* doc = Gui::Application::Instance->activeDocument(); if (doc) { std::vector<App::DocumentObject*> originals = getOriginals(); for (std::vector<App::DocumentObject*>::iterator it = originals.begin(); it != originals.end(); ++it) doc->setShow((*it)->getNameInDocument()); } }
void TaskTransformedParameters::showBase() { Gui::Document* doc = Gui::Application::Instance->activeDocument(); if (doc) { try { doc->setShow(getBaseObject()->getNameInDocument()); } catch (const Base::Exception &) { } } }