コード例 #1
0
  @Override
  public FGEArea union(FGEArea area) {
    if (containsArea(area)) {
      return clone();
    }
    if (area.containsArea(this)) {
      return area.clone();
    }

    return new FGEUnionArea(this, area);
  }
コード例 #2
0
  @Override
  public FGEArea intersect(FGEArea area) {
    if (area.containsArea(this)) {
      return this.clone();
    }
    if (containsArea(area)) {
      return area.clone();
    }

    FGEIntersectionArea returned = new FGEIntersectionArea(this, area);
    if (returned.isDevelopable()) {
      return returned.makeDevelopped();
    } else {
      return returned;
    }
  }
コード例 #3
0
 /**
  * Return nearest point from point "from" following supplied orientation
  *
  * <p>Returns null if no intersection was found
  *
  * @param from point from which we are coming to area
  * @param orientation orientation we are coming from
  * @return
  */
 @Override
 public FGEPoint nearestPointFrom(FGEPoint from, SimplifiedCardinalDirection orientation) {
   FGEHalfLine hl = FGEHalfLine.makeHalfLine(from, orientation);
   FGEArea intersect = intersect(hl);
   return intersect.nearestPointFrom(from, orientation);
 }