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