1
0
Fork 0

Ok, big oops here. I was passing 3 parameters to a 4 parameter function,

but because of the use of default arguments, the compiler wasn't flagging
this as an error.  This caused a) much stupidity and b) additional stupidity.

I also found a case where I passed in a length and width extention parameters
but, used the length parameter twice ignoring the width parameter.  This
yields much more sensible and expected results when building the grass buffer
zone around a runway.
This commit is contained in:
curt 2003-08-20 16:52:04 +00:00
parent 9e9a13bbdf
commit 5937926a0b
2 changed files with 16 additions and 16 deletions

View file

@ -110,15 +110,15 @@ TGPolygon gen_wgs84_area( Point3D origin, double length_m, double width_m,
// factor (return result points in degrees)
TGPolygon gen_runway_area_w_scale( const TGRunway& runway,
double alt_m,
double len_scale,
double length_scale,
double width_scale ) {
TGPolygon result_list;
Point3D origin(runway.lon, runway.lat, 0);
result_list = gen_wgs84_area( origin,
runway.length * len_scale * SG_FEET_TO_METER,
runway.width * len_scale * SG_FEET_TO_METER,
runway.length * length_scale * SG_FEET_TO_METER,
runway.width * width_scale * SG_FEET_TO_METER,
runway.heading, alt_m, false );
// display points
@ -135,16 +135,16 @@ TGPolygon gen_runway_area_w_scale( const TGRunway& runway,
// (return result points in degrees)
TGPolygon gen_runway_area_w_extend( const TGRunway& runway,
double alt_m,
double len_extend,
double wid_extend ) {
double length_extend,
double width_extend ) {
TGPolygon result_list;
Point3D origin(runway.lon, runway.lat, 0);
result_list
= gen_wgs84_area( origin,
runway.length * SG_FEET_TO_METER + 2.0 * len_extend,
runway.width * SG_FEET_TO_METER + 2.0 * len_extend,
runway.length * SG_FEET_TO_METER + 2.0 * length_extend,
runway.width * SG_FEET_TO_METER + 2.0 * width_extend,
runway.heading, alt_m, false );
// display points
@ -160,16 +160,16 @@ TGPolygon gen_runway_area_w_extend( const TGRunway& runway,
// generate an area for a runway and include midpoints
TGPolygon gen_runway_w_mid( const TGRunway& runway,
double alt_m,
double len_extend_m,
double wid_extend_m ) {
double length_extend_m,
double width_extend_m ) {
TGPolygon result_list;
Point3D origin(runway.lon, runway.lat, 0);
result_list = gen_wgs84_area( origin,
runway.length * SG_FEET_TO_METER
+ 2.0 * len_extend_m,
+ 2.0 * length_extend_m,
runway.width * SG_FEET_TO_METER
+ 2.0 * wid_extend_m,
+ 2.0 * width_extend_m,
runway.heading, alt_m, true );
// display points

View file

@ -71,22 +71,22 @@ typedef runway_list::const_iterator const_runway_list_iterator;
// factor (return result points in degrees)
TGPolygon gen_runway_area_w_scale( const TGRunway& runway,
double alt_m,
double len_scale = 1.0,
double length_scale = 1.0,
double width_scale = 1.0 );
// generate an area for a runway with expansion specified in meters
// (return result points in degrees)
TGPolygon gen_runway_area_w_extend( const TGRunway& runway,
double alt_m,
double len_extend = 0.0,
double wid_extend = 0.0 );
double length_extend = 0.0,
double width_extend = 0.0 );
// generate an area for half a runway
TGPolygon gen_runway_w_mid( const TGRunway& runway,
double alt_m,
double len_extend_m = 0.0,
double wid_extend_m = 0.0 );
double length_extend_m = 0.0,
double width_extend_m = 0.0 );
#endif // _RUNWAY_HXX