Example #1
0
        // for the LiveMap:isRelevant() method
        // we need to know how important/big the waypoint representation is on the map without
        // instantiating the visial object. So, we use static method here.
        public static Rectangle boundingRectEstimate(IDrawingSurface map, LabeledPoint wp)
        {
            Point pPoint;

            try
            {
                pPoint = map.toPixelLocation(wp.Location, null);
            }
            catch (Exception e)
            {
                return(Rectangle.Empty);
            }

            int w = wp.imageSizeByType(wp.LiveObjectType);
            int h = w;

            Rectangle re = new Rectangle(pPoint.X - w, pPoint.Y - h, w * 2, h * 2);

            return(re);
        }
Example #2
0
        // for the LiveMap:isRelevant() method
        // we need to know how important/big the waypoint representation is on the map without
        // instantiating the visial object. So, we use static method here.
        public static Rectangle boundingRectEstimate(IDrawingSurface map, LabeledPoint wp)
        {
            Point pPoint;

            try
            {
                pPoint = map.toPixelLocation(wp.Location, null);
            }
            catch (Exception e)
            {
                return Rectangle.Empty;
            }

            int w = wp.imageSizeByType(wp.LiveObjectType);
            int h = w;

            Rectangle re = new Rectangle(pPoint.X-w, pPoint.Y-h, w*2, h*2);

            return re;
        }
Example #3
0
 public bool sameAs(LabeledPoint other)
 {
     return(Location.almostAs(other.Location, 0.01d) && Name.ToLower().Equals(other.Name.ToLower()));
 }