Пример #1
0
 public void Add(LiveObject lo)
 {
     m_list.Add(lo);
     if (lo.GetType().Equals(City.city.GetType()))
     {
         citiesCount++;
     }
     else if (lo.GetType().Equals(Place.place.GetType()))
     {
         namesCount++;
     }
 }
Пример #2
0
 // actually counts intesections' total surface in pixels:
 public int countIntersections(LiveObject llo, Rectangle r)
 {
     int total = 0;
     foreach(LiveObject lo in m_tileFeatures.List)
     {
         if(llo != lo)		// self don't count
         {
             Rectangle sr = lo.intersectionSensitiveRect();
             sr.Intersect(r);
             total += (sr.Width * sr.Height);
             sr = lo.intersectionSensitiveRect2();
             sr.Intersect(r);
             total += (sr.Width * sr.Height / 2);     // count only part of it, less important
         }
     }
     //LibSys.StatusBar.Trace("Intersection total=" + total + " at pos " + llo.LabelPosition);
     return total;
 }
Пример #3
0
        // actually counts intesections' total surface in pixels:
        public int countIntersections(LiveObject llo, Rectangle r)
        {
            int total = 0;
            try
            {
                foreach(LiveObject lo in WaypointsCache.WaypointsAll)
                {
                    if(llo != lo)		// self don't count
                    {
                        Rectangle sr = lo.intersectionSensitiveRect();
                        sr.Intersect(r);
                        total += (sr.Width * sr.Height);
                        sr = lo.intersectionSensitiveRect2();
                        sr.Intersect(r);
                        total += (sr.Width * sr.Height / 2);     // count only part of it, less important
                    }
                }

                foreach(Track trk in WaypointsCache.TracksAll)
                {
                    if(trk.Enabled)
                    {
                        for(int i=0; i < trk.TrackpointsNamed.Count ;i++)
                        {
                            Waypoint wpt = (Waypoint)trk.TrackpointsNamed[i];
                            bool hasContent = wpt.hasContent;
                            bool hasUrl = wpt.Url.Length > 0;
                            bool isPhoto = wpt.ThumbImage != null;

                            if((i==0 || i == trk.Trackpoints.Count-1 || hasContent || hasUrl || isPhoto) && llo != wpt)
                            {
                                Rectangle sr = wpt.intersectionSensitiveRect();
                                sr.Intersect(r);
                                total += (sr.Width * sr.Height);
                                sr = wpt.intersectionSensitiveRect2();
                                sr.Intersect(r);
                                total += (sr.Width * sr.Height / 2);     // count only part of it, less important
                            }
                        }
                    }
                }
                //LibSys.StatusBar.Trace("Intersection total=" + total + " at pos " + llo.LabelPosition);
            }
            catch(Exception e)
            {
                LibSys.StatusBar.Error("LW:countIntersections " + e.Message);
            }
            return total;
        }
Пример #4
0
 public void EarthquakeMoveHandler(LiveObject lo, Rectangle prev)
 {
     //LibSys.StatusBar.Trace("IP: LayerEarthquakes:EarthquakeRemoveHandler() eq=" + lo);
     lo.init(true);	// provoke PutOnMap in Paint()
     PictureManager.Invalidate(prev);
 }
Пример #5
0
 public void EarthquakeDeleteHandler(LiveObject lo)
 {
     //LibSys.StatusBar.Trace("IP: LayerEarthquakes:EarthquakeRemoveHandler() eq=" + lo);
     PictureManager.Invalidate(lo.BoundingRect);
 }
Пример #6
0
 public override int countIntersections(IObjectsLayoutManager olm, LiveObject lo, Rectangle rect)
 {
     return olm.countIntersections(lo, rect);
 }
Пример #7
0
 // actually counts intesections' total surface in pixels:
 public int countIntersections(LiveObject llo, Rectangle r)
 {
     int total = 0;
     return total;
 }
Пример #8
0
 public void CustomMapMoveHandler(LiveObject lo, Rectangle prev)
 {
     //LibSys.StatusBar.Trace("IP: LayerCustomMaps:CustomMapMoveHandler() veh=" + lo);
     lo.init(true);	// provoke PutOnMap in Paint()
     prev.Inflate(1, 1);
     // it is likely that move is not too far, so do one bigger invalidate - save drawing time:
     PictureManager.Invalidate(Rectangle.Union(prev, lo.BoundingRect));
     //PictureManager.Invalidate(lo.BoundingRect);
     //PictureManager.Invalidate(prev);
 }
Пример #9
0
 public void CustomMapDeleteHandler(LiveObject lo)
 {
     //LibSys.StatusBar.Trace("IP: LayerCustomMaps:CustomMapDeleteHandler() map=" + lo);
     PictureManager.Invalidate(lo.BoundingRect);
 }
Пример #10
0
 public virtual int countIntersections(IObjectsLayoutManager iOlm, LiveObject lo, Rectangle rect)
 {
     if(iOlm != null)
     {
         return iOlm.countIntersections(lo, rect);
     }
     else
     {
         return 0;
     }
 }
Пример #11
0
 public void Add(LiveObject lo)
 {
     m_list.Add(lo);
     if(lo.GetType().Equals(City.city.GetType())) { citiesCount++; }
     else if (lo.GetType().Equals(Place.place.GetType())) { namesCount++; }
 }