Ejemplo n.º 1
0
 /// <summary>
 /// Create a table.
 /// </summary>
 /// <param name="area"></param>
 /// <param name="cells"></param>
 /// <param name="horizontalRulings"></param>
 /// <param name="verticalRulings"></param>
 /// <param name="extractionAlgorithm"></param>
 public TableWithRulingLines(TableRectangle area, List <Cell> cells, List <Ruling> horizontalRulings, List <Ruling> verticalRulings, IExtractionAlgorithm extractionAlgorithm)
     : base(extractionAlgorithm)
 {
     this.SetRect(area);
     this.verticalRulings   = verticalRulings;
     this.horizontalRulings = horizontalRulings;
     this.AddCells(cells);
 }
Ejemplo n.º 2
0
        public List <T> Intersects(TableRectangle r)
        {
            return(rectangles.Where(tr => IntersectsWithNoBug(r.BoundingBox, tr.BoundingBox)).ToList());

            /*
             * List rv = si.query(new Envelope(r.getLeft(), r.getRight(), r.getTop(), r.getBottom()));
             * return rv;
             */
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="r"></param>
        /// <returns></returns>
        public List <T> Contains(TableRectangle r)
        {
            var expanded = Expand(r.BoundingBox);

            return(rectangles.Where(tr => expanded.Contains(tr.BoundingBox, true)).ToList());

            /*
             * List<T> intersection = si.query(new Envelope(r.getLeft(), r.getRight(), r.getTop(), r.getBottom()));
             * List<T> rv = new List<T>(); // ArrayList<T>();
             *
             * foreach (T ir in intersection)
             * {
             *  if (r.contains(ir))
             *  {
             *      rv.Add(ir);
             *  }
             * }
             *
             * Utils.sort(rv, new RectangleCell.ILL_DEFINED_ORDER());
             * return rv;
             */
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Minimum bounding box of all the Rectangles contained on this RectangleSpatialIndex.
 /// </summary>
 public TableRectangle GetBounds()
 {
     return(TableRectangle.BoundingBoxOf(rectangles.Cast <TableRectangle>()));
 }
Ejemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="rectangle"></param>
 /// <returns></returns>
 public bool Intersects(TableRectangle rectangle)
 {
     // should be the same???
     return(rectangle.IntersectsLine(this));
 }