PartDesign/ViewProvider: minor enhancements
This commit is contained in:
parent
e28aaf4592
commit
da1fb99dc5
|
@ -55,7 +55,7 @@ ViewProvider::~ViewProvider()
|
|||
bool ViewProvider::doubleClicked(void)
|
||||
{
|
||||
PartDesign::Body* body = PartDesign::Body::findBodyOf(getObject());
|
||||
|
||||
// TODO May be move to setEdit()? (2015-07-26, Fat-Zer)
|
||||
if (body != NULL) {
|
||||
// Drop into insert mode so that the user doesn't see all the geometry that comes later in the tree
|
||||
// Also, this way the user won't be tempted to use future geometry as external references for the sketch
|
||||
|
@ -113,24 +113,27 @@ bool ViewProvider::setEdit(int ModNum)
|
|||
// always change to PartDesign WB, remember where we come from
|
||||
oldWb = Gui::Command::assureWorkbench("PartDesignWorkbench");
|
||||
|
||||
// start the edit dialog
|
||||
if (featureDlg) {
|
||||
Gui::Control().showDialog(featureDlg);
|
||||
} else {
|
||||
Gui::Control().showDialog(this->getEditDialog());
|
||||
// start the edit dialog if
|
||||
if (!featureDlg) {
|
||||
featureDlg = this->getEditDialog();
|
||||
if (!featureDlg) { // Shouldn't generally happen
|
||||
throw Base::Exception ("Failed to create new edit dialog.");
|
||||
}
|
||||
}
|
||||
|
||||
Gui::Control().showDialog(featureDlg);
|
||||
return true;
|
||||
} else {
|
||||
return PartGui::ViewProviderPart::setEdit(ModNum);
|
||||
}
|
||||
}
|
||||
|
||||
TaskDlgFeatureParameters *ViewProvider::getEditDialog()
|
||||
{
|
||||
|
||||
TaskDlgFeatureParameters *ViewProvider::getEditDialog() {
|
||||
throw Base::Exception("getEditDialog() not implemented");
|
||||
}
|
||||
|
||||
|
||||
void ViewProvider::unsetEdit(int ModNum)
|
||||
{
|
||||
// return to the WB we were in before editing the PartDesign feature
|
||||
|
|
|
@ -53,9 +53,11 @@ protected:
|
|||
|
||||
virtual bool onDelete(const std::vector<std::string> &);
|
||||
|
||||
/// Returns a newly create dialog for the part to be placed in the task view
|
||||
// TODO make it pure virtual when finish implementation for all view providers (2015-07-24, Fat-Zer)
|
||||
virtual TaskDlgFeatureParameters *getEditDialog()/* =0 */;
|
||||
/**
|
||||
* Returns a newly create dialog for the part to be placed in the task view
|
||||
* Must be reimplemented in subclasses.
|
||||
*/
|
||||
virtual TaskDlgFeatureParameters *getEditDialog();
|
||||
|
||||
std::string oldWb;
|
||||
App::DocumentObject* oldTip;
|
||||
|
|
Loading…
Reference in New Issue
Block a user