Skip to content

Commit

Permalink
Automatic visibility handling of axis cross
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jun 16, 2019
1 parent 6259e1e commit e730dd9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Gui/CommandDoc.cpp
Expand Up @@ -417,6 +417,10 @@ void StdCmdNew::activated(int iMsg)
.arg(qApp->translate("StdCmdNew","Unnamed"));
runCommand(Command::Doc,cmd.toUtf8());
doCommand(Command::Gui,"Gui.activeDocument().activeView().viewDefaultOrientation()");

ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
if (hViewGrp->GetBool("ShowAxisCross"))
doCommand(Command::Gui,"Gui.ActiveDocument.ActiveView.setAxisCross(True)");
}

//===========================================================================
Expand Down
9 changes: 8 additions & 1 deletion src/Gui/CommandView.cpp
Expand Up @@ -1925,6 +1925,10 @@ void StdCmdViewCreate::activated(int iMsg)
Q_UNUSED(iMsg);
getActiveGuiDocument()->createView(View3DInventor::getClassTypeId());
getActiveGuiDocument()->getActiveView()->viewAll();

ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
if (hViewGrp->GetBool("ShowAxisCross"))
doCommand(Command::Gui,"Gui.ActiveDocument.ActiveView.setAxisCross(True)");
}

bool StdCmdViewCreate::isActive(void)
Expand Down Expand Up @@ -2087,10 +2091,13 @@ void StdCmdAxisCross::activated(int iMsg)
Q_UNUSED(iMsg);
Gui::View3DInventor* view = qobject_cast<View3DInventor*>(Gui::getMainWindow()->activeWindow());
if (view) {
if(view->getViewer()->hasAxisCross()== false)
if (view->getViewer()->hasAxisCross() == false)
doCommand(Command::Gui,"Gui.ActiveDocument.ActiveView.setAxisCross(True)");
else
doCommand(Command::Gui,"Gui.ActiveDocument.ActiveView.setAxisCross(False)");

ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
hViewGrp->SetBool("ShowAxisCross", view->getViewer()->hasAxisCross());
}
}

Expand Down

0 comments on commit e730dd9

Please sign in to comment.