Example #1
0
/**
 * Checks if the size difference of any dimension is more than a
 * factor of two.  This is used to check whether the terrain has to be
 * redrawn after zooming in.
 */
static bool
IsLargeSizeDifference(const GeoBounds &a, const GeoBounds &b)
{
  assert(a.IsValid());
  assert(b.IsValid());

  return a.GetWidth().Native() > Double(b.GetWidth().Native()) ||
    a.GetHeight().Native() > Double(b.GetHeight().Native());
}
Example #2
0
void
RasterProjection::Set(const GeoBounds &bounds,
                      unsigned width, unsigned height)
{
  x_scale = double(width) / bounds.GetWidth().Native();
  left = AngleToWidth(bounds.GetWest());

  y_scale = double(height) / bounds.GetHeight().Native();
  top = AngleToHeight(bounds.GetNorth());
}
Example #3
0
void
RasterProjection::Set(const GeoBounds &bounds,
                      unsigned width, unsigned height)
{
  x_scale = fixed(width) / bounds.GetWidth().Native();
  left = int(bounds.GetWest().Native() * x_scale);

  y_scale = fixed(height) / bounds.GetHeight().Native();
  top = int(bounds.GetNorth().Native() * y_scale);
}