Exemplo n.º 1
0
 /// <summary>
 /// Get the geometry in this collection that falls within the specified axis-aligned bounding box
 /// </summary>
 /// <param name="bounds">The bounding box to check</param>
 /// <param name="inclusive">If true, the output can include objects that lie partially within the bounds, else
 /// the geometry must be entirely contained by the box to be included</param>
 /// <param name="addToThis">The output collection, to which passing geometry should be added</param>
 public void GeometryInBounds(BoundingBox bounds, bool inclusive, VertexGeometryCollection <TShape> addToThis)
 {
     foreach (TShape vG in this)
     {
         if (!addToThis.Contains(vG.GUID) && (inclusive && bounds.Overlaps(vG)) || (!inclusive && bounds.Contains(vG)))
         {
             addToThis.Add(vG);
         }
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Get all the geometry objects contained within this layer table as
        /// a single flat collection
        /// </summary>
        /// <returns></returns>
        public VertexGeometryCollection AllGeometry()
        {
            var result = new VertexGeometryCollection();

            foreach (GeometryLayer layer in this)
            {
                foreach (VertexGeometry geometry in layer)
                {
                    result.Add(geometry);
                }
            }
            return(result);
        }