예제 #1
0
        //convHull can be either corrected input set, or existing convex hull
        List <ClientClusterable> GetBadgeList(List <Point> convHull)
        {
            var res = new List <ClientClusterable>(_doc.GetShapes().Count() / 2);

            var badges = _doc.GetShapes().Where(sh => sh.ShapeCode() == VdShapeType.Badge);

            foreach (IVdShape b in badges)
            {
                var clusterable = ((VdBadge)b).GetClusterable();

                if (clusterable.Busy)
                {
                    continue;
                }

                //if badge is in cluster and it's not in this cluster, ignore it
                if (clusterable.IsInCluster() && clusterable.ClusterId != Id())
                {
                    continue;
                }

                //if (!CoarseHitTest(clusterable))
                //    continue;

                if (ShapeUtils.FuzzyInside(clusterable.GetBounds(), convHull))
                {
                    res.Add(clusterable);
                }
            }

            return(res);
        }