implement option to change corner of navi cube
This commit is contained in:
@@ -50,20 +50,71 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="CheckBox_NaviCube">
|
||||
<property name="text">
|
||||
<string>Show navigation cube</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>ShowNaviCube</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>View</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="CheckBox_NaviCube">
|
||||
<property name="text">
|
||||
<string>Show navigation cube</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>ShowNaviCube</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>View</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="cornerLabel">
|
||||
<property name="text">
|
||||
<string>Corner</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="naviCubeCorner">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Top left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Top right</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Bottom left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Bottom right</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="CheckBox_useVBO">
|
||||
|
||||
@@ -80,6 +80,9 @@ void DlgSettings3DViewImp::saveSettings()
|
||||
index = this->comboAliasing->currentIndex();
|
||||
hGrp->SetInt("AntiAliasing", index);
|
||||
|
||||
index = this->naviCubeCorner->currentIndex();
|
||||
hGrp->SetInt("CornerNaviCube", index);
|
||||
|
||||
checkBoxZoomAtCursor->onSave();
|
||||
checkBoxInvertZoom->onSave();
|
||||
spinBoxZoomStep->onSave();
|
||||
@@ -129,6 +132,9 @@ void DlgSettings3DViewImp::loadSettings()
|
||||
// connect after setting current item of the combo box
|
||||
connect(comboAliasing, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(onAliasingChanged(int)));
|
||||
|
||||
index = hGrp->GetInt("CornerNaviCube", 1);
|
||||
naviCubeCorner->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
void DlgSettings3DViewImp::on_mouseButton_clicked()
|
||||
|
||||
@@ -290,6 +290,8 @@ bool NaviCube::processSoEvent(const SoEvent* ev) {
|
||||
|
||||
void NaviCube::setCorner(Corner c) {
|
||||
m_NaviCubeImplementation->m_Corner = c;
|
||||
m_NaviCubeImplementation->m_PrevWidth = 0;
|
||||
m_NaviCubeImplementation->m_PrevHeight = 0;
|
||||
}
|
||||
|
||||
NaviCubeImplementation::NaviCubeImplementation(
|
||||
|
||||
@@ -365,6 +365,9 @@ void View3DInventor::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M
|
||||
else if (strcmp(Reason,"ShowNaviCube") == 0) {
|
||||
_viewer->setEnabledNaviCube(rGrp.GetBool("ShowNaviCube",true));
|
||||
}
|
||||
else if (strcmp(Reason,"CornerNaviCube") == 0) {
|
||||
_viewer->setNaviCubeCorner(rGrp.GetInt("CornerNaviCube",0));
|
||||
}
|
||||
else if (strcmp(Reason,"UseVBO") == 0) {
|
||||
_viewer->setEnabledVBO(rGrp.GetBool("UseVBO",false));
|
||||
}
|
||||
|
||||
@@ -849,6 +849,12 @@ bool View3DInventorViewer::isEnabledNaviCube(void) const
|
||||
return naviCubeEnabled;
|
||||
}
|
||||
|
||||
void View3DInventorViewer::setNaviCubeCorner(int c)
|
||||
{
|
||||
if (naviCube)
|
||||
naviCube->setCorner(static_cast<NaviCube::Corner>(c));
|
||||
}
|
||||
|
||||
void View3DInventorViewer::setAxisCross(bool on)
|
||||
{
|
||||
SoNode* scene = getSceneGraph();
|
||||
|
||||
@@ -346,6 +346,7 @@ public:
|
||||
void setEnabledFPSCounter(bool b);
|
||||
void setEnabledNaviCube(bool b);
|
||||
bool isEnabledNaviCube(void) const;
|
||||
void setNaviCubeCorner(int);
|
||||
void setEnabledVBO(bool b);
|
||||
bool isEnabledVBO() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user