Little fixes for units display, and change file format to binary

(even though it's still a text file), to avoid CRLF issue.

[git-p4: depot-paths = "//depot/solvespace/": change = 1794]
This commit is contained in:
Jonathan Westhues 2008-06-14 15:31:36 -08:00
parent 4c6d350cee
commit 3b4aa2c2b2
4 changed files with 9 additions and 13 deletions

View File

@ -851,6 +851,7 @@ void GraphicsWindow::Paint(int w, int h) {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
glEnable(GL_POLYGON_SMOOTH);
glEnable(GL_POLYGON_OFFSET_LINE);
glEnable(GL_POLYGON_OFFSET_FILL);
glEnable(GL_DEPTH_TEST);

View File

@ -179,7 +179,7 @@ bool SolveSpace::SaveToFile(char *filename) {
// will be exported.
SS.GenerateAll(0, INT_MAX);
fh = fopen(filename, "w");
fh = fopen(filename, "wb");
if(!fh) {
Error("Couldn't write to file '%s'", filename);
return false;
@ -281,7 +281,7 @@ void SolveSpace::LoadUsingTable(char *key, char *val) {
}
bool SolveSpace::LoadFromFile(char *filename) {
fh = fopen(filename, "r");
fh = fopen(filename, "rb");
if(!fh) {
Error("Couldn't read from file '%s'", filename);
return false;
@ -340,7 +340,7 @@ bool SolveSpace::LoadFromFile(char *filename) {
}
bool SolveSpace::LoadEntitiesFromFile(char *file, EntityList *le, SMesh *m) {
fh = fopen(file, "r");
fh = fopen(file, "rb");
if(!fh) return false;
le->Clear();
@ -403,7 +403,7 @@ void SolveSpace::ReloadAllImported(void) {
g->impEntity.Clear();
g->impMesh.Clear();
if(!LoadEntitiesFromFile(g->impFile, &(g->impEntity), &(g->impMesh))) {
oops();
Error("Failed to load imported file '%s'", g->impFile);
}
}
}

View File

@ -98,13 +98,8 @@ void GraphicsWindow::Init(void) {
projRight = Vector::From(1, 0, 0);
projUp = Vector::From(0, 1, 0);
// And with the latest visible group active, or failing that the first
// group after the references
int i;
for(i = 0; i < SS.group.n; i++) {
Group *g = &(SS.group.elem[i]);
if(i == 1 || g->visible) activeGroup = g->h;
}
// And with the last group active
activeGroup = SS.group.elem[SS.group.n-1].h;
SS.GetGroup(activeGroup)->Activate();
showWorkplanes = false;
@ -259,11 +254,13 @@ void GraphicsWindow::MenuView(int id) {
case MNU_UNITS_MM:
SS.viewUnits = SolveSpace::UNIT_MM;
SS.later.showTW = true;
SS.GW.EnsureValidActives();
break;
case MNU_UNITS_INCHES:
SS.viewUnits = SolveSpace::UNIT_INCHES;
SS.later.showTW = true;
SS.GW.EnsureValidActives();
break;

View File

@ -5,13 +5,11 @@ DXF export
TTF font text
some kind of rounding / chamfer
remove back button in browser?
clean up user-created workplanes
graphic export
relative paths for import
auto-generate circles and faces when lathing
partitioned subsystems in the solver
display with proper formatting/units
sweep tool