Examples of intersection()


Examples of com.vividsolutions.jts.geom.Geometry.intersection()

      Polygon jtsPoly = polygonXZToJTSPolygon(poly);
     
      if (remainingGeometry == null) {
        remainingGeometry = jtsPoly;
      } else {
        remainingGeometry = remainingGeometry.intersection(jtsPoly);
      }
     
    }
   
    return polygonsXZFromJTSGeometry(remainingGeometry);
View Full Code Here

Examples of com.vividsolutions.jts.geom.LineString.intersection()

      LineString segment = fc.createLineString(segmentCoordinates);
      // if intersect, this is the vertex we need to add, so add it to the
      // result coordinates list.
      if (segment.intersects(line)) {

        Geometry point = segment.intersection(line);

        Geometry[] sorted = sortPoints(point, segment);
        // add all the points.
        for (int j = 0; j < sorted.length; j++) {
View Full Code Here

Examples of com.vividsolutions.jts.geom.MultiLineString.intersection()

        for (int i = 1; i < lines.length; i += 2) {
            lines[i] = (LineString)lines[i].reverse();
        }
        MultiLineString hatchLines;
        hatchLines = JTSUtils.getFactory().createMultiLineString(lines);
        Geometry intersection = hatchLines.intersection(infillArea);
        lines = JTSUtils.getLineStrings(intersection);
       
       
//        // split area outlines along hatch lines
//        MultiLineString outline;
View Full Code Here

Examples of com.vividsolutions.jts.geom.MultiPolygon.intersection()

                endEndpoint.getCoordinate() };
        GeometryFactory geometryFactory = GeometryUtils.getGeometryFactory();
        LineString line = geometryFactory.createLineString(coordinates);
        for (Area area : areas) {
            MultiPolygon polygon = area.toJTSMultiPolygon();
            Geometry intersection = polygon.intersection(line);
            if (intersection.getLength() > 0.000001) {
                intersects.add(area);
            }
        }
        if (intersects.size() == 0) {
View Full Code Here

Examples of com.vividsolutions.jts.geom.Polygon.intersection()

      // result feature

      // each ring, if it lays entirely inside the polygon = one new piece
      Polygon polygonArea = gf.createPolygon((LinearRing) ring, null);
      result = result.difference(polygonArea);
      Geometry areaIntersection = polygonArea.intersection(polygon);
      for (int i = 0; i < areaIntersection.getNumGeometries(); i++) {
        piecesFrom.add(areaIntersection.getGeometryN(i));
      }
    }
    return result;
View Full Code Here

Examples of java.awt.Rectangle.intersection()

              }
            }

            // calculate clipping intersection between global clip border and current cell rectangle
            Shape oldClip = grp.getClip();
            rec = rec.intersection((Rectangle)oldClip);

            // Paint the cell
            if (rec.width > 0 || rec.height > 0) {
              grp.setClip(rec);
              grp.translate(x, y);
View Full Code Here

Examples of java.awt.Rectangle.intersection()

    final int spaceOnX = Math.max(s.width - f.width, 0);
    final int spaceOnY = Math.max(s.height - f.height, 0);
    final int x = (int) (horizontalPercent * spaceOnX) + s.x;
    final int y = (int) (verticalPercent * spaceOnY) + s.y;
    frame.setBounds(x, y, f.width, f.height);
    frame.setBounds(s.intersection(frame.getBounds()));
  }

  /**
   * Positions the specified frame at a random location on the screen while ensuring that the entire frame is visible
   * (provided that the frame is smaller than the screen).
View Full Code Here

Examples of java.awt.Rectangle.intersection()

    // Paint background over the area between the selected tab and the
    // content area
    int selected = tabPane.getSelectedIndex();
    Rectangle r = getTabBounds(selected, calcRect);
    r = r.intersection(new Rectangle(x, y, width, height));
    // Find out the border width
    int bwidth = style.getBorder().getBorderInsets(tabPane).left;
    StyleUtil.fillBackground(style, g, r.x + bwidth, r.y,
        r.width - 2 * bwidth, r.height);
  }
View Full Code Here

Examples of java.awt.Rectangle.intersection()

                                              layout.getMinY(source),
                                              layout.getWidth(source),
                                              layout.getHeight(source));

            // Check for empty intersection.
            if(dstRect.intersection(sourceRect).isEmpty()) {
                throw new IllegalArgumentException(
                    JaiI18N.getString("AreaOpImage0"));
            }
        }
View Full Code Here

Examples of java.awt.Rectangle.intersection()

  // The default dest image area is the same as the source
  // image area.  However, when an ImageLayout hint is set,
  // this might be not true.  So the destRect should be the
  // intersection of the provided rectangle, the destination
  // bounds and the source bounds.
  destRect = destRect.intersection(s.getBounds());
        Rectangle srcRect = new Rectangle(destRect);
        srcRect.x -= getLeftPadding();
        srcRect.width += getLeftPadding() + getRightPadding();
        srcRect.y -= getTopPadding();
        srcRect.height += getTopPadding() + getBottomPadding();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.