PartDesign: Fix pipe preview display
When a base feature was available the preview mode did not show the pipe and also set the visibility of the pipe to false
This commit is contained in:
parent
62f563938b
commit
c5ca99658b
|
@ -90,10 +90,8 @@ TaskPipeParameters::TaskPipeParameters(ViewProviderPipe *PipeView,bool newObj, Q
|
||||||
PartDesign::Pipe* pipe = static_cast<PartDesign::Pipe*>(PipeView->getObject());
|
PartDesign::Pipe* pipe = static_cast<PartDesign::Pipe*>(PipeView->getObject());
|
||||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||||
|
|
||||||
//make sure th euser sees al important things: the base feature to select edges and the
|
//make sure th euser sees al important things: the
|
||||||
//spine/auxillery spine he already selected
|
//spine/auxillery spine he already selected
|
||||||
if(pipe->BaseFeature.getValue())
|
|
||||||
doc->getViewProvider(pipe->BaseFeature.getValue())->show();
|
|
||||||
if(pipe->Spine.getValue()) {
|
if(pipe->Spine.getValue()) {
|
||||||
auto* svp = doc->getViewProvider(pipe->Spine.getValue());
|
auto* svp = doc->getViewProvider(pipe->Spine.getValue());
|
||||||
spineShow = svp->isShow();
|
spineShow = svp->isShow();
|
||||||
|
@ -156,10 +154,8 @@ TaskPipeParameters::~TaskPipeParameters()
|
||||||
PartDesign::Pipe* pipe = static_cast<PartDesign::Pipe*>(vp->getObject());
|
PartDesign::Pipe* pipe = static_cast<PartDesign::Pipe*>(vp->getObject());
|
||||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||||
|
|
||||||
//make sure th euser sees al important things: the base feature to select edges and the
|
//make sure th euser sees al important things: the
|
||||||
//spine/auxillery spine he already selected
|
//spine/auxillery spine he already selected
|
||||||
if(pipe->BaseFeature.getValue())
|
|
||||||
doc->getViewProvider(pipe->BaseFeature.getValue())->hide();
|
|
||||||
if(pipe->Spine.getValue()) {
|
if(pipe->Spine.getValue()) {
|
||||||
auto* svp = doc->getViewProvider(pipe->Spine.getValue());
|
auto* svp = doc->getViewProvider(pipe->Spine.getValue());
|
||||||
svp->setVisible(spineShow);
|
svp->setVisible(spineShow);
|
||||||
|
|
|
@ -76,49 +76,11 @@ bool ViewProviderPipe::doubleClicked(void)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ViewProviderPipe::setEdit(int ModNum)
|
bool ViewProviderPipe::setEdit(int ModNum) {
|
||||||
{
|
if (ModNum == ViewProvider::Default )
|
||||||
if (ModNum == ViewProvider::Default || ModNum == 1 ) {
|
|
||||||
|
|
||||||
setPreviewDisplayMode(true);
|
setPreviewDisplayMode(true);
|
||||||
|
|
||||||
// When double-clicking on the item for this pad the
|
return PartDesignGui::ViewProvider::setEdit(ModNum);
|
||||||
// object unsets and sets its edit mode without closing
|
|
||||||
// the task panel
|
|
||||||
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
|
|
||||||
TaskDlgPipeParameters *padDlg = qobject_cast<TaskDlgPipeParameters *>(dlg);
|
|
||||||
if (padDlg && padDlg->getPipeView() != this)
|
|
||||||
padDlg = 0; // another pad left open its task panel
|
|
||||||
if (dlg && !padDlg) {
|
|
||||||
QMessageBox msgBox;
|
|
||||||
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
|
|
||||||
msgBox.setInformativeText(QObject::tr("Do you want to close this dialog?"));
|
|
||||||
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
|
||||||
msgBox.setDefaultButton(QMessageBox::Yes);
|
|
||||||
int ret = msgBox.exec();
|
|
||||||
if (ret == QMessageBox::Yes)
|
|
||||||
Gui::Control().reject();
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// clear the selection (convenience)
|
|
||||||
Gui::Selection().clearSelection();
|
|
||||||
|
|
||||||
// always change to PartDesign WB, remember where we come from
|
|
||||||
oldWb = Gui::Command::assureWorkbench("PartDesignWorkbench");
|
|
||||||
|
|
||||||
// start the edit dialog
|
|
||||||
if (padDlg)
|
|
||||||
Gui::Control().showDialog(padDlg);
|
|
||||||
else
|
|
||||||
Gui::Control().showDialog(new TaskDlgPipeParameters(this,ModNum == 1));
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return ViewProviderPart::setEdit(ModNum);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewProviderPipe::unsetEdit(int ModNum) {
|
void ViewProviderPipe::unsetEdit(int ModNum) {
|
||||||
|
@ -127,6 +89,10 @@ void ViewProviderPipe::unsetEdit(int ModNum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TaskDlgFeatureParameters* ViewProviderPipe::getEditDialog() {
|
||||||
|
return new TaskDlgPipeParameters(this, false);
|
||||||
|
}
|
||||||
|
|
||||||
bool ViewProviderPipe::onDelete(const std::vector<std::string> &s)
|
bool ViewProviderPipe::onDelete(const std::vector<std::string> &s)
|
||||||
{/*
|
{/*
|
||||||
PartDesign::Pipe* pcPipe = static_cast<PartDesign::Pipe*>(getObject());
|
PartDesign::Pipe* pcPipe = static_cast<PartDesign::Pipe*>(getObject());
|
||||||
|
|
|
@ -47,9 +47,12 @@ public:
|
||||||
void highlightReferences(const bool on, bool auxillery);
|
void highlightReferences(const bool on, bool auxillery);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual QIcon getIcon(void) const;
|
||||||
virtual bool setEdit(int ModNum);
|
virtual bool setEdit(int ModNum);
|
||||||
virtual void unsetEdit(int ModNum);
|
virtual void unsetEdit(int ModNum);
|
||||||
virtual QIcon getIcon(void) const;
|
|
||||||
|
/// Returns a newly created TaskDlgPipeParameters
|
||||||
|
virtual TaskDlgFeatureParameters *getEditDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<App::Color> originalLineColors;
|
std::vector<App::Color> originalLineColors;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user