diff --git a/graphicswin.cpp b/graphicswin.cpp index 03c29762..ce365c86 100644 --- a/graphicswin.cpp +++ b/graphicswin.cpp @@ -116,7 +116,8 @@ void GraphicsWindow::Init(void) { showPoints = true; showConstraints = true; showHdnLines = false; - showSolids = true; + showShaded = true; + showMesh = true; solving = SOLVE_ALWAYS; @@ -1108,17 +1109,6 @@ void GraphicsWindow::ToggleBool(int link, DWORD v) { SS.TW.Show(); } -void GraphicsWindow::ToggleAnyDatumShown(int link, DWORD v) { - bool t = !(SS.GW.showWorkplanes && SS.GW.showNormals && SS.GW.showPoints); - SS.GW.showWorkplanes = t; - SS.GW.showNormals = t; - SS.GW.showPoints = t; - - SS.GW.GeneratePerSolving(); - InvalidateGraphics(); - SS.TW.Show(); -} - Vector GraphicsWindow::VectorFromProjs(double right, double up, double fwd) { Vector n = projRight.Cross(projUp); Vector r = offset.ScaledBy(-1); @@ -1185,9 +1175,7 @@ void GraphicsWindow::Paint(int w, int h) { int i, a; // Draw the groups; this fills the polygons in a drawing group, and // draws the solid mesh. - if(showSolids) { - (SS.GetGroup(activeGroup))->Draw(); - } + (SS.GetGroup(activeGroup))->Draw(); // First, draw the entire scene. We don't necessarily want to draw // things with normal z-buffering behaviour; e.g. we always want to diff --git a/sketch.cpp b/sketch.cpp index 2a3ddace..fabafae5 100644 --- a/sketch.cpp +++ b/sketch.cpp @@ -544,11 +544,12 @@ void Group::Draw(void) { glMaterialfv(GL_BACK, GL_AMBIENT_AND_DIFFUSE, mpb); glEnable(GL_LIGHTING); - glxFillMesh(&mesh); + if(SS.GW.showShaded) glxFillMesh(&mesh); glDisable(GL_LIGHTING); - glxDebugMesh(&mesh); + if(SS.GW.showMesh) glxDebugMesh(&mesh); + if(!SS.GW.showShaded) return; if(polyError.yes) { glxColor4d(1, 0, 0, 0.2); glLineWidth(10); diff --git a/textwin.cpp b/textwin.cpp index 264148c9..c970b1e7 100644 --- a/textwin.cpp +++ b/textwin.cpp @@ -237,32 +237,23 @@ void TextWindow::ShowHeader(void) { cd); } - int datumColor; - if(SS.GW.showWorkplanes && SS.GW.showNormals && SS.GW.showPoints) { - datumColor = 's'; // shown - } else if(!(SS.GW.showWorkplanes || SS.GW.showNormals || SS.GW.showPoints)){ - datumColor = 'h'; // hidden - } else { - datumColor = 'm'; // mixed - } - #define hs(b) ((b) ? 's' : 'h') Printf(false, "%Bt%Ftshow: " - "%Fp%Ll%D%fworkplanes%E " + "%Fp%Ll%D%fwrkpls%E " "%Fp%Ll%D%fnormals%E " "%Fp%Ll%D%fpoints%E " - "%Fp%Ll%fany-datum%E", + "%Fp%Ll%D%fconstraints%E ", hs(SS.GW.showWorkplanes), (DWORD)&(SS.GW.showWorkplanes), &(SS.GW.ToggleBool), hs(SS.GW.showNormals), (DWORD)&(SS.GW.showNormals), &(SS.GW.ToggleBool), hs(SS.GW.showPoints), (DWORD)&(SS.GW.showPoints), &(SS.GW.ToggleBool), - datumColor, &(SS.GW.ToggleAnyDatumShown) +hs(SS.GW.showConstraints), (DWORD)(&SS.GW.showConstraints), &(SS.GW.ToggleBool) ); Printf(false, "%Bt%Ft " - "%Fp%Ll%D%fconstraints%E " - "%Fp%Ll%D%fsolids%E " + "%Fp%Ll%D%fshaded%E " + "%Fp%Ll%D%fmesh%E " "%Fp%Ll%D%fhidden-lines%E", -hs(SS.GW.showConstraints), (DWORD)(&SS.GW.showConstraints), &(SS.GW.ToggleBool), -hs(SS.GW.showSolids), (DWORD)(&SS.GW.showSolids), &(SS.GW.ToggleBool), +hs(SS.GW.showShaded), (DWORD)(&SS.GW.showShaded), &(SS.GW.ToggleBool), +hs(SS.GW.showMesh), (DWORD)(&SS.GW.showMesh), &(SS.GW.ToggleBool), hs(SS.GW.showHdnLines), (DWORD)(&SS.GW.showHdnLines), &(SS.GW.ToggleBool) ); } diff --git a/ui.h b/ui.h index 0a39a0b2..856c3558 100644 --- a/ui.h +++ b/ui.h @@ -285,10 +285,10 @@ public: bool showPoints; bool showConstraints; bool showTextWindow; - bool showSolids; + bool showShaded; + bool showMesh; bool showHdnLines; static void ToggleBool(int link, DWORD v); - static void ToggleAnyDatumShown(int link, DWORD v); static const int DONT_SOLVE = 0; static const int SOLVE_ALWAYS = 1;