diff --git a/src/Mod/CAM/Gui/Resources/Path.qrc b/src/Mod/CAM/Gui/Resources/Path.qrc
index 964f76bf09..4d58605f38 100644
--- a/src/Mod/CAM/Gui/Resources/Path.qrc
+++ b/src/Mod/CAM/Gui/Resources/Path.qrc
@@ -144,6 +144,7 @@
gl_simulator/Path.png
gl_simulator/View.png
gl_simulator/AmbientOclusion.png
+ gl_simulator/Home.png
preferences/Advanced.ui
preferences/PathDressupHoldingTags.ui
preferences/PathJob.ui
diff --git a/src/Mod/CAM/Gui/Resources/gl_simulator/Home.png b/src/Mod/CAM/Gui/Resources/gl_simulator/Home.png
new file mode 100644
index 0000000000..20f187dbf6
Binary files /dev/null and b/src/Mod/CAM/Gui/Resources/gl_simulator/Home.png differ
diff --git a/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp b/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp
index e92c8fd2f9..036ce11e23 100644
--- a/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp
+++ b/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp
@@ -32,23 +32,24 @@
using namespace MillSim;
GuiItem guiItems[] = {
- {eGuiItemSlider, 0, 0, 40, -80, 0},
+ {eGuiItemSlider, 0, 0, 28, -80, 0},
{eGuiItemThumb, 0, 0, 328, -94, 1},
- {eGuiItemPause, 0, 0, 40, -50, 'P', true},
- {eGuiItemPlay, 0, 0, 40, -50, 'S', false},
- {eGuiItemSingleStep, 0, 0, 80, -50, 'T'},
- {eGuiItemSlower, 0, 0, 125, -50, ' '},
- {eGuiItemFaster, 0, 0, 170, -50, 'F'},
- {eGuiItemX, 0, 0, 220, -45, 0, false, 0},
- {eGuiItem1, 0, 0, 242, -50, 0, false, 0},
- {eGuiItem5, 0, 0, 242, -50, 0, true, 0},
- {eGuiItem10, 0, 0, 242, -50, 0, true, 0},
- {eGuiItem25, 0, 0, 242, -50, 0, true, 0},
- {eGuiItem50, 0, 0, 242, -50, 0, true, 0},
+ {eGuiItemPause, 0, 0, 28, -50, 'P', true},
+ {eGuiItemPlay, 0, 0, 28, -50, 'S', false},
+ {eGuiItemSingleStep, 0, 0, 68, -50, 'T'},
+ {eGuiItemSlower, 0, 0, 113, -50, ' '},
+ {eGuiItemFaster, 0, 0, 158, -50, 'F'},
+ {eGuiItemX, 0, 0, 208, -45, 0, false, 0},
+ {eGuiItem1, 0, 0, 230, -50, 0, false, 0},
+ {eGuiItem5, 0, 0, 230, -50, 0, true, 0},
+ {eGuiItem10, 0, 0, 230, -50, 0, true, 0},
+ {eGuiItem25, 0, 0, 230, -50, 0, true, 0},
+ {eGuiItem50, 0, 0, 230, -50, 0, true, 0},
{eGuiItemRotate, 0, 0, -140, -50, ' ', false, GUIITEM_CHECKABLE},
{eGuiItemPath, 0, 0, -100, -50, 'L', false, GUIITEM_CHECKABLE},
{eGuiItemAmbientOclusion, 0, 0, -60, -50, 'A', false, GUIITEM_CHECKABLE},
{eGuiItemView, 0, 0, -180, -50, 'V', false},
+ {eGuiItemHome, 0, 0, -220, -50, 'H'},
};
#define NUM_GUI_ITEMS (sizeof(guiItems) / sizeof(GuiItem))
@@ -70,7 +71,8 @@ std::vector guiFileNames = {"Slider.png",
"Rotate.png",
"Path.png",
"AmbientOclusion.png",
- "View.png"};
+ "View.png",
+ "Home.png"};
void GuiDisplay::UpdateProjection()
{
diff --git a/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.h b/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.h
index 19e54579a2..bb14528604 100644
--- a/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.h
+++ b/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.h
@@ -52,7 +52,8 @@ enum eGuiItems
eGuiItemPath,
eGuiItemAmbientOclusion,
eGuiItemView,
- eGuiItemMax
+ eGuiItemMax,
+ eGuiItemHome
};
struct GuiItem
diff --git a/src/Mod/CAM/PathSimulator/AppGL/MillSimulation.cpp b/src/Mod/CAM/PathSimulator/AppGL/MillSimulation.cpp
index 74a3a8e4d8..8794065d50 100644
--- a/src/Mod/CAM/PathSimulator/AppGL/MillSimulation.cpp
+++ b/src/Mod/CAM/PathSimulator/AppGL/MillSimulation.cpp
@@ -516,6 +516,10 @@ void MillSimulation::HandleGuiAction(eGuiItems actionItem, bool checked)
simDisplay.updateDisplay = true;
break;
+ case eGuiItemHome:
+ simDisplay.MoveEyeCenter();
+ break;
+
default:
break;
}
diff --git a/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.cpp b/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.cpp
index 72af76b8dc..145ea6a6e7 100644
--- a/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.cpp
+++ b/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.cpp
@@ -532,6 +532,15 @@ void SimDisplay::MoveEye(float x, float z)
updateDisplay = true;
}
+void SimDisplay::MoveEyeCenter()
+{
+ mEyeRoration = 0;
+ mEyeInclination = PI / 6;
+ mEyeX = 0;
+ mEyeZ = 0;
+ UpdateEyeFactor(0.1f);
+}
+
void SimDisplay::UpdateEyeFactor(float factor)
{
if (mEyeDistFactor == factor) {
diff --git a/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.h b/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.h
index 079918225e..3213337d1a 100644
--- a/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.h
+++ b/src/Mod/CAM/PathSimulator/AppGL/SimDisplay.h
@@ -60,6 +60,7 @@ public:
void TiltEye(float tiltStep);
void RotateEye(float rotStep);
void MoveEye(float x, float z);
+ void MoveEyeCenter();
void UpdateEyeFactor(float factor);
void UpdateWindowScale();
diff --git a/src/Mod/CAM/PathSimulator/AppGL/TextureLoader.cpp b/src/Mod/CAM/PathSimulator/AppGL/TextureLoader.cpp
index 46f1f9595b..03f2f080c7 100644
--- a/src/Mod/CAM/PathSimulator/AppGL/TextureLoader.cpp
+++ b/src/Mod/CAM/PathSimulator/AppGL/TextureLoader.cpp
@@ -42,6 +42,7 @@ TextureItem texItems[] = {
{95, 50, 0, 0},
{130, 50, 0, 0},
{170, 50, 0, 0},
+ {210, 50, 0, 0},
};