2008-04-01 10:48:44 +00:00
|
|
|
#include "solvespace.h"
|
|
|
|
|
|
|
|
void Entity::Draw(void) {
|
2008-04-09 08:39:01 +00:00
|
|
|
switch(type) {
|
|
|
|
case CSYS_2D: {
|
|
|
|
Vector p;
|
|
|
|
double a, b, c, d;
|
2008-04-01 10:48:44 +00:00
|
|
|
|
2008-04-09 08:39:01 +00:00
|
|
|
SS.point.FindById(point(16))->GetInto(&p);
|
|
|
|
a = SS.param.FindById(param(0))->val;
|
|
|
|
b = SS.param.FindById(param(1))->val;
|
|
|
|
c = SS.param.FindById(param(2))->val;
|
|
|
|
d = SS.param.FindById(param(3))->val;
|
2008-04-01 10:48:44 +00:00
|
|
|
|
2008-04-09 08:39:01 +00:00
|
|
|
Vector u = Vector::RotationU(a, b, c, d);
|
|
|
|
Vector v = Vector::RotationV(a, b, c, d);
|
2008-04-01 10:48:44 +00:00
|
|
|
|
2008-04-09 08:39:01 +00:00
|
|
|
double s = (min(SS.GW.width, SS.GW.height))*0.4;
|
2008-04-01 10:48:44 +00:00
|
|
|
|
2008-04-09 08:39:01 +00:00
|
|
|
u = u.ScaledBy(s);
|
|
|
|
v = v.ScaledBy(s);
|
2008-04-01 10:48:44 +00:00
|
|
|
|
2008-04-09 08:39:01 +00:00
|
|
|
Vector r;
|
|
|
|
glBegin(GL_LINE_LOOP);
|
|
|
|
r = p; r = r.Minus(v); r = r.Minus(u); glVertex3v(r);
|
|
|
|
r = p; r = r.Plus(v); r = r.Minus(u); glVertex3v(r);
|
|
|
|
r = p; r = r.Plus(v); r = r.Plus(u); glVertex3v(r);
|
|
|
|
r = p; r = r.Minus(v); r = r.Plus(u); glVertex3v(r);
|
|
|
|
glEnd();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
oops();
|
2008-04-01 10:48:44 +00:00
|
|
|
}
|
|
|
|
}
|