GLdouble eqn_left[4] = {-1.0, 0.0, 0.0, 100.0};
GLdouble eqn_right[4] = {1.0, 0.0, 0.0, 100.0};
- Point centroid = get_centroid();
-
float half_span = _w / 2.0;
float roll_value = _roll.getFloatValue() * SGD_DEGREES_TO_RADIANS; // FIXME rad/deg conversion
alpha = get__aoa();
//**************************************************************
glPushMatrix();
// define (0, 0) as center of screen
- glTranslatef(centroid.x, centroid.y, 0);
+ glTranslatef(_center_x, _center_y, 0);
// OBJECT STATIC RETICLE
// TYPE FRL (FUSELAGE REFERENCE LINE)
#ifdef ENABLE_SP_FDM
if (_alpha_bracket && ihook == 1) {
glBegin(GL_LINE_STRIP);
- glVertex2f(vel_x - 20 , vel_y - (16 - alpha) * _compression);
+ glVertex2f(vel_x - 20, vel_y - (16 - alpha) * _compression);
glVertex2f(vel_x - 17, vel_y - (16 - alpha) * _compression);
glVertex2f(vel_x - 17, vel_y - (14 - alpha) * _compression);
glVertex2f(vel_x - 20, vel_y - (14 - alpha) * _compression);
glEnd();
glBegin(GL_LINE_STRIP);
- glVertex2f(vel_x + 20 , vel_y - (16 - alpha) * _compression);
+ glVertex2f(vel_x + 20, vel_y - (16 - alpha) * _compression);
glVertex2f(vel_x + 17, vel_y - (16 - alpha) * _compression);
glVertex2f(vel_x + 17, vel_y - (14 - alpha) * _compression);
glVertex2f(vel_x + 20, vel_y - (14 - alpha) * _compression);
// waypoint marker
if (fabs(brg-psi) > 10.0) {
glPushMatrix();
- glTranslatef(centroid.x, centroid.y, 0);
+ glTranslatef(_center_x, _center_y, 0);
glTranslatef(vel_x, vel_y, 0);
glRotatef(brg - psi, 0.0, 0.0, -1.0);
glBegin(GL_LINE_LOOP);
int oddtype;
// int k; //odd or even values for ticks // FIXME odd scale
- Point mid_scr = get_centroid();
float cur_value = _input.getFloatValue();
if (int(floor(_input.max() + 0.5)) & 1)
} else { // FIXED
vmin = cur_value - _half_width_units; // width units == needle travel
vmax = cur_value + _half_width_units; // or picture unit span.
- text_x = mid_scr.x;
- text_y = mid_scr.y;
+ text_x = _center_x;
+ text_y = _center_y;
}
} else {
vmin = cur_value - _half_width_units; // width units == needle travel
vmax = cur_value + _half_width_units; // or picture unit span.
- text_x = mid_scr.x;
- text_y = mid_scr.y;
+ text_x = _center_x;
+ text_y = _center_y;
}
marker_xs = marker_xe - _w / 3.0;
- // draw_line(marker_xs, mid_scr.y, marker_xe, mid_scr.y + _w / 6);
- // draw_line(marker_xs, mid_scr.y, marker_xe, mid_scr.y - _w / 6);
+ // draw_line(marker_xs, _center_y, marker_xe, _center_y + _w / 6);
+ // draw_line(marker_xs, _center_y, marker_xe, _center_y - _w / 6);
// draw pointer
if (_pointer) {
if (_input.min() >= 0.0)
ycentre = _y;
else if (_input.max() + _input.min() == 0.0)
- ycentre = mid_scr.y;
+ ycentre = _center_y;
else if (oddtype)
ycentre = _y + (1.0 - _input.min()) * _h
/ (_input.max() - _input.min());
marker_xe = _x + _w / 3.0;
// Indicator carrot
- // draw_line(_x, mid_scr.y + _w / 6, marker_xe, mid_scr.y);
- // draw_line(_x, mid_scr.y - _w / 6, marker_xe, mid_scr.y);
+ // draw_line(_x, _center_y + _w / 6, marker_xe, _center_y);
+ // draw_line(_x, _center_y - _w / 6, marker_xe, _center_y);
// draw pointer
if (_pointer) {
if (_input.min() >= 0.0)
ycentre = _y;
else if (_input.max() + _input.min() == 0.0)
- ycentre = mid_scr.y;
+ ycentre = _center_y;
else if (oddtype)
ycentre = _y + (1.0 - _input.min()) * _h / (_input.max() - _input.min());
else
// Tick point adjust
marker_ye = _y + _h / 2;
// Bottom arrow
- // draw_line(mid_scr.x, marker_ye, mid_scr.x - _h / 4, _y);
- // draw_line(mid_scr.x, marker_ye, mid_scr.x + _h / 4, _y);
+ // draw_line(_center_x, marker_ye, _center_x - _h / 4, _y);
+ // draw_line(_center_x, marker_ye, _center_x + _h / 4, _y);
// draw pointer
if (_pointer) {
if (_pointer_type == MOVING) {
if (!_zoom) {
//Code for Moving Type Pointer
- float xcentre = mid_scr.x;
+ float xcentre = _center_x;
float range = _w;
float xpoint = xcentre + (cur_value * range / _val_span);
float ypoint = _y - _marker_offset;
// Tick point adjust
marker_ys = top - _h / 2;
// Top arrow
- // draw_line(mid_scr.x + _h / 4, _y + _h, mid_scr.x, marker_ys);
- // draw_line(mid_scr.x - _h / 4, _y + _h, mid_scr.x , marker_ys);
+ // draw_line(_center_x + _h / 4, _y + _h, _center_x, marker_ys);
+ // draw_line(_center_x - _h / 4, _y + _h, _center_x , marker_ys);
// draw pointer
if (_pointer) {
if (!_zoom) {
//Code for Moving Type Pointer
- float xcentre = mid_scr.x ;
+ float xcentre = _center_x;
float range = _w;
float hgt = _y + _h;
float xpoint = xcentre + (cur_value * range / _val_span);
void HUD::Tape::zoomed_scale(int first, int last)
{
- Point mid_scr = get_centroid();
const int BUFSIZE = 80;
char buf[BUFSIZE];
int data[80];
while (first <= last) {
if ((first % (int)_major_divs) == 0) {
data[a] = first;
- a++ ;
+ a++;
}
first++;
}
float xstart, yfirst, ycentre, ysecond;
float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
- yfirst = mid_scr.y - hgt;
- ycentre = mid_scr.y;
- ysecond = mid_scr.y + hgt;
+ yfirst = _center_y - hgt;
+ ycentre = _center_y;
+ ysecond = _center_y + hgt;
float range = hgt * 2;
int i;
static float ycent, ypoint, xpoint; // FIXME really static?
static float wth;
- ycent = mid_scr.y;
+ ycent = _center_y;
wth = _x + _w;
if (cur_value <= data[centre + 1])
draw_bullet(xstart - 2.5, ycentre, 3.0);
}
- yfirst = mid_scr.y - hgt;
+ yfirst = _center_y - hgt;
for (i = 0; i <= incr; i++) {
draw_line(xstart, yfirst, xstart - 5.0, yfirst);
draw_bullet(xstart + 2.5, ycentre, 3.0);
}
- yfirst = mid_scr.y - hgt;
+ yfirst = _center_y - hgt;
for (i = 0; i <= incr; i++) {
draw_line(xstart, yfirst, xstart + 5.0, yfirst);
float ystart, xfirst, xcentre, xsecond;
float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
- xfirst = mid_scr.x - hgt;
- xcentre = mid_scr.x;
- xsecond = mid_scr.x + hgt;
+ xfirst = _center_x - hgt;
+ xcentre = _center_x;
+ xsecond = _center_x + hgt;
float range = hgt * 2;
int i;
//begin
static float xcent, xpoint, ypoint; // FIXME really static?
- xcent = mid_scr.x;
+ xcent = _center_x;
if (cur_value <= data[centre + 1])
if (cur_value > data[centre]) {
draw_bullet(xcentre, ystart - 2.5, 3.0);
}
- xfirst = mid_scr.x - hgt;
+ xfirst = _center_x - hgt;
for (i = 0; i <= incr; i++) {
draw_line(xfirst, ystart, xfirst, ystart - 5.0);
draw_bullet(xcentre, ystart + 2.5, 3.0);
}
- xfirst = mid_scr.x - hgt;
+ xfirst = _center_x - hgt;
for (i = 0; i <= incr; i++) {
draw_line(xfirst, ystart, xfirst, ystart + 5.0);
float sideslip = _sideslip.getFloatValue();
float span = get_span();
- Point centroid = get_centroid();
-
- float cen_x = centroid.x;
- float cen_y = centroid.y;
float tee_height = _h;
float tee = -tee_height;
float ss_const = 2 * sideslip * span / 40.0; // sideslip angle pixels per deg (width represents 40 deg)
glPushMatrix();
- glTranslatef(cen_x, cen_y, 0.0);
+ glTranslatef(_center_x, _center_y, 0.0);
glRotatef(-bank, 0.0, 0.0, 1.0);
if (!_bank_scale) {
} else { // draw MIL-STD 1878B/4.2.2.4 bank scale
- draw_line(cen_x - 1.0, _y, cen_x + 1.0, _y);
- draw_line(cen_x - 1.0, _y, cen_x - 1.0, _y + 10.0);
- draw_line(cen_x + 1.0, _y, cen_x + 1.0, _y + 10.0);
- draw_line(cen_x - 1.0, _y + 10.0, cen_x + 1.0, _y + 10.0);
+ draw_line(_center_x - 1.0, _y, _center_x + 1.0, _y);
+ draw_line(_center_x - 1.0, _y, _center_x - 1.0, _y + 10.0);
+ draw_line(_center_x + 1.0, _y, _center_x + 1.0, _y + 10.0);
+ draw_line(_center_x - 1.0, _y + 10.0, _center_x + 1.0, _y + 10.0);
float x1, y1, x2, y2, x3, y3, x4, y4, x5, y5;
float xc, yc;