Beispiel #1
0
        public void ExtractRect()
        {
            Boolean _first = true;

            foreach (Picture _pic in Pictures)
            {
                if (_pic.PositionPresent)
                {
                    PositionPresent = true;
                    if (_first)
                    {
                        _rect  = new GpsRect(_pic.Position);
                        _first = false;
                    }
                    _rect.UpdateRangeFromLocation(_pic.Position);
                }
            }

            if (_rect == null)
            {
                _rect = new GpsRect();
            }

            // distance with edges of original rect
            double _degreesOffset = 0.2;

            _rect.UpdateDisp(_degreesOffset);
            GpsLocationCommon = _rect.TopLeft.Equals(_rect.BottomRight);
        }
Beispiel #2
0
        public void UpdateRect()
        {
            foreach (Album _album in Albums)
            {
                _album.ExtractRect();
            }

            Boolean _first = true;

            PositionPresent = false;

            foreach (Album _album in Albums)
            {
                if (_album.PositionPresent)
                {
                    PositionPresent = true;
                    if (_first)
                    {
                        Rect   = new GpsRect(_album.Rect);
                        _first = false;
                    }
                    Rect.UpdateRangeFromRect(_album.Rect);
                }
            }

            double _degreesOffset = 1.5;

            if (Rect == null)
            {
                Rect = new GpsRect();
            }

            Rect.UpdateDisp(_degreesOffset);
        }
Beispiel #3
0
 public GpsRect(GpsRect _other)
 {
     TopLeft         = new GpsLocation(_other.TopLeft);
     BottomRight     = new GpsLocation(_other.BottomRight);
     TopLeftDisp     = new GpsLocation(_other.TopLeftDisp);
     BottomRightDisp = new GpsLocation(_other.BottomRightDisp);
     Center          = new GpsLocation(_other.Center);
 }
Beispiel #4
0
        public void UpdateRangeFromRect(GpsRect _rectNew)
        {
            if (_rectNew.TopLeft.Latitude > TopLeft.Latitude)
            {
                TopLeft.Latitude = _rectNew.TopLeft.Latitude;
            }
            else if (_rectNew.BottomRight.Latitude < BottomRight.Latitude)
            {
                BottomRight.Latitude = _rectNew.BottomRight.Latitude;
            }

            if (_rectNew.TopLeft.Longitude < TopLeft.Longitude)
            {
                TopLeft.Longitude = _rectNew.TopLeft.Longitude;
            }
            else if (_rectNew.BottomRight.Longitude > BottomRight.Longitude)
            {
                BottomRight.Longitude = _rectNew.BottomRight.Longitude;
            }
        }
Beispiel #5
0
 public static LocationRect ConvertGpsToRect(GpsRect _rect)
 {
     return(new LocationRect(ConvertGpsToLoc(_rect.TopLeftDisp), ConvertGpsToLoc(_rect.BottomRightDisp)));
 }