示例#1
0
        public void TestLayerFilter()
        {
            var Pattern = "*G - 200*";
            var Text    = "AB - 07 - G - 200 - 20 - 01|Graphic";

            Assert.IsTrue(LayerComparer.IsLike(Pattern, Text));
        }
        /// <summary>
        /// Returns all objects visible for the given parameters.
        /// </summary>
        /// <param name="view"></param>
        /// <param name="zoomFactor"></param>
        /// <returns></returns>
        public IEnumerable <Primitive2D> Get(View2D view, float zoomFactor)
        {
            ISpatialIndexReadonly <Primitive2D> sceneAtZoom = _rTrees[0];

            // find the part of this scene containing the objects for the requested zoom.
            for (int idx = 1; idx < _zoomFactors.Length; idx++)
            {
                if (zoomFactor <= _zoomFactors[idx])
                {
                    sceneAtZoom = _rTrees[idx];
                }
                else
                {
                    break;
                }
            }

            if (sceneAtZoom != null)
            {
                var primitives = new SortedSet <Primitive2D>(LayerComparer.GetInstance());
                foreach (var primitive in sceneAtZoom.Get(view.OuterBox))
                {
                    primitives.Add(primitive);
                }
                return(primitives);
            }
            return(new List <Primitive2D>());
        }
 public static LayerComparer GetInstance()
 {
     if (_instance == null)
     {
         _instance = new LayerComparer();
     }
     return(_instance);
 }
示例#4
0
        public static LayerComparer Get()
        {
            if (_INSTANCE == null)
            {
                _INSTANCE = new LayerComparer();
            }

            return(_INSTANCE);
        }