Remove deprecated methods in package geometry.

This commit is contained in:
Thomas Neidhart 2015-02-23 23:21:25 +01:00
parent e6fe53fdae
commit e92a76bc1a
12 changed files with 1 additions and 405 deletions

View File

@ -48,15 +48,6 @@ public class Interval {
return lower;
}
/** Get the lower bound of the interval.
* @return lower bound of the interval
* @deprecated as of 3.1, replaced by {@link #getInf()}
*/
@Deprecated
public double getLower() {
return getInf();
}
/** Get the upper bound of the interval.
* @return upper bound of the interval
* @since 3.1
@ -65,15 +56,6 @@ public class Interval {
return upper;
}
/** Get the upper bound of the interval.
* @return upper bound of the interval
* @deprecated as of 3.1, replaced by {@link #getSup()}
*/
@Deprecated
public double getUpper() {
return getSup();
}
/** Get the size of the interval.
* @return size of the interval
* @since 3.1
@ -82,15 +64,6 @@ public class Interval {
return upper - lower;
}
/** Get the length of the interval.
* @return length of the interval
* @deprecated as of 3.1, replaced by {@link #getSize()}
*/
@Deprecated
public double getLength() {
return getSize();
}
/** Get the barycenter of the interval.
* @return barycenter of the interval
* @since 3.1
@ -99,15 +72,6 @@ public class Interval {
return 0.5 * (lower + upper);
}
/** Get the midpoint of the interval.
* @return midpoint of the interval
* @deprecated as of 3.1, replaced by {@link #getBarycenter()}
*/
@Deprecated
public double getMidPoint() {
return getBarycenter();
}
/** Check a point with respect to the interval.
* @param point point to check
* @param tolerance tolerance below which points are considered to

View File

@ -34,9 +34,6 @@ import org.apache.commons.math4.util.Precision;
*/
public class IntervalsSet extends AbstractRegion<Euclidean1D, Euclidean1D> implements Iterable<double[]> {
/** Default value for tolerance. */
private static final double DEFAULT_TOLERANCE = 1.0e-10;
/** Build an intervals set representing the whole real line.
* @param tolerance tolerance below which points are considered identical.
* @since 3.3
@ -98,66 +95,6 @@ public class IntervalsSet extends AbstractRegion<Euclidean1D, Euclidean1D> imple
super(boundary, tolerance);
}
/** Build an intervals set representing the whole real line.
* @deprecated as of 3.1 replaced with {@link #IntervalsSet(double)}
*/
@Deprecated
public IntervalsSet() {
this(DEFAULT_TOLERANCE);
}
/** Build an intervals set corresponding to a single interval.
* @param lower lower bound of the interval, must be lesser or equal
* to {@code upper} (may be {@code Double.NEGATIVE_INFINITY})
* @param upper upper bound of the interval, must be greater or equal
* to {@code lower} (may be {@code Double.POSITIVE_INFINITY})
* @deprecated as of 3.3 replaced with {@link #IntervalsSet(double, double, double)}
*/
@Deprecated
public IntervalsSet(final double lower, final double upper) {
this(lower, upper, DEFAULT_TOLERANCE);
}
/** Build an intervals set from an inside/outside BSP tree.
* <p>The leaf nodes of the BSP tree <em>must</em> have a
* {@code Boolean} attribute representing the inside status of
* the corresponding cell (true for inside cells, false for outside
* cells). In order to avoid building too many small objects, it is
* recommended to use the predefined constants
* {@code Boolean.TRUE} and {@code Boolean.FALSE}</p>
* @param tree inside/outside BSP tree representing the intervals set
* @deprecated as of 3.3, replaced with {@link #IntervalsSet(BSPTree, double)}
*/
@Deprecated
public IntervalsSet(final BSPTree<Euclidean1D> tree) {
this(tree, DEFAULT_TOLERANCE);
}
/** Build an intervals set from a Boundary REPresentation (B-rep).
* <p>The boundary is provided as a collection of {@link
* SubHyperplane sub-hyperplanes}. Each sub-hyperplane has the
* interior part of the region on its minus side and the exterior on
* its plus side.</p>
* <p>The boundary elements can be in any order, and can form
* several non-connected sets (like for example polygons with holes
* or a set of disjoints polyhedrons considered as a whole). In
* fact, the elements do not even need to be connected together
* (their topological connections are not used here). However, if the
* boundary does not really separate an inside open from an outside
* open (open having here its topological meaning), then subsequent
* calls to the {@link
* org.apache.commons.math4.geometry.partitioning.Region#checkPoint(org.apache.commons.math4.geometry.Point)
* checkPoint} method will not be meaningful anymore.</p>
* <p>If the boundary is empty, the region will represent the whole
* space.</p>
* @param boundary collection of boundary elements
* @deprecated as of 3.3, replaced with {@link #IntervalsSet(Collection, double)}
*/
@Deprecated
public IntervalsSet(final Collection<SubHyperplane<Euclidean1D>> boundary) {
this(boundary, DEFAULT_TOLERANCE);
}
/** Build an inside/outside tree representing a single interval.
* @param lower lower bound of the interval, must be lesser or equal
* to {@code upper} (may be {@code Double.NEGATIVE_INFINITY})

View File

@ -28,9 +28,6 @@ import org.apache.commons.math4.geometry.partitioning.Hyperplane;
*/
public class OrientedPoint implements Hyperplane<Euclidean1D> {
/** Default value for tolerance. */
private static final double DEFAULT_TOLERANCE = 1.0e-10;
/** Vector location. */
private Vector1D location;
@ -53,17 +50,6 @@ public class OrientedPoint implements Hyperplane<Euclidean1D> {
this.tolerance = tolerance;
}
/** Simple constructor.
* @param location location of the hyperplane
* @param direct if true, the plus side of the hyperplane is towards
* abscissas greater than {@code location}
* @deprecated as of 3.3, replaced with {@link #OrientedPoint(Vector1D, boolean, double)}
*/
@Deprecated
public OrientedPoint(final Vector1D location, final boolean direct) {
this(location, direct, DEFAULT_TOLERANCE);
}
/** Copy the instance.
* <p>Since instances are immutable, this method directly returns
* the instance.</p>

View File

@ -40,9 +40,6 @@ import org.apache.commons.math4.util.Precision;
*/
public class Line implements Embedding<Euclidean3D, Euclidean1D> {
/** Default value for tolerance. */
private static final double DEFAULT_TOLERANCE = 1.0e-10;
/** Line direction. */
private Vector3D direction;
@ -76,17 +73,6 @@ public class Line implements Embedding<Euclidean3D, Euclidean1D> {
this.tolerance = line.tolerance;
}
/** Build a line from two points.
* @param p1 first point belonging to the line (this can be any point)
* @param p2 second point belonging to the line (this can be any point, different from p1)
* @exception MathIllegalArgumentException if the points are equal
* @deprecated as of 3.3, replaced with {@link #Line(Vector3D, Vector3D, double)}
*/
@Deprecated
public Line(final Vector3D p1, final Vector3D p2) throws MathIllegalArgumentException {
this(p1, p2, DEFAULT_TOLERANCE);
}
/** Reset the instance as if built from two points.
* @param p1 first point belonging to the line (this can be any point)
* @param p2 second point belonging to the line (this can be any point, different from p1)

View File

@ -34,9 +34,6 @@ import org.apache.commons.math4.util.FastMath;
*/
public class Plane implements Hyperplane<Euclidean3D>, Embedding<Euclidean3D, Euclidean2D> {
/** Default value for tolerance. */
private static final double DEFAULT_TOLERANCE = 1.0e-10;
/** Offset of the origin with respect to the plane. */
private double originOffset;
@ -99,44 +96,8 @@ public class Plane implements Hyperplane<Euclidean3D>, Embedding<Euclidean3D, Eu
this(p1, p2.subtract(p1).crossProduct(p3.subtract(p1)), tolerance);
}
/** Build a plane normal to a given direction and containing the origin.
* @param normal normal direction to the plane
* @exception MathArithmeticException if the normal norm is too small
* @deprecated as of 3.3, replaced with {@link #Plane(Vector3D, double)}
*/
@Deprecated
public Plane(final Vector3D normal) throws MathArithmeticException {
this(normal, DEFAULT_TOLERANCE);
}
/** Build a plane from a point and a normal.
* @param p point belonging to the plane
* @param normal normal direction to the plane
* @exception MathArithmeticException if the normal norm is too small
* @deprecated as of 3.3, replaced with {@link #Plane(Vector3D, Vector3D, double)}
*/
@Deprecated
public Plane(final Vector3D p, final Vector3D normal) throws MathArithmeticException {
this(p, normal, DEFAULT_TOLERANCE);
}
/** Build a plane from three points.
* <p>The plane is oriented in the direction of
* {@code (p2-p1) ^ (p3-p1)}</p>
* @param p1 first point belonging to the plane
* @param p2 second point belonging to the plane
* @param p3 third point belonging to the plane
* @exception MathArithmeticException if the points do not constitute a plane
* @deprecated as of 3.3, replaced with {@link #Plane(Vector3D, Vector3D, Vector3D, double)}
*/
@Deprecated
public Plane(final Vector3D p1, final Vector3D p2, final Vector3D p3)
throws MathArithmeticException {
this(p1, p2, p3, DEFAULT_TOLERANCE);
}
/** Copy constructor.
* <p>The instance created is completely independant of the original
* <p>The instance created is completely independent of the original
* one. A deep copy is used, none of the underlying object are
* shared.</p>
* @param plane plane to copy

View File

@ -40,9 +40,6 @@ import org.apache.commons.math4.util.FastMath;
*/
public class PolyhedronsSet extends AbstractRegion<Euclidean3D, Euclidean2D> {
/** Default value for tolerance. */
private static final double DEFAULT_TOLERANCE = 1.0e-10;
/** Build a polyhedrons set representing the whole real line.
* @param tolerance tolerance below which points are considered identical
* @since 3.3
@ -119,71 +116,6 @@ public class PolyhedronsSet extends AbstractRegion<Euclidean3D, Euclidean2D> {
super(buildBoundary(xMin, xMax, yMin, yMax, zMin, zMax, tolerance), tolerance);
}
/** Build a polyhedrons set representing the whole real line.
* @deprecated as of 3.3, replaced with {@link #PolyhedronsSet(double)}
*/
@Deprecated
public PolyhedronsSet() {
this(DEFAULT_TOLERANCE);
}
/** Build a polyhedrons set from a BSP tree.
* <p>The leaf nodes of the BSP tree <em>must</em> have a
* {@code Boolean} attribute representing the inside status of
* the corresponding cell (true for inside cells, false for outside
* cells). In order to avoid building too many small objects, it is
* recommended to use the predefined constants
* {@code Boolean.TRUE} and {@code Boolean.FALSE}</p>
* @param tree inside/outside BSP tree representing the region
* @deprecated as of 3.3, replaced with {@link #PolyhedronsSet(BSPTree, double)}
*/
@Deprecated
public PolyhedronsSet(final BSPTree<Euclidean3D> tree) {
this(tree, DEFAULT_TOLERANCE);
}
/** Build a polyhedrons set from a Boundary REPresentation (B-rep).
* <p>The boundary is provided as a collection of {@link
* SubHyperplane sub-hyperplanes}. Each sub-hyperplane has the
* interior part of the region on its minus side and the exterior on
* its plus side.</p>
* <p>The boundary elements can be in any order, and can form
* several non-connected sets (like for example polyhedrons with holes
* or a set of disjoint polyhedrons considered as a whole). In
* fact, the elements do not even need to be connected together
* (their topological connections are not used here). However, if the
* boundary does not really separate an inside open from an outside
* open (open having here its topological meaning), then subsequent
* calls to the {@link Region#checkPoint(Point) checkPoint} method will
* not be meaningful anymore.</p>
* <p>If the boundary is empty, the region will represent the whole
* space.</p>
* @param boundary collection of boundary elements, as a
* collection of {@link SubHyperplane SubHyperplane} objects
* @deprecated as of 3.3, replaced with {@link #PolyhedronsSet(Collection, double)}
*/
@Deprecated
public PolyhedronsSet(final Collection<SubHyperplane<Euclidean3D>> boundary) {
this(boundary, DEFAULT_TOLERANCE);
}
/** Build a parallellepipedic box.
* @param xMin low bound along the x direction
* @param xMax high bound along the x direction
* @param yMin low bound along the y direction
* @param yMax high bound along the y direction
* @param zMin low bound along the z direction
* @param zMax high bound along the z direction
* @deprecated as of 3.3, replaced with {@link #PolyhedronsSet(double, double,
* double, double, double, double, double)}
*/
@Deprecated
public PolyhedronsSet(final double xMin, final double xMax,
final double yMin, final double yMax,
final double zMin, final double zMax) {
this(xMin, xMax, yMin, yMax, zMin, zMax, DEFAULT_TOLERANCE);
}
/** Build a parallellepipedic box boundary.
* @param xMin low bound along the x direction
* @param xMax high bound along the x direction

View File

@ -32,9 +32,6 @@ import org.apache.commons.math4.geometry.partitioning.Region.Location;
*/
public class SubLine {
/** Default value for tolerance. */
private static final double DEFAULT_TOLERANCE = 1.0e-10;
/** Underlying line. */
private final Line line;
@ -62,17 +59,6 @@ public class SubLine {
this(new Line(start, end, tolerance), buildIntervalSet(start, end, tolerance));
}
/** Create a sub-line from two endpoints.
* @param start start point
* @param end end point
* @exception MathIllegalArgumentException if the points are equal
* @deprecated as of 3.3, replaced with {@link #SubLine(Vector3D, Vector3D, double)}
*/
public SubLine(final Vector3D start, final Vector3D end)
throws MathIllegalArgumentException {
this(start, end, DEFAULT_TOLERANCE);
}
/** Create a sub-line from a segment.
* @param segment single segment forming the sub-line
* @exception MathIllegalArgumentException if the segment endpoints are equal

View File

@ -62,9 +62,6 @@ import org.apache.commons.math4.util.MathUtils;
*/
public class Line implements Hyperplane<Euclidean2D>, Embedding<Euclidean2D, Euclidean1D> {
/** Default value for tolerance. */
private static final double DEFAULT_TOLERANCE = 1.0e-10;
/** Angle with respect to the abscissa axis. */
private double angle;
@ -124,27 +121,6 @@ public class Line implements Hyperplane<Euclidean2D>, Embedding<Euclidean2D, Euc
this.reverse = null;
}
/** Build a line from two points.
* <p>The line is oriented from p1 to p2</p>
* @param p1 first point
* @param p2 second point
* @deprecated as of 3.3, replaced with {@link #Line(Vector2D, Vector2D, double)}
*/
@Deprecated
public Line(final Vector2D p1, final Vector2D p2) {
this(p1, p2, DEFAULT_TOLERANCE);
}
/** Build a line from a point and an angle.
* @param p point belonging to the line
* @param angle angle of the line with respect to abscissa axis
* @deprecated as of 3.3, replaced with {@link #Line(Vector2D, double, double)}
*/
@Deprecated
public Line(final Vector2D p, final double angle) {
this(p, angle, DEFAULT_TOLERANCE);
}
/** Copy constructor.
* <p>The created instance is completely independent from the
* original instance, it is a deep copy.</p>

View File

@ -41,9 +41,6 @@ import org.apache.commons.math4.util.Precision;
*/
public class PolygonsSet extends AbstractRegion<Euclidean2D, Euclidean1D> {
/** Default value for tolerance. */
private static final double DEFAULT_TOLERANCE = 1.0e-10;
/** Vertices organized as boundary loops. */
private Vector2D[][] vertices;
@ -154,68 +151,6 @@ public class PolygonsSet extends AbstractRegion<Euclidean2D, Euclidean1D> {
super(verticesToTree(hyperplaneThickness, vertices), hyperplaneThickness);
}
/** Build a polygons set representing the whole real line.
* @deprecated as of 3.3, replaced with {@link #PolygonsSet(double)}
*/
@Deprecated
public PolygonsSet() {
this(DEFAULT_TOLERANCE);
}
/** Build a polygons set from a BSP tree.
* <p>The leaf nodes of the BSP tree <em>must</em> have a
* {@code Boolean} attribute representing the inside status of
* the corresponding cell (true for inside cells, false for outside
* cells). In order to avoid building too many small objects, it is
* recommended to use the predefined constants
* {@code Boolean.TRUE} and {@code Boolean.FALSE}</p>
* @param tree inside/outside BSP tree representing the region
* @deprecated as of 3.3, replaced with {@link #PolygonsSet(BSPTree, double)}
*/
@Deprecated
public PolygonsSet(final BSPTree<Euclidean2D> tree) {
this(tree, DEFAULT_TOLERANCE);
}
/** Build a polygons set from a Boundary REPresentation (B-rep).
* <p>The boundary is provided as a collection of {@link
* SubHyperplane sub-hyperplanes}. Each sub-hyperplane has the
* interior part of the region on its minus side and the exterior on
* its plus side.</p>
* <p>The boundary elements can be in any order, and can form
* several non-connected sets (like for example polygons with holes
* or a set of disjoint polygons considered as a whole). In
* fact, the elements do not even need to be connected together
* (their topological connections are not used here). However, if the
* boundary does not really separate an inside open from an outside
* open (open having here its topological meaning), then subsequent
* calls to the {@link
* org.apache.commons.math4.geometry.partitioning.Region#checkPoint(org.apache.commons.math4.geometry.Point)
* checkPoint} method will not be meaningful anymore.</p>
* <p>If the boundary is empty, the region will represent the whole
* space.</p>
* @param boundary collection of boundary elements, as a
* collection of {@link SubHyperplane SubHyperplane} objects
* @deprecated as of 3.3, replaced with {@link #PolygonsSet(Collection, double)}
*/
@Deprecated
public PolygonsSet(final Collection<SubHyperplane<Euclidean2D>> boundary) {
this(boundary, DEFAULT_TOLERANCE);
}
/** Build a parallellepipedic box.
* @param xMin low bound along the x direction
* @param xMax high bound along the x direction
* @param yMin low bound along the y direction
* @param yMax high bound along the y direction
* @deprecated as of 3.3, replaced with {@link #PolygonsSet(double, double, double, double, double)}
*/
@Deprecated
public PolygonsSet(final double xMin, final double xMax,
final double yMin, final double yMax) {
this(xMin, xMax, yMin, yMax, DEFAULT_TOLERANCE);
}
/** Create a list of hyperplanes representing the boundary of a box.
* @param xMin low bound along the x direction
* @param xMax high bound along the x direction

View File

@ -39,9 +39,6 @@ import org.apache.commons.math4.util.FastMath;
*/
public class SubLine extends AbstractSubHyperplane<Euclidean2D, Euclidean1D> {
/** Default value for tolerance. */
private static final double DEFAULT_TOLERANCE = 1.0e-10;
/** Simple constructor.
* @param hyperplane underlying hyperplane
* @param remainingRegion remaining region of the hyperplane
@ -61,16 +58,6 @@ public class SubLine extends AbstractSubHyperplane<Euclidean2D, Euclidean1D> {
super(new Line(start, end, tolerance), buildIntervalSet(start, end, tolerance));
}
/** Create a sub-line from two endpoints.
* @param start start point
* @param end end point
* @deprecated as of 3.3, replaced with {@link #SubLine(Vector2D, Vector2D, double)}
*/
@Deprecated
public SubLine(final Vector2D start, final Vector2D end) {
this(start, end, DEFAULT_TOLERANCE);
}
/** Create a sub-line from a segment.
* @param segment single segment forming the sub-line
*/

View File

@ -19,12 +19,9 @@ package org.apache.commons.math4.geometry.partitioning;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.math4.exception.MathIllegalStateException;
import org.apache.commons.math4.exception.MathInternalError;
import org.apache.commons.math4.exception.util.LocalizedFormats;
import org.apache.commons.math4.geometry.Point;
import org.apache.commons.math4.geometry.Space;
import org.apache.commons.math4.geometry.Vector;
import org.apache.commons.math4.util.FastMath;
/** This class represent a Binary Space Partition tree.
@ -305,19 +302,6 @@ public class BSPTree<S extends Space> {
return s;
}
/** Get the cell to which a point belongs.
* <p>If the returned cell is a leaf node the points belongs to the
* interior of the node, if the cell is an internal node the points
* belongs to the node cut sub-hyperplane.</p>
* @param point point to check
* @return the tree cell to which the point belongs
* @deprecated as of 3.3, replaced with {@link #getCell(Point, double)}
*/
@Deprecated
public BSPTree<S> getCell(final Vector<S> point) {
return getCell((Point<S>) point, 1.0e-10);
}
/** Get the cell to which a point belongs.
* <p>If the returned cell is a leaf node the points belongs to the
* interior of the node, if the cell is an internal node the points
@ -633,27 +617,6 @@ public class BSPTree<S extends Space> {
}
/** Insert the instance into another tree.
* <p>The instance itself is modified so its former parent should
* not be used anymore.</p>
* @param parentTree parent tree to connect to (may be null)
* @param isPlusChild if true and if parentTree is not null, the
* resulting tree should be the plus child of its parent, ignored if
* parentTree is null
* @see LeafMerger
* @deprecated as of 3.4, replaced with {@link #insertInTree(BSPTree, boolean, VanishingCutHandler)}
*/
@Deprecated
public void insertInTree(final BSPTree<S> parentTree, final boolean isPlusChild) {
insertInTree(parentTree, isPlusChild, new VanishingCutHandler<S>() {
/** {@inheritDoc} */
public BSPTree<S> fixNode(BSPTree<S> node) {
// the cut should not be null
throw new MathIllegalStateException(LocalizedFormats.NULL_NOT_ALLOWED);
}
});
}
/** Insert the instance into another tree.
* <p>The instance itself is modified so its former parent should
* not be used anymore.</p>

View File

@ -48,23 +48,6 @@ public class BoundaryAttribute<S extends Space> {
/** Sub-hyperplanes that were used to split the boundary part. */
private final NodesSet<S> splitters;
/** Simple constructor.
* @param plusOutside part of the node cut sub-hyperplane that
* belongs to the boundary and has the outside of the region on
* the plus side of its underlying hyperplane (may be null)
* @param plusInside part of the node cut sub-hyperplane that
* belongs to the boundary and has the inside of the region on the
* plus side of its underlying hyperplane (may be null)
* @deprecated as of 3.4, the constructor has been replaced by a new one
* which is not public anymore, as it is intended to be used only by
* {@link BoundaryBuilder}
*/
@Deprecated
public BoundaryAttribute(final SubHyperplane<S> plusOutside,
final SubHyperplane<S> plusInside) {
this(plusOutside, plusInside, null);
}
/** Simple constructor.
* @param plusOutside part of the node cut sub-hyperplane that
* belongs to the boundary and has the outside of the region on