Package org.geotools.geometry.iso.topograph2D

Examples of org.geotools.geometry.iso.topograph2D.Depth


      // if so, must flip the label before merging it
      if (!existingEdge.isPointwiseEqual(e)) {
        labelToMerge = new Label(e.getLabel());
        labelToMerge.flip();
      }
      Depth depth = existingEdge.getDepth();
      // if this is the first duplicate found for this edge, initialize
      // the depths
      // /*
      if (depth.isNull()) {
        depth.add(existingLabel);
      }
      // */
      depth.add(labelToMerge);
      existingLabel.merge(labelToMerge);
      // Debug.print("inserted edge: "); Debug.println(e);
      // Debug.print("existing edge: "); Debug.println(existingEdge);

    } else { // no matching existing edge was found
View Full Code Here


   */
  private void computeLabelsFromDepths() {
    for (Iterator it = edgeList.iterator(); it.hasNext();) {
      Edge e = (Edge) it.next();
      Label lbl = e.getLabel();
      Depth depth = e.getDepth();
      /**
       * Only check edges for which there were duplicates, since these are
       * the only ones which might be the result of dimensional collapses.
       */
      if (!depth.isNull()) {
        depth.normalize();
        for (int i = 0; i < 2; i++) {
          if (!lbl.isNull(i) && lbl.isArea() && !depth.isNull(i)) {
            /**
             * if the depths are equal, this edge is the result of
             * the dimensional collapse of two or more edges. It has
             * the same location on both sides of the edge, so it
             * has collapsed to a line.
             */
            if (depth.getDelta(i) == 0) {
              lbl.toLine(i);
            } else {
              /**
               * This edge may be the result of a dimensional
               * collapse, but it still has different locations on
               * both sides. The label of the edge must be updated
               * to reflect the resultant side locations indicated
               * by the depth values.
               */
              Assert
                  .isTrue(!depth.isNull(i, Position.LEFT),
                      "depth of LEFT side has not been initialized");
              lbl.setLocation(i, Position.LEFT, depth
                  .getLocation(i, Position.LEFT));
              Assert
                  .isTrue(!depth.isNull(i, Position.RIGHT),
                      "depth of RIGHT side has not been initialized");
              lbl.setLocation(i, Position.RIGHT, depth
                  .getLocation(i, Position.RIGHT));
            }
          }
        }
      }
View Full Code Here

TOP

Related Classes of org.geotools.geometry.iso.topograph2D.Depth

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.