From 01ecb986f494168e304d4537e35af2ec4c912962 Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Sun, 2 May 2010 21:15:28 -0800 Subject: [PATCH] Instead of a "force parallel projection" menu item that's on by default, let's do a "use perspective projection" item that's off by default. Same meaning, but less confusion. [git-p4: depot-paths = "//depot/solvespace/": change = 2132] --- confscreen.cpp | 4 ++-- graphicswin.cpp | 8 ++++---- solvespace.cpp | 6 +----- solvespace.h | 2 +- ui.h | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/confscreen.cpp b/confscreen.cpp index 943db5f..2c11e0c 100644 --- a/confscreen.cpp +++ b/confscreen.cpp @@ -346,9 +346,9 @@ bool TextWindow::EditControlDoneForConfiguration(char *s) { } case EDIT_CAMERA_TANGENT: { SS.cameraTangent = (min(2, max(0, atof(s))))/1000.0; - if(SS.forceParallelProj) { + if(!SS.usePerspectiveProj) { Message("The perspective factor will have no effect until you " - "disable View -> Force Parallel Projection."); + "enable View -> Use Perspective Projection."); } InvalidateGraphics(); break; diff --git a/graphicswin.cpp b/graphicswin.cpp index 9bc33fb..0869a64 100644 --- a/graphicswin.cpp +++ b/graphicswin.cpp @@ -58,7 +58,7 @@ const GraphicsWindow::MenuEntry GraphicsWindow::menu[] = { { 1, "&Center View At Point\tF4", MNU_CENTER_VIEW, F(4), mView }, { 1, NULL, 0, NULL }, { 1, "Show Snap &Grid\t>", MNU_SHOW_GRID, '.'|S, mView }, -{ 1, "Force &Parallel Projection\t`", MNU_PARALLEL_PROJ, '`', mView }, +{ 1, "Use &Perspective Projection\t`", MNU_PERSPECTIVE_PROJ,'`', mView }, { 1, NULL, 0, NULL }, { 1, "Show Text &Window\tTab", MNU_SHOW_TEXT_WND, '\t', mView }, { 1, "Show &Toolbar", MNU_SHOW_TOOLBAR, 0, mView }, @@ -361,8 +361,8 @@ void GraphicsWindow::MenuView(int id) { InvalidateGraphics(); break; - case MNU_PARALLEL_PROJ: - SS.forceParallelProj = !SS.forceParallelProj; + case MNU_PERSPECTIVE_PROJ: + SS.usePerspectiveProj = !SS.usePerspectiveProj; if(SS.cameraTangent < 1e-6) { Error("The perspective factor is set to zero, so the view will " "always be a parallel projection.\n\n" @@ -547,7 +547,7 @@ void GraphicsWindow::EnsureValidActives(void) { CheckMenuById(MNU_SHOW_TEXT_WND, SS.GW.showTextWindow); CheckMenuById(MNU_SHOW_TOOLBAR, SS.showToolbar); - CheckMenuById(MNU_PARALLEL_PROJ, SS.forceParallelProj); + CheckMenuById(MNU_PERSPECTIVE_PROJ, SS.usePerspectiveProj); CheckMenuById(MNU_SHOW_GRID, SS.GW.showSnapGrid); if(change) SS.later.showTW = true; diff --git a/solvespace.cpp b/solvespace.cpp index 5cf13f6..a01c31a 100644 --- a/solvespace.cpp +++ b/solvespace.cpp @@ -114,10 +114,6 @@ void SolveSpace::Init(char *cmdLine) { // configuration file, but we will automatically load those as we need // them. - // The factory default settings include a non-zero perspective factor, - // but we'll default to that off. - forceParallelProj = true; - // Start with either an empty file, or the file specified on the // command line. NewFile(); @@ -253,7 +249,7 @@ double SolveSpace::ChordTolMm(void) { } double SolveSpace::CameraTangent(void) { - if(forceParallelProj) { + if(!usePerspectiveProj) { return 0; } else { return cameraTangent; diff --git a/solvespace.h b/solvespace.h index e4c5316..bded00f 100644 --- a/solvespace.h +++ b/solvespace.h @@ -649,7 +649,7 @@ public: char *UnitName(void); double MmPerUnit(void); double ChordTolMm(void); - bool forceParallelProj; + bool usePerspectiveProj; double CameraTangent(void); // The platform-dependent code calls this before entering the msg loop diff --git a/ui.h b/ui.h index 6b82819..bc36601 100644 --- a/ui.h +++ b/ui.h @@ -301,7 +301,7 @@ public: MNU_ZOOM_OUT, MNU_ZOOM_TO_FIT, MNU_SHOW_GRID, - MNU_PARALLEL_PROJ, + MNU_PERSPECTIVE_PROJ, MNU_ONTO_WORKPLANE, MNU_NEAREST_ORTHO, MNU_NEAREST_ISO,