Skip to content

Commit

Permalink
Merge pull request #11297 from craigtaverner/3.4-envelope
Browse files Browse the repository at this point in the history
Remove warnings and allow spatial plugin to extend this class for RTree
  • Loading branch information
craigtaverner committed Mar 18, 2018
2 parents 6daa944 + 83b0b93 commit fd6ae5d
Showing 1 changed file with 3 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

public class Envelope
{
private final double[] min;
private final double[] max;
protected final double[] min;
protected final double[] max;

/**
* Copy constructor
Expand All @@ -36,8 +36,6 @@ public Envelope( Envelope e )

/**
* General constructor for the n-dimensional case
* @param min
* @param max
*/
public Envelope( double[] min, double[] max )
{
Expand All @@ -51,10 +49,6 @@ public Envelope( double[] min, double[] max )

/**
* Special constructor for the 2D case
* @param xmin
* @param xmax
* @param ymin
* @param ymax
*/
public Envelope( double xmin, double xmax, double ymin, double ymax )
{
Expand Down Expand Up @@ -159,8 +153,6 @@ public void expandToInclude( Envelope other )

/**
* Return the distance between the two envelopes on one dimension. This can return negative values if the envelopes intersect on this dimension.
* @param other
* @param dimension
* @return distance between envelopes
*/
public double distance( Envelope other, int dimension )
Expand All @@ -177,8 +169,6 @@ public double distance( Envelope other, int dimension )

/**
* Find the pythagorean distance between two envelopes
* @param other
* @return
*/
public double distance( Envelope other )
{
Expand Down Expand Up @@ -209,7 +199,6 @@ public double getWidth()

/**
* Return the width of the envelope at the specified dimension
* @param dimension
* @return with of that dimension, ie. max[d] - min[d]
*/
public double getWidth( int dimension )
Expand All @@ -220,7 +209,7 @@ public double getWidth( int dimension )
/**
* Return the fractional widths of the envelope at all axes
*
* @param divisor te number of segments to divide by (a 2D envelope will be divided into quadrants using 2)
* @param divisor the number of segments to divide by (a 2D envelope will be divided into quadrants using 2)
* @return double array of widths, ie. max[d] - min[d]
*/
public double[] getWidths( int divisor )
Expand Down Expand Up @@ -271,19 +260,6 @@ private boolean isValid()
return valid;
}

/**
* Move this Envelope by the specified offsets
* @param offset array of offsets
*/
public void translate( double[] offset )
{
for ( int i = 0; i < Math.min(offset.length, min.length); i++ )
{
min[i] += offset[i];
max[i] += offset[i];
}
}

@Override
public String toString()
{
Expand Down

0 comments on commit fd6ae5d

Please sign in to comment.