public void apply(CoordinateSequenceFilter filter) { if (isEmpty()) return; filter.filter(coordinates, 0); if (filter.isGeometryChanged()) geometryChanged(); }
public void geometryChanged() { point.geometryChanged(); }
@Override public void setLocation(double x, double y) { Coordinate coordinate = geometry.getCoordinate(); coordinate.x = x; coordinate.y = y; geometry.geometryChanged(); fireFigureChanged(); }
public void apply(CoordinateSequenceFilter filter) { if (isEmpty()) return; filter.filter(coordinates, 0); if (filter.isGeometryChanged()) geometryChanged(); }
/** * Tests if this ROI contains the given image location. * * @param x location X ordinate * @param y location Y ordinate * * @return {@code true} if the location is within this ROI; * {@code false} otherwise */ @Override public boolean contains(double x, double y) { testPointCS.setX(0, x + delta); testPointCS.setY(0, y + delta); testPoint.geometryChanged(); return theGeom.contains(testPoint); }
@Override public void setLocation(double x, double y) { Coordinate coordinate = geometry.getCoordinate(); coordinate.x = x; coordinate.y = y; final Point2D.Double modelCoords = new Point2D.Double(x, y); final Point2D.Double sceneCoords = new Point2D.Double(); try { sceneTransformProvider.getModelToSceneTransform().transform(modelCoords, sceneCoords); simpleFeature.setDefaultGeometry(new AwtGeomToJtsGeomConverter().createPoint(sceneCoords)); } catch (TransformException e) { coordinate.x = Double.NaN; coordinate.y = Double.NaN; } geometry.geometryChanged(); fireFigureChanged(); }
private void updateDefaultGeometryAttribute(PixelPos pixelPos) { final Product product = getProduct(); final Point2D.Float geometryPoint = new Point2D.Float(pixelPos.x, pixelPos.y); if (product != null) { final AffineTransform i2m = ImageManager.getImageToModelTransform(product.getGeoCoding()); i2m.transform(pixelPos, geometryPoint); } final Point point = (Point) feature.getDefaultGeometry(); point.getCoordinate().setCoordinate(toCoordinate(geometryPoint)); point.geometryChanged(); }
c.x = tp[0]; c.y = tp[1]; pp.geometryChanged();
private void setGeoPosAttribute(GeoPos geoPos, boolean updatePixelPos) { final Coordinate newCoordinate = toCoordinate(geoPos); final Coordinate oldCoordinate = getGeoPosAttribute(); if (!ObjectUtils.equalObjects(oldCoordinate, newCoordinate)) { if (oldCoordinate == null) { final GeometryFactory geometryFactory = new GeometryFactory(); setAttributeValue(PROPERTY_NAME_GEOPOS, geometryFactory.createPoint(newCoordinate)); } else if (newCoordinate != null) { final Point point = (Point) getAttributeValue(PROPERTY_NAME_GEOPOS); point.getCoordinate().setCoordinate(newCoordinate); point.geometryChanged(); } if (updatePixelPos && getProduct() != null) { final PixelPos pixelPos = getPixelPos(); descriptor.updatePixelPos(getProduct().getGeoCoding(), geoPos, pixelPos); setPixelPosAttribute(pixelPos, false, true); } fireProductNodeChanged(PROPERTY_NAME_GEOPOS); } }
for (int i = 0; i < steps; i++) { c.x = env.getMinX() + step * i; pp.geometryChanged(); if(!pg.contains(pp)) { containCounter = 0; int midIdx = max > 1 ? maxIdx - max / 2 : maxIdx; c.x = env.getMinX() + step * midIdx; pp.geometryChanged(); centroid = pp; } else { testPoint.geometryChanged(); if(!pg.contains(testPoint)) continue;
private void setPixelPosAttribute(PixelPos pixelPos, boolean updateGeoPos, boolean updateDefaultGeometry) { final Coordinate newCoordinate = toCoordinate(pixelPos); final Coordinate oldCoordinate = getPixelPosAttribute(); if (!ObjectUtils.equalObjects(oldCoordinate, newCoordinate)) { if (oldCoordinate == null) { final GeometryFactory geometryFactory = new GeometryFactory(); setAttributeValue(PROPERTY_NAME_PIXELPOS, geometryFactory.createPoint(newCoordinate)); } else { final Point point = (Point) getAttributeValue(PROPERTY_NAME_PIXELPOS); point.getCoordinate().setCoordinate(newCoordinate); point.geometryChanged(); } // Make sure, object is in a consistent state if (updateDefaultGeometry) { updateDefaultGeometryAttribute(pixelPos); } if (updateGeoPos && getProduct() != null) { final GeoPos geoPos = getGeoPos(); descriptor.updateGeoPos(getProduct().getGeoCoding(), pixelPos, geoPos); setGeoPosAttribute(geoPos, false); } fireProductNodeChanged(PROPERTY_NAME_PIXELPOS); } }