fix incorrect terminology in NaviCube, add support of isometric view

This commit is contained in:
wmayer
2019-01-09 14:18:26 +01:00
parent d8ae97e206
commit 5a1c43b131

View File

@@ -88,6 +88,7 @@
#include <Base/Console.h>
#include <Base/Stream.h>
#include <Base/FileInfo.h>
#include <Base/Rotation.h>
#include <Base/Sequencer.h>
#include <Base/Tools.h>
#include <Base/UnitsApi.h>
@@ -1294,7 +1295,7 @@ void NaviCube::setNaviCubeLabels(const std::vector<std::string>& labels)
DEF_3DV_CMD(ViewIsometricCmd)
ViewIsometricCmd::ViewIsometricCmd()
: Command("ViewIsometric")
: Command("ViewIsometricCmd")
{
sGroup = QT_TR_NOOP("");
sMenuText = QT_TR_NOOP("Isometric");
@@ -1309,11 +1310,18 @@ ViewIsometricCmd::ViewIsometricCmd()
void ViewIsometricCmd::activated(int iMsg)
{
Q_UNUSED(iMsg);
//from math import sqrt, degrees, asin
//p1=App.Rotation(App.Vector(1,0,0),90)
//p2=App.Rotation(App.Vector(0,0,1),135)
//p3=App.Rotation(App.Vector(-1,1,0),degrees(asin(-sqrt(1.0/3.0))))
//p4=p3.multiply(p2).multiply(p1)
Command::doCommand(Command::Gui,"Gui.activeDocument().activeView()."
"setCameraOrientation((0.17592, 0.424708, 0.820473, 0.339851))");
}
DEF_3DV_CMD(ViewOrthographicCmd)
ViewOrthographicCmd::ViewOrthographicCmd()
: Command("ViewDimetric")
: Command("ViewOrthographicCmd")
{
sGroup = QT_TR_NOOP("");
sMenuText = QT_TR_NOOP("Orthographic");
@@ -1334,7 +1342,7 @@ void ViewOrthographicCmd::activated(int iMsg)
DEF_3DV_CMD(ViewPerspectiveCmd)
ViewPerspectiveCmd::ViewPerspectiveCmd()
: Command("ViewTrimetric")
: Command("ViewPerspectiveCmd")
{
sGroup = QT_TR_NOOP("");
sMenuText = QT_TR_NOOP("Perspective");
@@ -1384,13 +1392,15 @@ QMenu* NaviCubeImplementation::createNaviCubeMenu() {
init = false;
rcCmdMgr.addCommand(new ViewOrthographicCmd);
rcCmdMgr.addCommand(new ViewPerspectiveCmd);
rcCmdMgr.addCommand(new ViewIsometricCmd);
rcCmdMgr.addCommand(new ViewZoomToFitCmd);
}
vector<string> commands = NaviCubeImplementation::m_commands;
if (commands.empty()) {
commands.push_back("ViewDimetric");
commands.push_back("ViewTrimetric");
commands.push_back("ViewOrthographicCmd");
commands.push_back("ViewPerspectiveCmd");
commands.push_back("ViewIsometricCmd");
commands.push_back("Separator");
commands.push_back("ViewZoomToFit");
}