PartDesign changes
* Mostly for supporting in-place editing * Add new SubShapeBinder that support cross coordinate system, external, and sub-object binding
This commit is contained in:
@@ -283,27 +283,28 @@ bool ViewProviderDatum::setEdit(int ModNum)
|
||||
|
||||
bool ViewProviderDatum::doubleClicked(void)
|
||||
{
|
||||
auto activeDoc = Gui::Application::Instance->activeDocument();
|
||||
if(!activeDoc)
|
||||
activeDoc = getDocument();
|
||||
auto activeView = activeDoc->getActiveView();
|
||||
if(!activeView) return false;
|
||||
|
||||
std::string Msg("Edit ");
|
||||
Msg += this->pcObject->Label.getValue();
|
||||
Gui::Command::openCommand(Msg.c_str());
|
||||
|
||||
Part::Datum* pcDatum = static_cast<Part::Datum*>(getObject());
|
||||
PartDesign::Body* activeBody = getActiveView()->getActiveObject<PartDesign::Body*>(PDBODYKEY);
|
||||
PartDesign::Body* activeBody = activeView->getActiveObject<PartDesign::Body*>(PDBODYKEY);
|
||||
auto datumBody = PartDesignGui::getBodyFor(pcDatum, false);
|
||||
|
||||
if (datumBody != NULL) {
|
||||
if (datumBody != activeBody) {
|
||||
Gui::Command::doCommand(Gui::Command::Gui,
|
||||
"Gui.activateView('Gui::View3DInventor', True)\n"
|
||||
"Gui.getDocument('%s').ActiveView.setActiveObject('%s', App.getDocument('%s').getObject('%s'))",
|
||||
datumBody->getDocument()->getName(),
|
||||
PDBODYKEY,
|
||||
datumBody->getDocument()->getName(),
|
||||
datumBody->getNameInDocument());
|
||||
_FCMD_OBJ_DOC_CMD(Gui,datumBody,"ActiveView.setActiveObject('" << PDBODYKEY << "', "
|
||||
<< Gui::Command::getObjectCmd(datumBody) << ")");
|
||||
activeBody = datumBody;
|
||||
}
|
||||
}
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().setEdit('%s',0)",this->pcObject->getNameInDocument());
|
||||
return true;
|
||||
return PartDesignGui::setEdit(pcObject,activeBody);
|
||||
}
|
||||
|
||||
void ViewProviderDatum::unsetEdit(int ModNum)
|
||||
|
||||
Reference in New Issue
Block a user