/** * Creates an envelope for a region defined by maximum and minimum values. * * @param x1 The first x-value. * @param x2 The second x-value. * @param y1 The first y-value. * @param y2 The second y-value. * @param z1 The first y-value. * @param z2 The second y-value. * @param crs The coordinate reference system. * @throws MismatchedDimensionException if the CRS dimension is not valid. */ public Envelope3D( final double x1, final double x2, final double y1, final double y2, final double z1, final double z2) { init(x1, x2, y1, y2, z1, z2); }
/** * Translates this envelope by given amounts in the X and Y direction. Returns the envelope * * @param transX the amount to translate along the X axis * @param transY the amount to translate along the Y axis * @param transZ the amount to translate along the Z axis */ public Envelope3D translate(final double transX, final double transY, final double transZ) { if (isNull()) { return this; } init( getMinX() + transX, getMaxX() + transX, getMinY() + transY, getMaxY() + transY, getMinZ() + transZ, getMaxZ() + transZ); return this; }
/** * Initialize an <code>Envelope</code> for a region defined by maximum and minimum values. * * @param x1 the first x-value * @param x2 the second x-value * @param y1 the first y-value * @param y2 the second y-value * @param z1 the first z-value * @param z2 the second z-value */ public void init( final double x1, final double x2, final double y1, final double y2, final double z1, final double z2) { init(x1, x2, y1, y2); if (z1 < z2) { minz = z1; maxz = z2; } else { minz = z2; maxz = z1; } }
public static Envelope3D of(final Coordinate p) { Envelope3D env = new Envelope3D(); env.init(p); return env; // return of(p.getInnerGeometry()); }
public static Envelope3D of(final Envelope e) { Envelope3D env = new Envelope3D(); env.init(e); return env; }
/** * Creates a new envelope from an existing envelope. * * @param envelope The envelope to initialize from * @throws MismatchedDimensionException if the CRS dimension is not valid. */ public Envelope3D(final Envelope3D envelope) { init(envelope); }
/** * Initialize an <code>Envelope</code> to a region defined by a single Coordinate. * * @param p the coordinate */ @Override public void init(final Coordinate p) { init(p.x, p.x, p.y, p.y, p.z, p.z); }
/** * Initialize an <code>Envelope</code> to a region defined by two Coordinates. * * @param p1 the first Coordinate * @param p2 the second Coordinate */ @Override public void init(final Coordinate p1, final Coordinate p2) { init(p1.x, p2.x, p1.y, p2.y, p1.z, p2.z); }