Add option to disable the "not closed contour" warnings and such,

instead of tying that to whether the shaded model is shown. And
rewrite all URLs to solvespace.com, not www.solvespace.com, and get
rid of the nag screen that I just added because opening the website
with ShellExecute seems to freeze a bit on startup.

[git-p4: depot-paths = "//depot/solvespace/": change = 2044]
This commit is contained in:
Jonathan Westhues 2009-10-01 02:35:11 -08:00
parent 6e5b503ac6
commit 33dfff2a78
6 changed files with 27 additions and 13 deletions

View File

@ -79,6 +79,11 @@ void TextWindow::ScreenChangeBackFaces(int link, DWORD v) {
InvalidateGraphics();
}
void TextWindow::ScreenChangeCheckClosedContour(int link, DWORD v) {
SS.checkClosedContour = !SS.checkClosedContour;
InvalidateGraphics();
}
void TextWindow::ScreenChangeShadedTriangles(int link, DWORD v) {
SS.exportShadedTriangles = !SS.exportShadedTriangles;
InvalidateGraphics();
@ -246,6 +251,14 @@ void TextWindow::ShowConfiguration(void) {
(SS.drawBackFaces ? "" : "yes"), (SS.drawBackFaces ? "yes" : ""),
&ScreenChangeBackFaces,
(!SS.drawBackFaces ? "" : "no"), (!SS.drawBackFaces ? "no" : ""));
bool ccc = (SS.checkClosedContour != 0);
Printf(false, "%Ft check for closed contour: "
"%Fh%f%Ll%s%E%Fs%s%E / %Fh%f%Ll%s%E%Fs%s%E",
&ScreenChangeCheckClosedContour,
(ccc ? "" : "yes"), (ccc ? "yes" : ""),
&ScreenChangeCheckClosedContour,
(!ccc ? "" : "no"), (!ccc ? "no" : ""));
Printf(false, "");
Printf(false, " %Ftgl vendor %E%s", glGetString(GL_VENDOR));

View File

@ -410,8 +410,10 @@ void Group::Draw(void) {
DrawDisplayItems(type);
}
// And finally show the polygons too
if(!SS.GW.showShaded) return;
if(!SS.checkClosedContour) return;
// And finally show the polygons too, and any errors if it's not possible
// to assemble the lines into closed polygons.
if(polyError.how == POLY_NOT_CLOSED) {
// Report this error only in sketch-in-workplane groups; otherwise
// it's just a nuisance.

View File

@ -29,13 +29,6 @@ void SolveSpace::CheckLicenseFromRegistry(void) {
const int SECONDS_IN_DAY = 60*60*24;
license.trialDaysRemaining = 30 -
(int)(((now - license.firstUse))/SECONDS_IN_DAY);
if((!license.licensed) && (license.trialDaysRemaining < 0)) {
Message("The 30-day demo has expired. All exported content will "
"contain a message noting that it was generated by an "
"unregistered version of SolveSpace.");
OpenWebsite("http://solvespace.com/buyunreg");
}
}
void SolveSpace::Init(char *cmdLine) {
@ -81,6 +74,8 @@ void SolveSpace::Init(char *cmdLine) {
fixExportColors = CnfThawDWORD(1, "FixExportColors");
// Draw back faces of triangles (when mesh is leaky/self-intersecting)
drawBackFaces = CnfThawDWORD(1, "DrawBackFaces");
// Check that contours are closed and not self-intersecting
checkClosedContour = CnfThawDWORD(1, "CheckClosedContour");
// Export shaded triangles in a 2d view
exportShadedTriangles = CnfThawDWORD(1, "ExportShadedTriangles");
// Export pwl curves (instead of exact) always
@ -169,6 +164,8 @@ void SolveSpace::Exit(void) {
CnfFreezeDWORD(fixExportColors, "FixExportColors");
// Draw back faces of triangles (when mesh is leaky/self-intersecting)
CnfFreezeDWORD(drawBackFaces, "DrawBackFaces");
// Check that contours are closed and not self-intersecting
CnfFreezeDWORD(checkClosedContour, "CheckClosedContour");
// Export shaded triangles in a 2d view
CnfFreezeDWORD(exportShadedTriangles, "ExportShadedTriangles");
// Export pwl curves (instead of exact) always
@ -749,12 +746,12 @@ void SolveSpace::LoadLicenseFile(char *filename) {
void SolveSpace::MenuHelp(int id) {
switch(id) {
case GraphicsWindow::MNU_WEBSITE:
OpenWebsite("http://www.solvespace.com/helpmenu");
OpenWebsite("http://solvespace.com/helpmenu");
break;
case GraphicsWindow::MNU_ABOUT:
Message("This is SolveSpace version 1.5.\r\n\r\n"
"For more information, see http://www.solvespace.com/\r\n\r\n"
"For more information, see http://solvespace.com/\r\n\r\n"
"Built " __TIME__ " " __DATE__ ".\r\n\r\n"
"Copyright 2008-2009 Useful Subset, LLC. All Rights Reserved.");
break;

View File

@ -552,6 +552,7 @@ public:
float exportOffset;
int fixExportColors;
int drawBackFaces;
int checkClosedContour;
int showToolbar;
DWORD backgroundColor;
int exportShadedTriangles;

View File

@ -101,7 +101,7 @@ void TextWindow::ScreenShowConfiguration(int link, DWORD v) {
SS.TW.GoToScreen(SCREEN_CONFIGURATION);
}
void TextWindow::ScreenGoToWebsite(int link, DWORD v) {
OpenWebsite("http://www.solvespace.com/txtlink");
OpenWebsite("http://solvespace.com/txtlink");
}
void TextWindow::ShowListOfGroups(void) {
Printf(true, "%Ftactv show ok group-name%E");
@ -165,7 +165,7 @@ void TextWindow::ShowListOfGroups(void) {
} else {
Printf(false, "%Fx demo expired, now running in light mode");
}
Printf(false, "%Fx buy at %Fl%f%Llhttp://www.solvespace.com/%E",
Printf(false, "%Fx buy at %Fl%f%Llhttp://solvespace.com/%E",
&ScreenGoToWebsite);
}
}

1
ui.h
View File

@ -169,6 +169,7 @@ public:
static void ScreenChangeFixExportColors(int link, DWORD v);
static void ScreenChangeBackFaces(int link, DWORD v);
static void ScreenChangeCheckClosedContour(int link, DWORD v);
static void ScreenChangePwlCurves(int link, DWORD v);
static void ScreenChangeCanvasSizeAuto(int link, DWORD v);
static void ScreenChangeCanvasSize(int link, DWORD v);