Add config option for "camera" rotation navigation
SS rotates the model when middle button dragging while some users expect this operation to rotate the camera where left-right and up-down directions are reversed instead. This adds that option.pull/1344/head
parent
302aebfd1a
commit
3c91bf7ca4
|
@ -92,6 +92,10 @@ void TextWindow::ScreenChangeTurntableNav(int link, uint32_t v) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TextWindow::ScreenChangeCameraNav(int link, uint32_t v) {
|
||||||
|
SS.cameraNav = !SS.cameraNav;
|
||||||
|
}
|
||||||
|
|
||||||
void TextWindow::ScreenChangeImmediatelyEditDimension(int link, uint32_t v) {
|
void TextWindow::ScreenChangeImmediatelyEditDimension(int link, uint32_t v) {
|
||||||
SS.immediatelyEditDimension = !SS.immediatelyEditDimension;
|
SS.immediatelyEditDimension = !SS.immediatelyEditDimension;
|
||||||
SS.GW.Invalidate(/*clearPersistent=*/true);
|
SS.GW.Invalidate(/*clearPersistent=*/true);
|
||||||
|
@ -333,6 +337,8 @@ void TextWindow::ShowConfiguration() {
|
||||||
Printf(false, " %Fd%f%Ll%s enable automatic line constraints%E",
|
Printf(false, " %Fd%f%Ll%s enable automatic line constraints%E",
|
||||||
&ScreenChangeAutomaticLineConstraints,
|
&ScreenChangeAutomaticLineConstraints,
|
||||||
SS.automaticLineConstraints ? CHECK_TRUE : CHECK_FALSE);
|
SS.automaticLineConstraints ? CHECK_TRUE : CHECK_FALSE);
|
||||||
|
Printf(false, " %Fd%f%Ll%s use camera mouse navigation%E", &ScreenChangeCameraNav,
|
||||||
|
SS.cameraNav ? CHECK_TRUE : CHECK_FALSE);
|
||||||
Printf(false, " %Fd%f%Ll%s use turntable mouse navigation%E", &ScreenChangeTurntableNav,
|
Printf(false, " %Fd%f%Ll%s use turntable mouse navigation%E", &ScreenChangeTurntableNav,
|
||||||
SS.turntableNav ? CHECK_TRUE : CHECK_FALSE);
|
SS.turntableNav ? CHECK_TRUE : CHECK_FALSE);
|
||||||
Printf(false, " %Fd%f%Ll%s edit newly added dimensions%E",
|
Printf(false, " %Fd%f%Ll%s edit newly added dimensions%E",
|
||||||
|
|
|
@ -139,7 +139,8 @@ void GraphicsWindow::MouseMoved(double x, double y, bool leftDown,
|
||||||
double dy = (y - orig.mouse.y) / scale;
|
double dy = (y - orig.mouse.y) / scale;
|
||||||
|
|
||||||
if(!(shiftDown || ctrlDown)) {
|
if(!(shiftDown || ctrlDown)) {
|
||||||
double s = 0.3*(PI/180)*scale; // degrees per pixel
|
double sign = SS.cameraNav ? -1.0 : 1.0;
|
||||||
|
double s = 0.3*(PI/180)*scale*sign; // degrees per pixel
|
||||||
if(SS.turntableNav) { // lock the Z to vertical
|
if(SS.turntableNav) { // lock the Z to vertical
|
||||||
projRight = orig.projRight.RotatedAbout(Vector::From(0, 0, 1), -s * dx);
|
projRight = orig.projRight.RotatedAbout(Vector::From(0, 0, 1), -s * dx);
|
||||||
projUp = orig.projUp.RotatedAbout(
|
projUp = orig.projUp.RotatedAbout(
|
||||||
|
|
|
@ -75,6 +75,8 @@ void SolveSpaceUI::Init() {
|
||||||
exportBackgroundColor = settings->ThawBool("ExportBackgroundColor", false);
|
exportBackgroundColor = settings->ThawBool("ExportBackgroundColor", false);
|
||||||
// Draw back faces of triangles (when mesh is leaky/self-intersecting)
|
// Draw back faces of triangles (when mesh is leaky/self-intersecting)
|
||||||
drawBackFaces = settings->ThawBool("DrawBackFaces", true);
|
drawBackFaces = settings->ThawBool("DrawBackFaces", true);
|
||||||
|
// Use camera mouse navigation
|
||||||
|
cameraNav = settings->ThawBool("CameraNav", false);
|
||||||
// Use turntable mouse navigation
|
// Use turntable mouse navigation
|
||||||
turntableNav = settings->ThawBool("TurntableNav", false);
|
turntableNav = settings->ThawBool("TurntableNav", false);
|
||||||
// Immediately edit dimension
|
// Immediately edit dimension
|
||||||
|
@ -258,6 +260,8 @@ void SolveSpaceUI::Exit() {
|
||||||
settings->FreezeBool("ShowContourAreas", showContourAreas);
|
settings->FreezeBool("ShowContourAreas", showContourAreas);
|
||||||
// Check that contours are closed and not self-intersecting
|
// Check that contours are closed and not self-intersecting
|
||||||
settings->FreezeBool("CheckClosedContour", checkClosedContour);
|
settings->FreezeBool("CheckClosedContour", checkClosedContour);
|
||||||
|
// Use camera mouse navigation
|
||||||
|
settings->FreezeBool("CameraNav", cameraNav);
|
||||||
// Use turntable mouse navigation
|
// Use turntable mouse navigation
|
||||||
settings->FreezeBool("TurntableNav", turntableNav);
|
settings->FreezeBool("TurntableNav", turntableNav);
|
||||||
// Immediately edit dimensions
|
// Immediately edit dimensions
|
||||||
|
|
|
@ -578,6 +578,7 @@ public:
|
||||||
bool drawBackFaces;
|
bool drawBackFaces;
|
||||||
bool showContourAreas;
|
bool showContourAreas;
|
||||||
bool checkClosedContour;
|
bool checkClosedContour;
|
||||||
|
bool cameraNav;
|
||||||
bool turntableNav;
|
bool turntableNav;
|
||||||
bool immediatelyEditDimension;
|
bool immediatelyEditDimension;
|
||||||
bool automaticLineConstraints;
|
bool automaticLineConstraints;
|
||||||
|
|
1
src/ui.h
1
src/ui.h
|
@ -447,6 +447,7 @@ public:
|
||||||
static void ScreenChangeBackFaces(int link, uint32_t v);
|
static void ScreenChangeBackFaces(int link, uint32_t v);
|
||||||
static void ScreenChangeShowContourAreas(int link, uint32_t v);
|
static void ScreenChangeShowContourAreas(int link, uint32_t v);
|
||||||
static void ScreenChangeCheckClosedContour(int link, uint32_t v);
|
static void ScreenChangeCheckClosedContour(int link, uint32_t v);
|
||||||
|
static void ScreenChangeCameraNav(int link, uint32_t v);
|
||||||
static void ScreenChangeTurntableNav(int link, uint32_t v);
|
static void ScreenChangeTurntableNav(int link, uint32_t v);
|
||||||
static void ScreenChangeImmediatelyEditDimension(int link, uint32_t v);
|
static void ScreenChangeImmediatelyEditDimension(int link, uint32_t v);
|
||||||
static void ScreenChangeAutomaticLineConstraints(int link, uint32_t v);
|
static void ScreenChangeAutomaticLineConstraints(int link, uint32_t v);
|
||||||
|
|
Loading…
Reference in New Issue