示例#1
0
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
}
示例#3
0
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
}
示例#4
0
 /**
  * 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)
 {
 };
示例#5
0
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);
}
示例#6
0
 /**
  * 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)
 {
 };
示例#7
0
void
Waypoint::Project(const TaskProjection &task_projection)
{
  flat_location = task_projection.project(location);

#ifndef NDEBUG
  flat_location_initialised = true;
#endif
}
示例#8
0
void
Waypoint::Project(const TaskProjection &task_projection)
{
  flat_location = task_projection.project(location);
  flat_location_initialised = true;
}