/** * update the minimum and maximum extents with the given coordinates. * * @param position */ public void update(final Localizable position) { for (int d = 0; d < min.length; d++) { final long p = position.getLongPosition(d); if (p < min[d]) min[d] = p; if (p > max[d]) max[d] = p; } }
@Override public void move(final Localizable localizable) { for (int d = 0; d < n; ++d) { final long distance = localizable.getLongPosition(d); currentPos[d] += distance; } }
@Override public void setPosition(final Localizable localizable) { for (int d = 0; d < n; ++d) { final long position = localizable.getLongPosition(d); currentPos[d] = position; } }
@Override public void move(final Localizable localizable) { for (int d = 0; d < n; ++d) currentPos[d] += localizable.getLongPosition(d); }
/** * Sets the values of the {@link Position} for all dimensions. Throws an exception if any given * value is outside the bounds of the parent {@link Extents}. The position is encoded as an * absolute Localizable vector. */ @Override public void setPosition(final Localizable localizable) { for (int i = 0; i < position.length; i++) setPosition(localizable.getLongPosition(i), i); }
public void updateCenter(final Localizable center) { for (int d = 0; d < numDimensions; ++d) this.center[d] = center.getLongPosition(d); reset(); }