Miscellaneous fixes

This commit is contained in:
jrheinlaender 2013-05-24 15:15:08 +04:30 committed by Stefan Tröger
parent 04e5d83366
commit 401c4d6dc0
5 changed files with 21 additions and 17 deletions

Binary file not shown.

Binary file not shown.

View File

@ -66,6 +66,7 @@ static PyObject * setActivePart(PyObject *self, PyObject *args)
PartDesignGui::ActiveAppDoc = Item->getDocument(); PartDesignGui::ActiveAppDoc = Item->getDocument();
PartDesignGui::ActiveGuiDoc = Gui::Application::Instance->getDocument(PartDesignGui::ActiveAppDoc); PartDesignGui::ActiveGuiDoc = Gui::Application::Instance->getDocument(PartDesignGui::ActiveAppDoc);
PartDesignGui::ActiveVp = dynamic_cast<Gui::ViewProviderDocumentObject*> (PartDesignGui::ActiveGuiDoc->getViewProvider(Item)); PartDesignGui::ActiveVp = dynamic_cast<Gui::ViewProviderDocumentObject*> (PartDesignGui::ActiveGuiDoc->getViewProvider(Item));
PartDesignGui::ActiveVp->show();
Item->IsActive.setValue(true); Item->IsActive.setValue(true);
} else { } else {
// This handles the case of deactivating the workbench // This handles the case of deactivating the workbench

View File

@ -176,9 +176,13 @@ void CmdPartDesignMoveTip::activated(int iMsg)
if(!pcActiveBody) return; if(!pcActiveBody) return;
std::vector<App::DocumentObject*> features = getSelection().getObjectsOfType(Part::Feature::getClassTypeId()); std::vector<App::DocumentObject*> features = getSelection().getObjectsOfType(Part::Feature::getClassTypeId());
if (features.empty()) return; App::DocumentObject* selFeature;
App::DocumentObject* selFeature = features.front();
if (features.empty()) {
// Insert at the beginning of this body
selFeature = NULL;
} else {
selFeature = features.front();
if (selFeature->getTypeId().isDerivedFrom(PartDesign::Body::getClassTypeId())) { if (selFeature->getTypeId().isDerivedFrom(PartDesign::Body::getClassTypeId())) {
// Insert at the beginning of this body // Insert at the beginning of this body
selFeature = NULL; selFeature = NULL;
@ -191,6 +195,7 @@ void CmdPartDesignMoveTip::activated(int iMsg)
else else
return; return;
} }
}
openCommand("Move insert point to selected feature"); openCommand("Move insert point to selected feature");
App::DocumentObject* oldTip = pcActiveBody->Tip.getValue(); App::DocumentObject* oldTip = pcActiveBody->Tip.getValue();

View File

@ -174,12 +174,10 @@ void ViewProviderBody::updateData(const App::Property* prop)
// PartDesign workbench not active // PartDesign workbench not active
return PartGui::ViewProviderPart::updateData(prop); return PartGui::ViewProviderPart::updateData(prop);
if (prop->getTypeId() == App::PropertyBool::getClassTypeId() && strcmp(prop->getName(),"IsActive") == 0) { if ((prop->getTypeId() == App::PropertyBool::getClassTypeId() && strcmp(prop->getName(),"IsActive") == 0) ||
(prop->getTypeId() == App::PropertyLink::getClassTypeId() && strcmp(prop->getName(),"Tip") == 0) ||
(prop->getTypeId() == App::PropertyLinkList::getClassTypeId() && strcmp(prop->getName(),"Model") == 0))
updateTree(); updateTree();
} else if (prop->getTypeId() == App::PropertyLink::getClassTypeId() && strcmp(prop->getName(),"Tip") == 0) {
updateTree();
}
// Note: The Model property only changes by itself (without the Tip also changing) if a feature is deleted somewhere
// Update the visual size of datum lines and planes // Update the visual size of datum lines and planes
PartDesign::Body* body = static_cast<PartDesign::Body*>(getObject()); PartDesign::Body* body = static_cast<PartDesign::Body*>(getObject());