Пример #1
0
 public void Insert(int recordIndex, QTNodeHelper helper, System.IO.Stream shapeFileStream)
 {
     if (helper.IsPointData())
     {
         rootNode.Insert(recordIndex, helper, shapeFileStream);
     }
     else
     {
         RectangleF recBounds = helper.GetRecordBounds(recordIndex, shapeFileStream);
         rootNode.Insert(recordIndex, helper, ref recBounds, shapeFileStream);
     }
 }
Пример #2
0
 public void Insert(int recordIndex, QTNodeHelper helper, System.IO.Stream shapeFileStream)
 {
     if (helper.IsPointData())
     {
         rootNode.Insert(recordIndex, helper, shapeFileStream);
     }
     else
     {
         RectangleF recBounds = helper.GetRecordBounds(recordIndex, shapeFileStream);
         rootNode.Insert(recordIndex, helper, ref recBounds, shapeFileStream);
     }
 }
Пример #3
0
        public void Insert(int recordIndex, QTNodeHelper helper, System.IO.Stream shapeFileStream)
        {
            if (Level == MaxLevels)
            {                
                indexList.Add(recordIndex);
            }
            else
            {                
                if(helper.IsPointData())
                {
                    PointF pt = helper.GetRecordPoint(recordIndex, shapeFileStream);
                    
                    if(children == null)
                    {
                        CreateChildren();
                    }
                    
                    if (children[TL].Bounds.Contains(pt))
                    {
                        children[TL].Insert(recordIndex, helper, shapeFileStream);
                    }
                    else if (children[TR].Bounds.Contains(pt))
                    {
                        children[TR].Insert(recordIndex, helper, shapeFileStream);
                    }
                    else if (children[BL].Bounds.Contains(pt))
                    {
                        children[BL].Insert(recordIndex, helper, shapeFileStream);
                    }
                    else if (children[BR].Bounds.Contains(pt))
                    {
                        children[BR].Insert(recordIndex, helper, shapeFileStream);
                    }
                    else
                    {
                        throw new InvalidOperationException("point " + pt + " is not contained in children bounds");
                    }                    
                }
                else
                {
                    RectangleF recBounds = helper.GetRecordBounds(recordIndex, shapeFileStream);

                    if (children == null)
                    {
                        CreateChildren();
                    }
                    int c = 0;
                    if (children[TL].Bounds.IntersectsWith(recBounds))
                    {
                        c++;
                        children[TL].Insert(recordIndex, helper, shapeFileStream);
                    }
                    if (children[TR].Bounds.IntersectsWith(recBounds))
                    {
                        c++;
                        children[TR].Insert(recordIndex, helper, shapeFileStream);
                    }
                    if (children[BL].Bounds.IntersectsWith(recBounds))
                    {
                        c++;
                        children[BL].Insert(recordIndex, helper, shapeFileStream);
                    }
                    if (children[BR].Bounds.IntersectsWith(recBounds))
                    {
                        c++;
                        children[BR].Insert(recordIndex, helper, shapeFileStream);
                    }                    
                }
            }
            

        }
Пример #4
0
        public void Insert(int recordIndex, QTNodeHelper helper, System.IO.Stream shapeFileStream)
        {
            if (Level == MaxLevels)
            {
                indexList.Add(recordIndex);
            }
            else
            {
                if (helper.IsPointData())
                {
                    PointF pt = helper.GetRecordPoint(recordIndex, shapeFileStream);

                    if (children == null)
                    {
                        CreateChildren();
                    }

                    if (children[TL].Bounds.Contains(pt))
                    {
                        children[TL].Insert(recordIndex, helper, shapeFileStream);
                    }
                    else if (children[TR].Bounds.Contains(pt))
                    {
                        children[TR].Insert(recordIndex, helper, shapeFileStream);
                    }
                    else if (children[BL].Bounds.Contains(pt))
                    {
                        children[BL].Insert(recordIndex, helper, shapeFileStream);
                    }
                    else if (children[BR].Bounds.Contains(pt))
                    {
                        children[BR].Insert(recordIndex, helper, shapeFileStream);
                    }
                    else
                    {
                        throw new InvalidOperationException("point " + pt + " is not contained in children bounds");
                    }
                }
                else
                {
                    RectangleF recBounds = helper.GetRecordBounds(recordIndex, shapeFileStream);

                    if (children == null)
                    {
                        CreateChildren();
                    }
                    int c = 0;
                    if (children[TL].Bounds.IntersectsWith(recBounds))
                    {
                        c++;
                        children[TL].Insert(recordIndex, helper, shapeFileStream);
                    }
                    if (children[TR].Bounds.IntersectsWith(recBounds))
                    {
                        c++;
                        children[TR].Insert(recordIndex, helper, shapeFileStream);
                    }
                    if (children[BL].Bounds.IntersectsWith(recBounds))
                    {
                        c++;
                        children[BL].Insert(recordIndex, helper, shapeFileStream);
                    }
                    if (children[BR].Bounds.IntersectsWith(recBounds))
                    {
                        c++;
                        children[BR].Insert(recordIndex, helper, shapeFileStream);
                    }
                }
            }
        }