12 #include <simgear/constants.h>
13 #include <simgear/math/fg_random.h>
14 #include <simgear/math/mat3.h>
15 #include <simgear/math/polar3d.hxx>
17 #include <Aircraft/aircraft.hxx>
18 #include <Scenery/scenery.hxx>
19 #include <Time/fg_timer.hxx>
24 //============== Top of instr_scale class memeber definitions ===============
27 // 1. instr_scales divide the specified location into half and then
28 // the half opposite the read direction in half again. A bar is
29 // then drawn along the second divider. Scale ticks are drawn
30 // between the middle and quarter section lines (minor division
31 // markers) or just over the middle line.
33 // 2. This class was not intended to be instanciated. See moving_scale
34 // and guage_instr classes.
35 //============================================================================
52 instr_item( x, y, width, height,
53 load_fn, disp_scale, options, working),
54 range_shown ( show_range ),
55 Maximum_value( maxValue ),
56 Minimum_value( minValue ),
57 Maj_div ( major_divs ),
58 Min_div ( minor_divs ),
60 signif_digits( dp_showing )
64 scale_factor = (float)get_span() / range_shown;
65 if( show_range < 0 ) {
66 range_shown = -range_shown;
68 temp = FloatToInt(Maximum_value - Minimum_value) / 100;
69 if( range_shown < temp ) {
75 instr_scale( const instr_scale & image ) :
76 instr_item( (const instr_item &) image),
77 range_shown ( image.range_shown ),
78 Maximum_value( image.Maximum_value ),
79 Minimum_value( image.Minimum_value ),
80 scale_factor ( image.scale_factor ),
81 Maj_div ( image.Maj_div ),
82 Min_div ( image.Min_div ),
83 Modulo ( image.Modulo ),
84 signif_digits( image.signif_digits )
88 instr_scale & instr_scale :: operator = (const instr_scale & rhs )
90 if( !(this == &rhs)) {
91 instr_item::operator = (rhs);
92 range_shown = rhs.range_shown;
93 scale_factor = rhs.scale_factor;
94 Maximum_value = rhs.Maximum_value;
95 Minimum_value = rhs.Minimum_value;
96 Maj_div = rhs.Maj_div;
97 Min_div = rhs.Min_div;
99 signif_digits = rhs.signif_digits;
104 instr_scale :: ~ instr_scale () {}