private static void addGCPGrid(final int width, final int height, final int numPins, final ProductNodeGroup<Placemark> group, final GeoCoding targetGeoCoding) { final double ratio = width / (double) height; final double n = Math.sqrt(numPins / ratio); final double m = ratio * n; final double spacingX = width / m; final double spacingY = height / n; final GcpDescriptor gcpDescriptor = GcpDescriptor.getInstance(); group.removeAll(); int pinNumber = group.getNodeCount() + 1; for (double y = spacingY / 2f; y < height; y += spacingY) { for (double x = spacingX / 2f; x < width; x += spacingX) { final String name = PlacemarkNameFactory.createName(gcpDescriptor, pinNumber); final String label = PlacemarkNameFactory.createLabel(gcpDescriptor, pinNumber, true); final Placemark newPin = Placemark.createPointPlacemark(gcpDescriptor, name, label, "", new PixelPos((int) x, (int) y), null, targetGeoCoding); group.add(newPin); ++pinNumber; } } }
private void refreshGroup() { final ProductNodeGroup<Mask> productMaskGroup = product.getMaskGroup(); if (group != productMaskGroup) { final Product.AutoGrouping autoGrouping = product.getAutoGrouping(); if (autoGrouping != null) { final int groupIndex = autoGrouping.indexOf(group.getDisplayName()); group.removeAll(); for (int i = 0; i < productMaskGroup.getNodeCount(); i++) { final Mask mask = productMaskGroup.get(i); if (autoGrouping.indexOf(mask.getName()) == groupIndex) { group.add(mask); } } } } }
private void refreshGroup() { final ProductNodeGroup<Band> productBandGroup = product.getBandGroup(); if (group != productBandGroup) { final Product.AutoGrouping autoGrouping = product.getAutoGrouping(); if (autoGrouping != null) { final int groupIndex = autoGrouping.indexOf(group.getDisplayName()); group.removeAll(); for (int i = 0; i < productBandGroup.getNodeCount(); i++) { final Band band = productBandGroup.get(i); if (autoGrouping.indexOf(band.getName()) == groupIndex) { group.add(band); } } } } }
private void refreshGroup() { final ProductNodeGroup<TiePointGrid> productTiePointGridGroup = product.getTiePointGridGroup(); if (group != productTiePointGridGroup) { final Product.AutoGrouping autoGrouping = product.getAutoGrouping(); if (autoGrouping != null) { final int groupIndex = autoGrouping.indexOf(group.getDisplayName()); group.removeAll(); for (int i = 0; i < productTiePointGridGroup.getNodeCount(); i++) { final TiePointGrid tiePointGrid = productTiePointGridGroup.get(i); if (autoGrouping.indexOf(tiePointGrid.getName()) == groupIndex) { group.add(tiePointGrid); } } } } }
private void addSlaveGCPs(final PolynomialModel warpData, final String bandName) { final GeoCoding targetGeoCoding = targetProduct.getSceneGeoCoding(); final String newName = excludeMaster ? StackUtils.getBandNameWithoutDate(bandName) : bandName; final ProductNodeGroup<Placemark> targetGCPGroup = GCPManager.instance().getGcpGroup(targetProduct.getBand(newName)); targetGCPGroup.removeAll(); final List<Placemark> slaveGCPList = warpData.getSlaveGCPList(); for (final Placemark sPin : slaveGCPList) { final Placemark tPin = Placemark.createPointPlacemark(GcpDescriptor.getInstance(), sPin.getName(), sPin.getLabel(), sPin.getDescription(), sPin.getPixelPos(), sPin.getGeoPos(), targetGeoCoding); targetGCPGroup.add(tPin); } }