Improve Axis Cross behavior and expose parameter to 3D View preferences

This commit is contained in:
Adrian
2020-05-15 14:27:17 -04:00
committed by wwmayer
parent 8944a9cfbe
commit 1f63355c06
6 changed files with 29 additions and 9 deletions

View File

@@ -308,6 +308,7 @@ p, li { white-space: pre-wrap; }
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">People</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Abdullah Tahiriyo</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Adrián Insaurralde</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Ajinkya Dahale</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Alexander Golubev (fat-zer)</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Alexander Gryson</p>

View File

@@ -1908,10 +1908,6 @@ 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)
@@ -2067,6 +2063,7 @@ StdCmdAxisCross::StdCmdAxisCross()
sToolTipText = QT_TR_NOOP("Toggle axis cross");
sStatusTip = QT_TR_NOOP("Toggle axis cross");
sWhatsThis = "Std_AxisCross";
sAccel = "A,C";
}
void StdCmdAxisCross::activated(int iMsg)
@@ -2078,9 +2075,6 @@ void StdCmdAxisCross::activated(int iMsg)
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());
}
}

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>477</width>
<height>407</height>
<width>499</width>
<height>520</height>
</rect>
</property>
<property name="windowTitle">
@@ -43,6 +43,22 @@ lower right corner within opened files</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="CheckBox_ShowAxisCross">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Axis cross will be shown by default at file&lt;/p&gt;&lt;p&gt;open or creation.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Show axis cross by default</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowAxisCross</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="CheckBox_ShowFPS">
<property name="toolTip">

View File

@@ -89,6 +89,7 @@ void DlgSettings3DViewImp::saveSettings()
hGrp->SetInt("MarkerSize", vBoxMarkerSize.toInt());
ui->CheckBox_CornerCoordSystem->onSave();
ui->CheckBox_ShowAxisCross->onSave();
ui->CheckBox_WbByTab->onSave();
ui->CheckBox_ShowFPS->onSave();
ui->CheckBox_useVBO->onSave();
@@ -103,6 +104,7 @@ void DlgSettings3DViewImp::saveSettings()
void DlgSettings3DViewImp::loadSettings()
{
ui->CheckBox_CornerCoordSystem->onRestore();
ui->CheckBox_ShowAxisCross->onRestore();
ui->CheckBox_WbByTab->onRestore();
ui->CheckBox_ShowFPS->onRestore();
ui->CheckBox_useVBO->onRestore();

View File

@@ -1648,6 +1648,10 @@ MDIView *Document::createView(const Base::Type& typeId)
const char *ppReturn = 0;
view3D->onMsg(cameraSettings.c_str(),&ppReturn);
}
ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
if (hViewGrp->GetBool("ShowAxisCross",false)){
view3D->getViewer()->setAxisCross(true);
}
getMainWindow()->addWindow(view3D);
return view3D;
}
@@ -1666,6 +1670,8 @@ Gui::MDIView* Document::cloneView(Gui::MDIView* oldview)
std::string overrideMode = firstView->getViewer()->getOverrideMode();
view3D->getViewer()->setOverrideMode(overrideMode);
view3D->getViewer()->setAxisCross(firstView->getViewer()->hasAxisCross());
// attach the viewproviders. we need to make sure that we only attach the toplevel ones
// and not viewproviders which are claimed by other providers. To ensure this we first
// add all providers and then remove the ones already claimed

View File

@@ -124,6 +124,7 @@ class PivyTestCases(unittest.TestCase):
from pivy import coin; import FreeCADGui
Mesh.show(planarMeshObject)
view=FreeCADGui.ActiveDocument.ActiveView
view.setAxisCross(False)
pc=coin.SoGetPrimitiveCountAction()
pc.apply(view.getSceneGraph())
self.failUnless(pc.getTriangleCount() == 2)