Little tweaks: wider lines drawn, fix editing dimensions.

[git-p4: depot-paths = "//depot/solvespace/": change = 1761]
solver
Jonathan Westhues 2008-05-31 20:31:28 -08:00
parent 2cb4800fbf
commit 1d1bec83b1
3 changed files with 18 additions and 13 deletions

View File

@ -580,6 +580,8 @@ void Entity::DrawOrGetDistance(int order) {
// contribute a distance for the selection, but it still generates edges.
if(!(g->visible) && !dogd.edges) return;
glLineWidth(1.5);
if(group.v != SS.GW.activeGroup.v) {
glxColor3d(0.5, 0.3, 0.0);
} else if(construction) {
@ -607,7 +609,7 @@ void Entity::DrawOrGetDistance(int order) {
Vector v = PointGetNum();
if(dogd.drawing) {
double s = 3;
double s = 3.5;
Vector r = SS.GW.projRight.ScaledBy(s/SS.GW.scale);
Vector d = SS.GW.projUp.ScaledBy(s/SS.GW.scale);
@ -655,6 +657,7 @@ void Entity::DrawOrGetDistance(int order) {
Vector tail;
if(i == 0) {
tail = SS.GetEntity(point[0])->PointGetNum();
glLineWidth(1);
} else {
// Draw an extra copy of the x, y, and z axes, that's
// always in the corner of the view and at the front.
@ -713,6 +716,7 @@ void Entity::DrawOrGetDistance(int order) {
Vector mm = p.Minus(us).Minus(vs), mm2 = mm;
Vector mp = p.Minus(us).Plus (vs);
glLineWidth(1);
glxColor3d(0, 0.3, 0.3);
glEnable(GL_LINE_STIPPLE);
glLineStipple(3, 0x1111);
@ -827,6 +831,8 @@ void Entity::DrawOrGetDistance(int order) {
default:
oops();
}
glLineWidth(1);
}
void Entity::AddEq(IdList<Equation,hEquation> *l, Expr *expr, int index) {

View File

@ -117,7 +117,7 @@ void GraphicsWindow::Init(void) {
showConstraints = true;
showHdnLines = false;
showShaded = true;
showMesh = true;
showMesh = false;
solving = SOLVE_ALWAYS;
@ -313,6 +313,10 @@ void GraphicsWindow::GeneratePerSolving(void) {
void GraphicsWindow::MenuEdit(int id) {
switch(id) {
case MNU_UNSELECT_ALL:
SS.GW.GroupSelection();
if(SS.GW.gs.n == 0 && SS.GW.pending.operation == 0) {
SS.TW.ClearSuper();
}
SS.GW.ClearSuper();
HideTextEditControl();
break;
@ -850,11 +854,6 @@ bool GraphicsWindow::ConstrainPointByHovered(hEntity pt) {
Constraint::ConstrainCoincident(e->h, pt);
return true;
}
if(e->IsWorkplane()) {
Constraint::Constrain(Constraint::PT_IN_PLANE,
pt, Entity::NO_ENTITY, e->h);
return true;
}
if(e->IsCircle()) {
Constraint::Constrain(Constraint::PT_ON_CIRCLE,
pt, Entity::NO_ENTITY, e->h);
@ -1079,13 +1078,13 @@ void GraphicsWindow::MouseLeftDoubleClick(double mx, double my) {
if(GraphicsEditControlIsVisible()) return;
if(hover.constraint.v) {
Constraint *c = SS.GetConstraint(hover.constraint);
constraintBeingEdited = hover.constraint;
ClearSuper();
Constraint *c = SS.GetConstraint(constraintBeingEdited);
Vector p3 = c->GetLabelPos();
Point2d p2 = ProjectPoint(p3);
ShowGraphicsEditControl((int)p2.x, (int)p2.y, c->exprA->Print());
constraintBeingEdited = hover.constraint;
ClearSuper();
}
}
@ -1151,7 +1150,7 @@ void GraphicsWindow::Paint(int w, int h) {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glScaled(scale*2.0/w, scale*2.0/h, scale*1.0/100000);
glScaled(scale*2.0/w, scale*2.0/h, scale*1.0/30000);
double tx = projRight.Dot(offset);
double ty = projUp.Dot(offset);

View File

@ -39,7 +39,7 @@ void TextWindow::ClearSuper(void) {
modelColor[3] = RGB(150, 0, 0);
modelColor[4] = RGB( 0, 100, 0);
modelColor[5] = RGB( 0, 80, 80);
modelColor[6] = RGB( 0, 0, 150);
modelColor[6] = RGB( 0, 0, 130);
modelColor[7] = RGB( 80, 0, 80);
}