- marker_ys = scrn_rect.top; // Starting point for
- marker_ye = height; // tick y location calcs
- marker_xe = width;
-
-// glBegin(GL_LINES);
- // left tick bar
-// glVertex2f( scrn_rect.left, scrn_rect.top);
-// glVertex2f( scrn_rect.left, marker_ye);
-
- // right tick bar
-// glVertex2f( marker_xe, scrn_rect.top);
-// glVertex2f( marker_xe, marker_ye );
-// glEnd();
-
- if( huds_top(options) ) {
- // Bottom box line
- drawOneLine( scrn_rect.left,
- scrn_rect.top,
- width,
- scrn_rect.top);
-
- // Tick point adjust
- marker_ye = scrn_rect.top + scrn_rect.bottom / 2;
-
- // Bottom arrow
-// drawOneLine( mid_scr.x, marker_ye,
-// mid_scr.x - scrn_rect.bottom / 4, scrn_rect.top);
-// drawOneLine( mid_scr.x, marker_ye,
-// mid_scr.x + scrn_rect.bottom / 4, scrn_rect.top);
-
- glBegin(GL_LINE_STRIP);
- glVertex2f( mid_scr.x - scrn_rect.bottom / 4, scrn_rect.top);
- glVertex2f( mid_scr.x, marker_ye);
- glVertex2f( mid_scr.x + scrn_rect.bottom / 4, scrn_rect.top);
- glEnd();
- }
- if( huds_bottom(options) ) {
- // Top box line
- drawOneLine( scrn_rect.left, height,
- width, height);
- // Tick point adjust
- marker_ys = height - scrn_rect.bottom / 2;
-
- // Top arrow
-// drawOneLine( mid_scr.x + scrn_rect.bottom / 4,
-// scrn_rect.top + scrn_rect.bottom,
-// mid_scr.x, marker_ys );
-// drawOneLine( mid_scr.x - scrn_rect.bottom / 4,
-// scrn_rect.top + scrn_rect.bottom,
-// mid_scr.x , marker_ys );
- glBegin(GL_LINE_STRIP);
- glVertex2f( mid_scr.x + scrn_rect.bottom / 4,
- height);
- glVertex2f( mid_scr.x , marker_ys );
- glVertex2f( mid_scr.x - scrn_rect.bottom / 4,
- height);
- glEnd();
- }
-
-// if(( options & HUDS_BOTTOM) == HUDS_BOTTOM ) {
-// marker_xe = marker_ys;
-// marker_ys = marker_ye;
-// marker_ye = marker_xe;
-// }
-
- // printf("vmin = %d vmax = %d\n", (int)vmin, (int)vmax);
-
-// last = FloatToInt(vmax)+1;
-// i = FloatToInt(vmin);
- last = (int)vmax + 1;
- i = (int)vmin;
- for(; i <last ; i++ ) {
-// for( i = (int)vmin; i <= (int)vmax; i++ ) {
- // printf("<*> i = %d\n", i);
- condition = true;
- if( !modulo()) {
- if( i < min_val()) {
- condition = false;
- }
- }
- // printf("<**> i = %d\n", i);
- if( condition ) {
-// marker_xs = scrn_rect.left + (int)((i - vmin) * factor() + .5);
- marker_xs = scrn_rect.left + FloatToInt(((i - vmin) * factor()/*+ .5f*/));
- if( div_min()){
-// if( (i%(int)div_min()) == 0 ) {
- if( !(i%(int)div_min() )) {
- // draw in ticks only if they aren't too close to the edge.
- if((( marker_xs - 5) > scrn_rect.left ) &&
- (( marker_xs + 5 )< (scrn_rect.left + scrn_rect.right))){
-
- if( huds_both(options) ) {
- drawOneLine( marker_xs, scrn_rect.top,
- marker_xs, marker_ys - 4);
- drawOneLine( marker_xs, marker_ye + 4,
- marker_xs, height);
-// glBegin(GL_LINES);
-// glVertex2f( marker_xs, scrn_rect.top);
-// glVertex2f( marker_xs, marker_ys - 4);
-// glVertex2f( marker_xs, marker_ye + 4);
-// glVertex2f( marker_xs, scrn_rect.top + scrn_rect.bottom);
-// glEnd();
- }
- else {
- if( huds_top(options)) {
- drawOneLine( marker_xs, marker_ys,
- marker_xs, marker_ye - 4);
- }
- else {
- drawOneLine( marker_xs, marker_ys + 4,
- marker_xs, marker_ye);
- }
- }
- }
- }
- }
- // printf("<***> i = %d\n", i);
- if( div_max()) {
- // printf("i = %d\n", i);
-// if( (i%(int)div_max())==0 ) {
- if( !(i%(int)div_max()) ) {
- if(modulo()) {
- if( disp_val < 0) {
- while(disp_val<0)
- disp_val += modulo();
- }
- disp_val = i % (int) modulo(); // ?????????
- } else {
- disp_val = i;
- }
- // printf("disp_val = %d\n", disp_val);
- // printf("%d\n", (int)(disp_val * (double)data_scaling() + 0.5));
- lenstr = sprintf( TextScale, "%d",
-// (int)(disp_val * data_scaling() +.5));
- FloatToInt(disp_val * data_scaling()/*+.5*/));
- // Draw major ticks and text only if far enough from the edge.
- if(( (marker_xs - 10)> scrn_rect.left ) &&
- ( (marker_xs + 10) < (scrn_rect.left + scrn_rect.right))){
- if( huds_both(options) ) {
-// drawOneLine( marker_xs, scrn_rect.top,
-// marker_xs, marker_ys);
-// drawOneLine( marker_xs, marker_ye,
-// marker_xs, scrn_rect.top + scrn_rect.bottom);
- glBegin(GL_LINE_STRIP);
- glVertex2f( marker_xs, scrn_rect.top);
- glVertex2f( marker_xs, marker_ye);
- glVertex2f( marker_xs, height);
- glEnd();
- if( !huds_notext(options) ) {
- textString ( marker_xs - 4 * lenstr,
- marker_ys + 4,
- TextScale, GLUT_BITMAP_8_BY_13 );
- }
- }
- else {
- drawOneLine( marker_xs, marker_ys,
- marker_xs, marker_ye );
- if( !huds_notext(options)) {
- if( huds_top(options) ) {
- textString ( marker_xs - 4 * lenstr,
- height - 10,
- TextScale, GLUT_BITMAP_8_BY_13 );
- }
- else {
- textString( marker_xs - 4 * lenstr,
- scrn_rect.top,
- TextScale, GLUT_BITMAP_8_BY_13 );
- }
- }
- }
- }
- }
- }
- // printf("<****> i = %d\n", i);
- }
- }
- }
-}
-
+ marker_ys = scrn_rect.top; // Starting point for
+ marker_ye = height; // tick y location calcs
+ marker_xe = width;
+ marker_xs = scrn_rect.left + FloatToInt((cur_value - vmin) * factor() /*+ .5f*/);
+
+
+ // glBegin(GL_LINES);
+ // left tick bar
+ // glVertex2f( scrn_rect.left, scrn_rect.top);
+ // glVertex2f( scrn_rect.left, marker_ye);
+
+ // right tick bar
+ // glVertex2f( marker_xe, scrn_rect.top);
+ // glVertex2f( marker_xe, marker_ye );
+ // glEnd();
+
+ if( huds_top(options) ) {
+ if (draw_cap_bottom) {
+ // Bottom box line
+ drawOneLine( scrn_rect.left,
+ scrn_rect.top,
+ width,
+ scrn_rect.top);
+ } //endif cap_bottom
+
+ // Tick point adjust
+ marker_ye = scrn_rect.top + scrn_rect.bottom / 2;
+ // Bottom arrow
+ // drawOneLine( mid_scr.x, marker_ye,
+ // mid_scr.x - scrn_rect.bottom / 4, scrn_rect.top);
+ // drawOneLine( mid_scr.x, marker_ye,
+ // mid_scr.x + scrn_rect.bottom / 4, scrn_rect.top);
+// draw pointer
+ if(pointer) {
+ if(pointer_type=="fixed") {
+ glBegin(GL_LINE_STRIP);
+ glVertex2f( marker_xs - scrn_rect.bottom / 4, scrn_rect.top);
+ glVertex2f( marker_xs, marker_ye);
+ glVertex2f( marker_xs + scrn_rect.bottom / 4, scrn_rect.top);
+ glEnd();
+ }
+ else
+ if(pointer_type=="moving") {
+ // Code for Moving type Pointer to be included.
+ }
+ }
+
+ }
+ if( huds_bottom(options) ) {
+ // Top box line
+ if (draw_cap_top) {
+ drawOneLine( scrn_rect.left, height,
+ width, height);
+ } //endif cap_top
+
+ // Tick point adjust
+ marker_ys = height - scrn_rect.bottom / 2;
+ // Top arrow
+ // drawOneLine( mid_scr.x + scrn_rect.bottom / 4,
+ // scrn_rect.top + scrn_rect.bottom,
+ // mid_scr.x, marker_ys );
+ // drawOneLine( mid_scr.x - scrn_rect.bottom / 4,
+ // scrn_rect.top + scrn_rect.bottom,
+ // mid_scr.x , marker_ys );
+
+// draw pointer
+ if(pointer) {
+ if(pointer_type=="fixed") {
+ glBegin(GL_LINE_STRIP);
+ glVertex2f( marker_xs + scrn_rect.bottom / 4, height);
+ glVertex2f( marker_xs, marker_ys );
+ glVertex2f( marker_xs - scrn_rect.bottom / 4, height);
+ glEnd();
+ }
+ else
+ if(pointer_type=="moving") {
+ // Code for Moving Type Pointer to be included.
+ }
+ }//if pointer
+
+
+ }
+
+ // if(( options & HUDS_BOTTOM) == HUDS_BOTTOM ) {
+ // marker_xe = marker_ys;
+ // marker_ys = marker_ye;
+ // marker_ye = marker_xe;
+ // }
+
+ // printf("vmin = %d vmax = %d\n", (int)vmin, (int)vmax);
+
+ // last = FloatToInt(vmax)+1;
+ // i = FloatToInt(vmin);
+ last = (int)vmax + 1;
+ i = (int)vmin;
+ for(; i <last ; i++ ) {
+ // for( i = (int)vmin; i <= (int)vmax; i++ ) {
+ // printf("<*> i = %d\n", i);
+ condition = true;
+ if( !modulo()) {
+ if( i < min_val()) {
+ condition = false;
+ }
+ }
+ // printf("<**> i = %d\n", i);
+ if( condition ) {
+ // marker_xs = scrn_rect.left + (int)((i - vmin) * factor() + .5);
+ marker_xs = scrn_rect.left + FloatToInt(((i - vmin) * factor()/*+ .5f*/));
+ if( div_min()){
+ // if( (i%(int)div_min()) == 0 ) {
+ if( !(i%(int)div_min() )) {
+ // draw in ticks only if they aren't too close to the edge.
+ if((( marker_xs - 5) > scrn_rect.left ) &&
+ (( marker_xs + 5 )< (scrn_rect.left + scrn_rect.right))){
+
+ if( huds_both(options) ) {
+ drawOneLine( marker_xs, scrn_rect.top,
+ marker_xs, marker_ys - 4);
+ drawOneLine( marker_xs, marker_ye + 4,
+ marker_xs, height);
+ // glBegin(GL_LINES);
+ // glVertex2f( marker_xs, scrn_rect.top);
+ // glVertex2f( marker_xs, marker_ys - 4);
+ // glVertex2f( marker_xs, marker_ye + 4);
+ // glVertex2f( marker_xs, scrn_rect.top + scrn_rect.bottom);
+ // glEnd();
+ }
+ else {
+ if( huds_top(options)) {
+ // draw minor ticks
+ drawOneLine( marker_xs, marker_ys,
+ marker_xs, marker_ye - 4);
+ }
+ else {
+ drawOneLine( marker_xs, marker_ys + 4,
+ marker_xs, marker_ye);
+ }
+ }
+ }
+ }
+ }
+ // printf("<***> i = %d\n", i);
+ if( div_max()) {
+ // printf("i = %d\n", i);
+ // if( (i%(int)div_max())==0 ) {
+ if( !(i%(int)div_max()) ) {
+ if(modulo()) {
+ if( disp_val < 0) {
+ while(disp_val<0)
+ disp_val += modulo();
+ }
+ disp_val = i % (int) modulo(); // ?????????
+ } else {
+ disp_val = i;
+ }
+ // printf("disp_val = %d\n", disp_val);
+ // printf("%d\n", (int)(disp_val * (double)data_scaling() + 0.5));
+ lenstr = sprintf( TextScale, "%d",
+ // (int)(disp_val * data_scaling() +.5));
+ FloatToInt(disp_val * data_scaling()/*+.5*/));
+ // Draw major ticks and text only if far enough from the edge.
+ if(( (marker_xs - 10)> scrn_rect.left ) &&
+ ( (marker_xs + 10) < (scrn_rect.left + scrn_rect.right))){
+ if( huds_both(options) ) {
+ // drawOneLine( marker_xs, scrn_rect.top,
+ // marker_xs, marker_ys);
+ // drawOneLine( marker_xs, marker_ye,
+ // marker_xs, scrn_rect.top + scrn_rect.bottom);
+ glBegin(GL_LINE_STRIP);
+ glVertex2f( marker_xs, scrn_rect.top);
+ glVertex2f( marker_xs, marker_ye);
+ glVertex2f( marker_xs, height);
+ glEnd();
+ if( !huds_notext(options) ) {
+ textString ( marker_xs - 4 * lenstr,
+ marker_ys + 4,
+ TextScale, GLUT_BITMAP_8_BY_13 );
+ }
+ }
+ else {
+ drawOneLine( marker_xs, marker_ys,
+ marker_xs, marker_ye );
+ if( !huds_notext(options)) {
+ if( huds_top(options) ) {
+ textString ( marker_xs - 4 * lenstr,
+ height - 10,
+ TextScale, GLUT_BITMAP_8_BY_13 );
+ }
+ else {
+ textString( marker_xs - 4 * lenstr,
+ scrn_rect.top,
+ TextScale, GLUT_BITMAP_8_BY_13 );
+ }
+ }
+ }
+ }
+ }
+ }
+ // printf("<****> i = %d\n", i);
+ }
+ }
+ }
+} //draw