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:
parent
4c6d350cee
commit
3b4aa2c2b2
1
draw.cpp
1
draw.cpp
|
@ -851,6 +851,7 @@ void GraphicsWindow::Paint(int w, int h) {
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glEnable(GL_LINE_SMOOTH);
|
glEnable(GL_LINE_SMOOTH);
|
||||||
|
glEnable(GL_POLYGON_SMOOTH);
|
||||||
glEnable(GL_POLYGON_OFFSET_LINE);
|
glEnable(GL_POLYGON_OFFSET_LINE);
|
||||||
glEnable(GL_POLYGON_OFFSET_FILL);
|
glEnable(GL_POLYGON_OFFSET_FILL);
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
|
8
file.cpp
8
file.cpp
|
@ -179,7 +179,7 @@ bool SolveSpace::SaveToFile(char *filename) {
|
||||||
// will be exported.
|
// will be exported.
|
||||||
SS.GenerateAll(0, INT_MAX);
|
SS.GenerateAll(0, INT_MAX);
|
||||||
|
|
||||||
fh = fopen(filename, "w");
|
fh = fopen(filename, "wb");
|
||||||
if(!fh) {
|
if(!fh) {
|
||||||
Error("Couldn't write to file '%s'", filename);
|
Error("Couldn't write to file '%s'", filename);
|
||||||
return false;
|
return false;
|
||||||
|
@ -281,7 +281,7 @@ void SolveSpace::LoadUsingTable(char *key, char *val) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SolveSpace::LoadFromFile(char *filename) {
|
bool SolveSpace::LoadFromFile(char *filename) {
|
||||||
fh = fopen(filename, "r");
|
fh = fopen(filename, "rb");
|
||||||
if(!fh) {
|
if(!fh) {
|
||||||
Error("Couldn't read from file '%s'", filename);
|
Error("Couldn't read from file '%s'", filename);
|
||||||
return false;
|
return false;
|
||||||
|
@ -340,7 +340,7 @@ bool SolveSpace::LoadFromFile(char *filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SolveSpace::LoadEntitiesFromFile(char *file, EntityList *le, SMesh *m) {
|
bool SolveSpace::LoadEntitiesFromFile(char *file, EntityList *le, SMesh *m) {
|
||||||
fh = fopen(file, "r");
|
fh = fopen(file, "rb");
|
||||||
if(!fh) return false;
|
if(!fh) return false;
|
||||||
|
|
||||||
le->Clear();
|
le->Clear();
|
||||||
|
@ -403,7 +403,7 @@ void SolveSpace::ReloadAllImported(void) {
|
||||||
g->impEntity.Clear();
|
g->impEntity.Clear();
|
||||||
g->impMesh.Clear();
|
g->impMesh.Clear();
|
||||||
if(!LoadEntitiesFromFile(g->impFile, &(g->impEntity), &(g->impMesh))) {
|
if(!LoadEntitiesFromFile(g->impFile, &(g->impEntity), &(g->impMesh))) {
|
||||||
oops();
|
Error("Failed to load imported file '%s'", g->impFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,13 +98,8 @@ void GraphicsWindow::Init(void) {
|
||||||
projRight = Vector::From(1, 0, 0);
|
projRight = Vector::From(1, 0, 0);
|
||||||
projUp = Vector::From(0, 1, 0);
|
projUp = Vector::From(0, 1, 0);
|
||||||
|
|
||||||
// And with the latest visible group active, or failing that the first
|
// And with the last group active
|
||||||
// group after the references
|
activeGroup = SS.group.elem[SS.group.n-1].h;
|
||||||
int i;
|
|
||||||
for(i = 0; i < SS.group.n; i++) {
|
|
||||||
Group *g = &(SS.group.elem[i]);
|
|
||||||
if(i == 1 || g->visible) activeGroup = g->h;
|
|
||||||
}
|
|
||||||
SS.GetGroup(activeGroup)->Activate();
|
SS.GetGroup(activeGroup)->Activate();
|
||||||
|
|
||||||
showWorkplanes = false;
|
showWorkplanes = false;
|
||||||
|
@ -259,11 +254,13 @@ void GraphicsWindow::MenuView(int id) {
|
||||||
|
|
||||||
case MNU_UNITS_MM:
|
case MNU_UNITS_MM:
|
||||||
SS.viewUnits = SolveSpace::UNIT_MM;
|
SS.viewUnits = SolveSpace::UNIT_MM;
|
||||||
|
SS.later.showTW = true;
|
||||||
SS.GW.EnsureValidActives();
|
SS.GW.EnsureValidActives();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MNU_UNITS_INCHES:
|
case MNU_UNITS_INCHES:
|
||||||
SS.viewUnits = SolveSpace::UNIT_INCHES;
|
SS.viewUnits = SolveSpace::UNIT_INCHES;
|
||||||
|
SS.later.showTW = true;
|
||||||
SS.GW.EnsureValidActives();
|
SS.GW.EnsureValidActives();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -5,13 +5,11 @@ DXF export
|
||||||
TTF font text
|
TTF font text
|
||||||
some kind of rounding / chamfer
|
some kind of rounding / chamfer
|
||||||
remove back button in browser?
|
remove back button in browser?
|
||||||
clean up user-created workplanes
|
|
||||||
graphic export
|
graphic export
|
||||||
relative paths for import
|
relative paths for import
|
||||||
auto-generate circles and faces when lathing
|
auto-generate circles and faces when lathing
|
||||||
|
|
||||||
partitioned subsystems in the solver
|
partitioned subsystems in the solver
|
||||||
display with proper formatting/units
|
|
||||||
sweep tool
|
sweep tool
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user