Beispiel #1
0
        public int[] Select(IEnvelope envelope, int tolerance, MapSelectionMode selectMode)
        {
            object indices = null;

            if (_charts.Select(envelope.GetInternal(), tolerance, (SelectMode)selectMode, ref indices))
            {
                return(indices as int[]);
            }
            return(null);
        }
Beispiel #2
0
        public IEnumerable <LabelInfo> Select(IEnvelope envelope, int tolerance = 0, MapSelectionMode selectMode = MapSelectionMode.Intersection)
        {
            var    extents = envelope.GetInternal();
            object indices = null, parts = null;

            if (_labels.Select(extents, tolerance, (SelectMode)selectMode, ref indices, ref parts))
            {
                var arr1 = indices as int[];
                var arr2 = parts as int[];
                if (arr1 != null && arr2 != null)
                {
                    var list = arr1.Select((name, i) => new LabelInfo {
                        LabelIndex = name, PartIndex = arr2[i]
                    });
                    return(list.ToList());
                }
            }
            return(new List <LabelInfo>());
        }
Beispiel #3
0
        public IEnumerable <IFeature> SelectShapes(IEnvelope boundBox, double tolerance = 0, MapSelectionMode selectionMode = MapSelectionMode.Intersection)
        {
            if (boundBox == null)
            {
                throw new ArgumentNullException("boundBox");
            }

            object result = null;

            if (_shapefile.SelectShapes(boundBox.GetInternal(), tolerance, (SelectMode)selectionMode, ref result))
            {
                var indices = result as int[];
                if (indices != null)
                {
                    return(indices.Select(index => new Feature(_shapefile, index)));
                }
            }

            return(new List <IFeature>());
        }