package yi.iu.processor.clc;

import java.util.*;

/**
 * IntersectingLineCluster represents a intersecting line cluster (a cluster
 * in which lines are intersecting) and stores how it is constructed from
 * intersecting line clusters (lines from different line clusters are
 * intersecting).
 * @deprecated  It is supposed to store the interrelationship between
 *              intersecting line clusters along with the lines inside the line
 *              cluster.  However, it failed because IntersectingLineClusters
 *              can't record the relationships correctly.  See
 *              IntersectingLineCluster for more details.
 */
public class IntersectingLineCluster extends LineClusterSet {

  IntersectingLineClusters m_components;

  public IntersectingLineCluster() {
    super();
  }

  /**
   * Construct a intersecting line cluster using given line clusters.  Those
   * line clusters are supposed to have inter-related, so all the lines in
   * each of those line clusters should be added to the resultant intersecting
   * line cluster.
   * @param line_clusters
   */
  public IntersectingLineCluster(IntersectingLineClusters line_clusters) {
    m_components = line_clusters;

    Iterator i = line_clusters.values().iterator();
    while (i.hasNext()) {
      LineClusterSet line_cluster = (LineClusterSet)i.next();
      // only inherit image widht / height
      m_imgWidth = line_cluster.getImageWidth();
      m_imgHeight = line_cluster.getImageHeight();
      addAll(line_cluster);
    }
  }
}