Remove stupid "show any datum" link, and replace with a link to

show/hide the mesh (drawn as wireframe triangles).

[git-p4: depot-paths = "//depot/solvespace/": change = 1754]
solver
Jonathan Westhues 2008-05-28 02:34:55 -08:00
parent 502211495b
commit 3c9084b240
4 changed files with 15 additions and 35 deletions

View File

@ -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

View File

@ -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);

View File

@ -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)
);
}

4
ui.h
View File

@ -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;