コード例 #1
0
 private void init() {
   diagram = new PowerDiagram();
   if (clipPolygon != null) {
     maxDelta =
         Math.max(clipPolygon.getBounds2D().getWidth(), clipPolygon.getBounds2D().getHeight());
   }
 }
コード例 #2
0
  /**
   * The resulting Voronoi Cells are clipped with this polygon
   *
   * @param polygon
   */
  public void setClipPolygon(PolygonSimple polygon) {
    clipPolygon = polygon;
    maxDelta =
        Math.max(clipPolygon.getBounds2D().getWidth(), clipPolygon.getBounds2D().getHeight());

    if (diagram != null) {
      diagram.setClipPoly(polygon);
    }
  }