4 #ifdef USE_HUD_TextList
5 #define textString( x , y, text, font ) TextString( text, x , y )
7 #define textString( x , y, text, font ) puDrawString ( guiFnt, text, x, y );
10 //========== Top of hud_card class member definitions =============
19 float max_value, // 360
28 instr_scale( x,y,width,height,
31 max_value, min_value, disp_scaling,
32 major_divs, minor_divs, modulus,
34 val_span ( value_span)
36 half_width_units = range_to_show() / 2.0;
37 // UINT options = get_options();
38 // huds_both = (options & HUDS_BOTH) == HUDS_BOTH;
39 // huds_right = options & HUDS_RIGHT;
40 // huds_left = options & HUDS_LEFT;
41 // huds_vert = options & HUDS_VERT;
42 // huds_notext = options & HUDS_NOTEXT;
43 // huds_top = options & HUDS_TOP;
44 // huds_bottom = options & HUDS_BOTTOM;
51 hud_card( const hud_card & image):
52 instr_scale( (const instr_scale & ) image),
53 val_span( image.val_span),
54 half_width_units (image.half_width_units)
56 // UINT options = get_options();
57 // huds_both = (options & HUDS_BOTH) == HUDS_BOTH;
58 // huds_right = options & HUDS_RIGHT;
59 // huds_left = options & HUDS_LEFT;
60 // huds_vert = options & HUDS_VERT;
61 // huds_notext = options & HUDS_NOTEXT;
62 // huds_top = options & HUDS_TOP;
63 // huds_bottom = options & HUDS_BOTTOM;
66 hud_card & hud_card ::
67 operator = (const hud_card & rhs )
69 if( !( this == &rhs)){
70 instr_scale::operator = (rhs);
71 val_span = rhs.val_span;
72 half_width_units = rhs.half_width_units;
77 // $$$ begin - added, VS Renganathan, 13 Oct 2K
80 draw( void ) // (HUD_scale * pscale )
93 POINT mid_scr = get_centroid();
94 float cur_value = get_value();
95 RECT scrn_rect = get_location();
96 UINT options = get_options();
98 height = scrn_rect.top + scrn_rect.bottom;
99 width = scrn_rect.left + scrn_rect.right;
101 vmin = cur_value - half_width_units; // width units == needle travel
102 vmax = cur_value + half_width_units; // or picture unit span.
104 // Draw the basic markings for the scale...
106 if( huds_vert(options) ) { // Vertical scale
107 // drawOneLine( scrn_rect.left, // Bottom tick bar
112 // drawOneLine( scrn_rect.left, // Top tick bar
117 marker_xs = scrn_rect.left; // x start
118 marker_xe = width; // x extent
121 // glBegin(GL_LINES);
124 // glVertex2f( marker_xs, scrn_rect.top);
125 // glVertex2f( marker_xe, scrn_rect.top);
128 // glVertex2f( marker_xs, marker_ye);
129 // glVertex2f( marker_xe, marker_ye );
132 // We do not use else in the following so that combining the two
133 // options produces a "caged" display with double carrots. The
134 // same is done for horizontal card indicators.
136 if( huds_left(options) ) { // Calculate x marker offset
137 // drawOneLine( marker_xe, scrn_rect.top,
138 // marker_xe, marker_ye); // Cap right side
140 marker_xs = marker_xe - scrn_rect.right / 3; // Adjust tick xs
142 // drawOneLine( marker_xs, mid_scr.y,
143 // marker_xe, mid_scr.y + scrn_rect.right / 6);
144 // drawOneLine( marker_xs, mid_scr.y,
145 // marker_xe, mid_scr.y - scrn_rect.right / 6);
147 glBegin(GL_LINE_STRIP);
148 glVertex2f( 10+marker_xe, mid_scr.y + scrn_rect.right / 6);
149 glVertex2f( 10+marker_xs, mid_scr.y);
150 glVertex2f( 10+marker_xe, mid_scr.y - scrn_rect.right / 6);
153 if( huds_right(options) ) { // We'll default this for now.
154 // drawOneLine( scrn_rect.left, scrn_rect.top,
155 // scrn_rect.left, marker_ye ); // Cap left side
157 marker_xe = scrn_rect.left + scrn_rect.right / 3; // Adjust tick xe
159 // drawOneLine( scrn_rect.left, mid_scr.y + scrn_rect.right / 6,
160 // marker_xe, mid_scr.y );
161 // drawOneLine( scrn_rect.left, mid_scr.y - scrn_rect.right / 6,
162 // marker_xe, mid_scr.y);
163 glBegin(GL_LINE_STRIP);
164 glVertex2f( -10+scrn_rect.left, mid_scr.y + scrn_rect.right / 6);
165 glVertex2f( -10+marker_xe, mid_scr.y );
166 glVertex2f( -10+scrn_rect.left, mid_scr.y - scrn_rect.right / 6);
170 // At this point marker x_start and x_end values are transposed.
171 // To keep this from confusing things they are now interchanged.
172 if(huds_both(options)) {
173 marker_ye = marker_xs;
174 marker_xs = marker_xe;
175 marker_xe = marker_ye;
178 // Work through from bottom to top of scale. Calculating where to put
179 // minor and major ticks.
181 // last = FloatToInt(vmax)+1;
182 // i = FloatToInt(vmin);
183 last = (int)vmax + 1;
185 for( ; i <last ; i++ )
195 if( condition ) { // Show a tick if necessary
196 // Calculate the location of this tick
197 marker_ys = scrn_rect.top + FloatToInt(((i - vmin) * factor()/*+.5f*/));
198 // marker_ys = scrn_rect.top + (int)((i - vmin) * factor() + .5);
199 // Block calculation artifact from drawing ticks below min coordinate.
200 // Calculation here accounts for text height.
202 if(( marker_ys < (scrn_rect.top + 4)) |
203 ( marker_ys > (height - 4))) {
208 // if( (i%div_min()) == 0) {
209 if( !(i%(int)div_min())) {
210 if((( marker_ys - 5) > scrn_rect.top ) &&
211 (( marker_ys + 5) < (height))){
212 if( huds_both(options) ) {
213 drawOneLine( scrn_rect.left, marker_ys,
214 marker_xs, marker_ys );
215 drawOneLine( marker_xe, marker_ys,
217 // glBegin(GL_LINES);
218 // glVertex2f( scrn_rect.left, marker_ys );
219 // glVertex2f( marker_xs, marker_ys );
220 // glVertex2f( marker_xe, marker_ys);
221 // glVertex2f( scrn_rect.left + scrn_rect.right, marker_ys );
225 if( huds_left(options) ) {
226 drawOneLine( marker_xs + 4, marker_ys,
227 marker_xe, marker_ys );
230 drawOneLine( marker_xs, marker_ys,
231 marker_xe - 4, marker_ys );
238 if( !(i%(int)div_max()) )
243 disp_val += modulo();
245 // disp_val = i % (int)modulo();
247 disp_val = i % (int) modulo(); // ?????????
252 lenstr = sprintf( TextScale, "%d",
253 FloatToInt(disp_val * data_scaling()/*+.5*/));
254 // (int)(disp_val * data_scaling() +.5));
255 if(( (marker_ys - 8 ) > scrn_rect.top ) &&
256 ( (marker_ys + 8) < (height))){
257 if( huds_both(options) ) {
258 // drawOneLine( scrn_rect.left, marker_ys,
259 // marker_xs, marker_ys);
260 // drawOneLine( marker_xs, marker_ys,
261 // scrn_rect.left + scrn_rect.right,
263 glBegin(GL_LINE_STRIP);
264 glVertex2f( scrn_rect.left, marker_ys );
265 glVertex2f( marker_xs, marker_ys);
266 glVertex2f( width, marker_ys);
268 if( !huds_notext(options)) {
269 textString ( marker_xs + 2, marker_ys,
270 TextScale, GLUT_BITMAP_8_BY_13 );
274 drawOneLine( marker_xs, marker_ys, marker_xe, marker_ys );
275 if( !huds_notext(options) ) {
276 if( huds_left(options) ) {
277 textString( marker_xs - 8 * lenstr - 2,
279 TextScale, GLUT_BITMAP_8_BY_13 );
282 textString( marker_xe + 3 * lenstr,
284 TextScale, GLUT_BITMAP_8_BY_13 );
288 } // Else read oriented right
289 } // End if modulo division by major interval is zero
290 } // End if major interval divisor non-zero
291 } // End if condition
292 } // End for range of i from vmin to vmax
293 } // End if VERTICAL SCALE TYPE
294 else { // Horizontal scale by default
297 // drawOneLine( scrn_rect.left, scrn_rect.top,
298 // scrn_rect.left, height);
301 // drawOneLine( width, scrn_rect.top,
305 marker_ys = scrn_rect.top; // Starting point for
306 marker_ye = height; // tick y location calcs
309 // glBegin(GL_LINES);
311 // glVertex2f( scrn_rect.left, scrn_rect.top);
312 // glVertex2f( scrn_rect.left, marker_ye);
315 // glVertex2f( marker_xe, scrn_rect.top);
316 // glVertex2f( marker_xe, marker_ye );
319 if( huds_top(options) ) {
322 // drawOneLine( scrn_rect.left,
328 marker_ye = scrn_rect.top + scrn_rect.bottom / 2;
331 // drawOneLine( mid_scr.x, marker_ye,
332 // mid_scr.x - scrn_rect.bottom / 4, scrn_rect.top);
333 // drawOneLine( mid_scr.x, marker_ye,
334 // mid_scr.x + scrn_rect.bottom / 4, scrn_rect.top);
337 // glBegin(GL_LINE_STRIP);
338 // glVertex2f( mid_scr.x - scrn_rect.bottom / 4, scrn_rect.top);
339 // glVertex2f( mid_scr.x, marker_ye);
340 // glVertex2f( mid_scr.x + scrn_rect.bottom / 4, scrn_rect.top);
344 if( huds_bottom(options) ) {
346 drawOneLine( scrn_rect.left, height,
349 marker_ys = height - scrn_rect.bottom / 2;
352 // drawOneLine( mid_scr.x + scrn_rect.bottom / 4,
353 // scrn_rect.top + scrn_rect.bottom,
354 // mid_scr.x, marker_ys );
355 // drawOneLine( mid_scr.x - scrn_rect.bottom / 4,
356 // scrn_rect.top + scrn_rect.bottom,
357 // mid_scr.x , marker_ys );
358 glBegin(GL_LINE_STRIP);
359 glVertex2f( mid_scr.x + scrn_rect.bottom / 4,
361 glVertex2f( mid_scr.x , marker_ys );
362 glVertex2f( mid_scr.x - scrn_rect.bottom / 4,
367 // if(( options & HUDS_BOTTOM) == HUDS_BOTTOM ) {
368 // marker_xe = marker_ys;
369 // marker_ys = marker_ye;
370 // marker_ye = marker_xe;
373 // printf("vmin = %d vmax = %d\n", (int)vmin, (int)vmax);
375 // last = FloatToInt(vmax)+1;
376 // i = FloatToInt(vmin);
377 last = (int)vmax + 1;
379 for(; i <last ; i++ ) {
380 // for( i = (int)vmin; i <= (int)vmax; i++ ) {
381 // printf("<*> i = %d\n", i);
388 // printf("<**> i = %d\n", i);
390 // marker_xs = scrn_rect.left + (int)((i - vmin) * factor() + .5);
391 marker_xs = scrn_rect.left + FloatToInt(((i - vmin) * factor()/*+ .5f*/));
393 // if( (i%(int)div_min()) == 0 ) {
394 if( !(i%(int)div_min() )) {
395 // draw in ticks only if they aren't too close to the edge.
396 if((( marker_xs - 5) > scrn_rect.left ) &&
397 (( marker_xs + 5 )< (scrn_rect.left + scrn_rect.right))){
399 if( huds_both(options) ) {
400 drawOneLine( marker_xs, scrn_rect.top,
401 marker_xs, marker_ys - 4);
402 drawOneLine( marker_xs, marker_ye + 4,
404 // glBegin(GL_LINES);
405 // glVertex2f( marker_xs, scrn_rect.top);
406 // glVertex2f( marker_xs, marker_ys - 4);
407 // glVertex2f( marker_xs, marker_ye + 4);
408 // glVertex2f( marker_xs, scrn_rect.top + scrn_rect.bottom);
412 if( huds_top(options)) {
414 drawOneLine( marker_xs, marker_ys,
415 marker_xs, marker_ye - 4);
416 // patch for angled deck heading
419 glVertex2f( marker_xs, marker_ys+16);
420 glVertex2f( marker_xs+2, marker_ys+13);
421 glVertex2f( marker_xs, marker_ys+10);
422 glVertex2f( marker_xs-2, marker_ys+13);
427 drawOneLine( marker_xs, marker_ys + 4,
428 marker_xs, marker_ye);
434 // printf("<***> i = %d\n", i);
436 // printf("i = %d\n", i);
437 // if( (i%(int)div_max())==0 ) {
438 if( !(i%(int)div_max()) ) {
442 disp_val += modulo();
444 disp_val = i % (int) modulo(); // ?????????
448 // printf("disp_val = %d\n", disp_val);
449 // printf("%d\n", (int)(disp_val * (double)data_scaling() + 0.5));
450 lenstr = sprintf( TextScale, "%d",
451 // (int)(disp_val * data_scaling() +.5));
452 FloatToInt(disp_val * data_scaling()/*+.5*/));
453 // Draw major ticks and text only if far enough from the edge.
454 if(( (marker_xs - 10)> scrn_rect.left ) &&
455 ( (marker_xs + 10) < (scrn_rect.left + scrn_rect.right))){
456 if( huds_both(options) ) {
457 // drawOneLine( marker_xs, scrn_rect.top,
458 // marker_xs, marker_ys);
459 // drawOneLine( marker_xs, marker_ye,
460 // marker_xs, scrn_rect.top + scrn_rect.bottom);
461 glBegin(GL_LINE_STRIP);
462 glVertex2f( marker_xs, scrn_rect.top);
463 glVertex2f( marker_xs, marker_ye);
464 glVertex2f( marker_xs, height);
466 if( !huds_notext(options) ) {
467 textString ( marker_xs - 4 * lenstr,
469 TextScale, GLUT_BITMAP_8_BY_13 );
474 drawOneLine( marker_xs, marker_ys,
475 marker_xs, marker_ye );
476 if( !huds_notext(options)) {
477 if( huds_top(options) ) {
478 textString ( marker_xs - 4 * lenstr,
480 TextScale, GLUT_BITMAP_8_BY_13 );
483 textString( marker_xs - 4 * lenstr,
485 TextScale, GLUT_BITMAP_8_BY_13 );
492 // printf("<****> i = %d\n", i);
499 //$$$ end - VS Renganathan, 13 Oct 2K
502 draw( void ) // (HUD_scale * pscale )
515 POINT mid_scr = get_centroid();
516 float cur_value = get_value();
517 RECT scrn_rect = get_location();
518 UINT options = get_options();
520 height = scrn_rect.top + scrn_rect.bottom;
521 width = scrn_rect.left + scrn_rect.right;
523 vmin = cur_value - half_width_units; // width units == needle travel
524 vmax = cur_value + half_width_units; // or picture unit span.
526 // Draw the basic markings for the scale...
528 if( huds_vert(options) ) { // Vertical scale
529 drawOneLine( scrn_rect.left, // Bottom tick bar
534 drawOneLine( scrn_rect.left, // Top tick bar
539 marker_xs = scrn_rect.left; // x start
540 marker_xe = width; // x extent
543 // glBegin(GL_LINES);
546 // glVertex2f( marker_xs, scrn_rect.top);
547 // glVertex2f( marker_xe, scrn_rect.top);
550 // glVertex2f( marker_xs, marker_ye);
551 // glVertex2f( marker_xe, marker_ye );
554 // We do not use else in the following so that combining the two
555 // options produces a "caged" display with double carrots. The
556 // same is done for horizontal card indicators.
558 if( huds_left(options) ) { // Calculate x marker offset
559 drawOneLine( marker_xe, scrn_rect.top,
560 marker_xe, marker_ye); // Cap right side
562 marker_xs = marker_xe - scrn_rect.right / 3; // Adjust tick xs
564 // drawOneLine( marker_xs, mid_scr.y,
565 // marker_xe, mid_scr.y + scrn_rect.right / 6);
566 // drawOneLine( marker_xs, mid_scr.y,
567 // marker_xe, mid_scr.y - scrn_rect.right / 6);
569 glBegin(GL_LINE_STRIP);
570 glVertex2f( marker_xe, mid_scr.y + scrn_rect.right / 6);
571 glVertex2f( marker_xs, mid_scr.y);
572 glVertex2f( marker_xe, mid_scr.y - scrn_rect.right / 6);
575 if( huds_right(options) ) { // We'll default this for now.
576 drawOneLine( scrn_rect.left, scrn_rect.top,
577 scrn_rect.left, marker_ye ); // Cap left side
579 marker_xe = scrn_rect.left + scrn_rect.right / 3; // Adjust tick xe
581 // drawOneLine( scrn_rect.left, mid_scr.y + scrn_rect.right / 6,
582 // marker_xe, mid_scr.y );
583 // drawOneLine( scrn_rect.left, mid_scr.y - scrn_rect.right / 6,
584 // marker_xe, mid_scr.y);
585 glBegin(GL_LINE_STRIP);
586 glVertex2f( scrn_rect.left, mid_scr.y + scrn_rect.right / 6);
587 glVertex2f( marker_xe, mid_scr.y );
588 glVertex2f( scrn_rect.left, mid_scr.y - scrn_rect.right / 6);
592 // At this point marker x_start and x_end values are transposed.
593 // To keep this from confusing things they are now interchanged.
594 if(huds_both(options)) {
595 marker_ye = marker_xs;
596 marker_xs = marker_xe;
597 marker_xe = marker_ye;
600 // Work through from bottom to top of scale. Calculating where to put
601 // minor and major ticks.
603 // last = FloatToInt(vmax)+1;
604 // i = FloatToInt(vmin);
605 last = (int)vmax + 1;
607 for( ; i <last ; i++ )
616 if( condition ) { // Show a tick if necessary
617 // Calculate the location of this tick
618 marker_ys = scrn_rect.top + FloatToInt(((i - vmin) * factor()/*+.5f*/));
619 // marker_ys = scrn_rect.top + (int)((i - vmin) * factor() + .5);
620 // Block calculation artifact from drawing ticks below min coordinate.
621 // Calculation here accounts for text height.
623 if(( marker_ys < (scrn_rect.top + 4)) |
624 ( marker_ys > (height - 4))) {
629 // if( (i%div_min()) == 0) {
630 if( !(i%(int)div_min())) {
631 if((( marker_ys - 5) > scrn_rect.top ) &&
632 (( marker_ys + 5) < (height))){
633 if( huds_both(options) ) {
634 drawOneLine( scrn_rect.left, marker_ys,
635 marker_xs, marker_ys );
636 drawOneLine( marker_xe, marker_ys,
638 // glBegin(GL_LINES);
639 // glVertex2f( scrn_rect.left, marker_ys );
640 // glVertex2f( marker_xs, marker_ys );
641 // glVertex2f( marker_xe, marker_ys);
642 // glVertex2f( scrn_rect.left + scrn_rect.right, marker_ys );
646 if( huds_left(options) ) {
647 drawOneLine( marker_xs + 4, marker_ys,
648 marker_xe, marker_ys );
651 drawOneLine( marker_xs, marker_ys,
652 marker_xe - 4, marker_ys );
659 if( !(i%(int)div_max()) )
664 disp_val += modulo();
666 // disp_val = i % (int)modulo();
668 disp_val = i % (int) modulo(); // ?????????
673 lenstr = sprintf( TextScale, "%d",
674 FloatToInt(disp_val * data_scaling()/*+.5*/));
675 // (int)(disp_val * data_scaling() +.5));
676 if(( (marker_ys - 8 ) > scrn_rect.top ) &&
677 ( (marker_ys + 8) < (height))){
678 if( huds_both(options) ) {
679 // drawOneLine( scrn_rect.left, marker_ys,
680 // marker_xs, marker_ys);
681 // drawOneLine( marker_xs, marker_ys,
682 // scrn_rect.left + scrn_rect.right,
684 glBegin(GL_LINE_STRIP);
685 glVertex2f( scrn_rect.left, marker_ys );
686 glVertex2f( marker_xs, marker_ys);
687 glVertex2f( width, marker_ys);
689 if( !huds_notext(options)) {
690 textString ( marker_xs + 2, marker_ys,
691 TextScale, GLUT_BITMAP_8_BY_13 );
695 drawOneLine( marker_xs, marker_ys, marker_xe, marker_ys );
696 if( !huds_notext(options) ) {
697 if( huds_left(options) ) {
698 textString( marker_xs - 8 * lenstr - 2,
700 TextScale, GLUT_BITMAP_8_BY_13 );
703 textString( marker_xe + 3 * lenstr,
705 TextScale, GLUT_BITMAP_8_BY_13 );
709 } // Else read oriented right
710 } // End if modulo division by major interval is zero
711 } // End if major interval divisor non-zero
712 } // End if condition
713 } // End for range of i from vmin to vmax
714 } // End if VERTICAL SCALE TYPE
715 else { // Horizontal scale by default
717 drawOneLine( scrn_rect.left, scrn_rect.top,
718 scrn_rect.left, height);
721 drawOneLine( width, scrn_rect.top,
725 marker_ys = scrn_rect.top; // Starting point for
726 marker_ye = height; // tick y location calcs
729 // glBegin(GL_LINES);
731 // glVertex2f( scrn_rect.left, scrn_rect.top);
732 // glVertex2f( scrn_rect.left, marker_ye);
735 // glVertex2f( marker_xe, scrn_rect.top);
736 // glVertex2f( marker_xe, marker_ye );
739 if( huds_top(options) ) {
741 drawOneLine( scrn_rect.left,
747 marker_ye = scrn_rect.top + scrn_rect.bottom / 2;
750 // drawOneLine( mid_scr.x, marker_ye,
751 // mid_scr.x - scrn_rect.bottom / 4, scrn_rect.top);
752 // drawOneLine( mid_scr.x, marker_ye,
753 // mid_scr.x + scrn_rect.bottom / 4, scrn_rect.top);
755 glBegin(GL_LINE_STRIP);
756 glVertex2f( mid_scr.x - scrn_rect.bottom / 4, scrn_rect.top);
757 glVertex2f( mid_scr.x, marker_ye);
758 glVertex2f( mid_scr.x + scrn_rect.bottom / 4, scrn_rect.top);
761 if( huds_bottom(options) ) {
763 drawOneLine( scrn_rect.left, height,
766 marker_ys = height - scrn_rect.bottom / 2;
769 // drawOneLine( mid_scr.x + scrn_rect.bottom / 4,
770 // scrn_rect.top + scrn_rect.bottom,
771 // mid_scr.x, marker_ys );
772 // drawOneLine( mid_scr.x - scrn_rect.bottom / 4,
773 // scrn_rect.top + scrn_rect.bottom,
774 // mid_scr.x , marker_ys );
775 glBegin(GL_LINE_STRIP);
776 glVertex2f( mid_scr.x + scrn_rect.bottom / 4,
778 glVertex2f( mid_scr.x , marker_ys );
779 glVertex2f( mid_scr.x - scrn_rect.bottom / 4,
784 // if(( options & HUDS_BOTTOM) == HUDS_BOTTOM ) {
785 // marker_xe = marker_ys;
786 // marker_ys = marker_ye;
787 // marker_ye = marker_xe;
790 // printf("vmin = %d vmax = %d\n", (int)vmin, (int)vmax);
792 // last = FloatToInt(vmax)+1;
793 // i = FloatToInt(vmin);
794 last = (int)vmax + 1;
796 for(; i <last ; i++ ) {
797 // for( i = (int)vmin; i <= (int)vmax; i++ ) {
798 // printf("<*> i = %d\n", i);
805 // printf("<**> i = %d\n", i);
807 // marker_xs = scrn_rect.left + (int)((i - vmin) * factor() + .5);
808 marker_xs = scrn_rect.left + FloatToInt(((i - vmin) * factor()/*+ .5f*/));
810 // if( (i%(int)div_min()) == 0 ) {
811 if( !(i%(int)div_min() )) {
812 // draw in ticks only if they aren't too close to the edge.
813 if((( marker_xs - 5) > scrn_rect.left ) &&
814 (( marker_xs + 5 )< (scrn_rect.left + scrn_rect.right))){
816 if( huds_both(options) ) {
817 drawOneLine( marker_xs, scrn_rect.top,
818 marker_xs, marker_ys - 4);
819 drawOneLine( marker_xs, marker_ye + 4,
821 // glBegin(GL_LINES);
822 // glVertex2f( marker_xs, scrn_rect.top);
823 // glVertex2f( marker_xs, marker_ys - 4);
824 // glVertex2f( marker_xs, marker_ye + 4);
825 // glVertex2f( marker_xs, scrn_rect.top + scrn_rect.bottom);
829 if( huds_top(options)) {
830 drawOneLine( marker_xs, marker_ys,
831 marker_xs, marker_ye - 4);
834 drawOneLine( marker_xs, marker_ys + 4,
835 marker_xs, marker_ye);
841 // printf("<***> i = %d\n", i);
843 // printf("i = %d\n", i);
844 // if( (i%(int)div_max())==0 ) {
845 if( !(i%(int)div_max()) ) {
849 disp_val += modulo();
851 disp_val = i % (int) modulo(); // ?????????
855 // printf("disp_val = %d\n", disp_val);
856 // printf("%d\n", (int)(disp_val * (double)data_scaling() + 0.5));
857 lenstr = sprintf( TextScale, "%d",
858 // (int)(disp_val * data_scaling() +.5));
859 FloatToInt(disp_val * data_scaling()/*+.5*/));
860 // Draw major ticks and text only if far enough from the edge.
861 if(( (marker_xs - 10)> scrn_rect.left ) &&
862 ( (marker_xs + 10) < (scrn_rect.left + scrn_rect.right))){
863 if( huds_both(options) ) {
864 // drawOneLine( marker_xs, scrn_rect.top,
865 // marker_xs, marker_ys);
866 // drawOneLine( marker_xs, marker_ye,
867 // marker_xs, scrn_rect.top + scrn_rect.bottom);
868 glBegin(GL_LINE_STRIP);
869 glVertex2f( marker_xs, scrn_rect.top);
870 glVertex2f( marker_xs, marker_ye);
871 glVertex2f( marker_xs, height);
873 if( !huds_notext(options) ) {
874 textString ( marker_xs - 4 * lenstr,
876 TextScale, GLUT_BITMAP_8_BY_13 );
880 drawOneLine( marker_xs, marker_ys,
881 marker_xs, marker_ye );
882 if( !huds_notext(options)) {
883 if( huds_top(options) ) {
884 textString ( marker_xs - 4 * lenstr,
886 TextScale, GLUT_BITMAP_8_BY_13 );
889 textString( marker_xs - 4 * lenstr,
891 TextScale, GLUT_BITMAP_8_BY_13 );
898 // printf("<****> i = %d\n", i);