const FlatBoundingBox AirspaceCircle::get_bounding_box(const TaskProjection& task_projection) { static const Angle a225 = Angle::degrees(fixed(225)); static const Angle a135 = Angle::degrees(fixed(135)); static const Angle a045 = Angle::degrees(fixed(045)); static const Angle a315 = Angle::degrees(fixed(315)); const fixed eradius = m_radius * fixed(1.42); const GeoPoint ll = GeoVector(eradius, a225).end_point(m_center); const GeoPoint lr = GeoVector(eradius, a135).end_point(m_center); const GeoPoint ur = GeoVector(eradius, a045).end_point(m_center); const GeoPoint ul = GeoVector(eradius, a315).end_point(m_center); FlatGeoPoint fll = task_projection.project(ll); FlatGeoPoint flr = task_projection.project(lr); FlatGeoPoint ful = task_projection.project(ul); FlatGeoPoint fur = task_projection.project(ur); // note +/- 1 to ensure rounding keeps bb valid return FlatBoundingBox(FlatGeoPoint(min(fll.Longitude, ful.Longitude) - 1, min(fll.Latitude, flr.Latitude) - 1), FlatGeoPoint(max(flr.Longitude, fur.Longitude) + 1, max(ful.Latitude, fur.Latitude) + 1)); }
void OrderedTaskPoint::update_boundingbox(const TaskProjection& task_projection) { flat_bb = FlatBoundingBox(task_projection.project(get_location())); for (fixed t=fixed_zero; t<= fixed_one; t+= fixed_steps) flat_bb.expand(task_projection.project(get_boundary_parametric(t))); flat_bb.expand(); // add 1 to fix rounding }
void OrderedTaskPoint::update_boundingbox(const TaskProjection &task_projection) { flat_bb = FlatBoundingBox(task_projection.project(GetLocation())); const ObservationZone::Boundary boundary = GetBoundary(); for (auto i = boundary.begin(), end = boundary.end(); i != end; ++i) flat_bb.Expand(task_projection.project(*i)); flat_bb.ExpandByOne(); // add 1 to fix rounding }
/** * Constructor for virtual airspaces for use in range-based * intersection queries * * @param loc Location about which to create a virtual airspace envelope * @param task_projection projection to be used for flat-earth representation * @param range range in meters of virtual bounding box * * @return dummy airspace envelope */ Airspace(const GeoPoint&loc, const TaskProjection& task_projection, const fixed range=fixed_zero): FlatBoundingBox(task_projection.project(loc), task_projection.project_range(loc,range)), pimpl_airspace(NULL) { };
void OrderedTaskPoint::update_boundingbox(const TaskProjection& task_projection) { FlatGeoPoint fmin; FlatGeoPoint fmax; bool empty = true; for (fixed t=fixed_zero; t<= fixed_one; t+= fixed_steps) { FlatGeoPoint f = task_projection.project(get_boundary_parametric(t)); if (empty) { empty = false; fmin = f; fmax = f; } else { fmin.Longitude = min(fmin.Longitude, f.Longitude); fmin.Latitude = min(fmin.Latitude, f.Latitude); fmax.Longitude = max(fmax.Longitude, f.Longitude); fmax.Latitude = max(fmax.Latitude, f.Latitude); } } // note +/- 1 to ensure rounding keeps bb valid fmin.Longitude-= 1; fmin.Latitude-= 1; fmax.Longitude+= 1; fmax.Latitude+= 1; flat_bb = FlatBoundingBox(fmin,fmax); }
/** * Constructor for virtual airspaces for use in bounding-box * specified intersection queries * * @param ll Lower left corner of bounding box * @param ur Upper right corner of bounding box * @param task_projection projection to be used for flat-earth representation * * @return dummy airspace envelope */ Airspace(const GeoPoint &ll, const GeoPoint &ur, const TaskProjection& task_projection): FlatBoundingBox(task_projection.project(ll), task_projection.project(ur)), pimpl_airspace(NULL) { };
void Waypoint::Project(const TaskProjection &task_projection) { flat_location = task_projection.project(location); #ifndef NDEBUG flat_location_initialised = true; #endif }
void Waypoint::Project(const TaskProjection &task_projection) { flat_location = task_projection.project(location); flat_location_initialised = true; }