You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2014/01/03 19:08:00 UTC
svn commit: r1555176 - in
/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean:
oned/ threed/ twod/
Author: luc
Date: Fri Jan 3 18:07:59 2014
New Revision: 1555176
URL: http://svn.apache.org/r1555176
Log:
Deprecating geometry constructors without tolerance setting.
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/oned/IntervalsSet.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/oned/OrientedPoint.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Line.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Plane.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/PolyhedronsSet.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/SubLine.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/Line.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/PolygonsSet.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/SubLine.java
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/oned/IntervalsSet.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/oned/IntervalsSet.java?rev=1555176&r1=1555175&r2=1555176&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/oned/IntervalsSet.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/oned/IntervalsSet.java Fri Jan 3 18:07:59 2014
@@ -96,57 +96,65 @@ public class IntervalsSet extends Abstra
super(boundary, tolerance);
}
-// /** Build an intervals set representing the whole real line.
-// */
-// public IntervalsSet() {
-// super();
-// }
-//
-// /** 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})
-// */
-// public IntervalsSet(final double lower, final double upper) {
-// super(buildTree(lower, upper));
-// }
-//
-// /** 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
-// */
-// public IntervalsSet(final BSPTree<Euclidean1D> tree) {
-// super(tree);
-// }
-//
-// /** 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.math3.geometry.partitioning.Region#checkPoint(org.apache.commons.math3.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
-// */
-// public IntervalsSet(final Collection<SubHyperplane<Euclidean1D>> boundary) {
-// super(boundary);
-// }
+ /** 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.math3.geometry.partitioning.Region#checkPoint(org.apache.commons.math3.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
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/oned/OrientedPoint.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/oned/OrientedPoint.java?rev=1555176&r1=1555175&r2=1555176&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/oned/OrientedPoint.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/oned/OrientedPoint.java Fri Jan 3 18:07:59 2014
@@ -29,6 +29,9 @@ import org.apache.commons.math3.geometry
*/
public class OrientedPoint implements Hyperplane<Euclidean1D> {
+ /** Default value for tolerance. */
+ private static final double DEFAULT_TOLERANCE = 1.0e-10;
+
/** Vector location. */
private Vector1D location;
@@ -51,15 +54,16 @@ public class OrientedPoint implements Hy
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}
-// */
-// public OrientedPoint(final Vector1D location, final boolean direct) {
-// this.location = location;
-// this.direct = direct;
-// }
+ /** 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
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Line.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Line.java?rev=1555176&r1=1555175&r2=1555176&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Line.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Line.java Fri Jan 3 18:07:59 2014
@@ -41,6 +41,9 @@ import org.apache.commons.math3.util.Pre
*/
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;
@@ -74,14 +77,16 @@ public class Line implements Embedding<E
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
-// */
-// public Line(final Vector3D p1, final Vector3D p2) throws MathIllegalArgumentException {
-// reset(p1, p2);
-// }
+ /** 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)
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Plane.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Plane.java?rev=1555176&r1=1555175&r2=1555176&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Plane.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/Plane.java Fri Jan 3 18:07:59 2014
@@ -35,6 +35,9 @@ import org.apache.commons.math3.util.Fas
*/
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;
@@ -97,39 +100,41 @@ public class Plane implements Hyperplane
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
-// */
-// public Plane(final Vector3D normal) throws MathArithmeticException {
-// setNormal(normal);
-// originOffset = 0;
-// setFrame();
-// }
-//
-// /** 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
-// */
-// public Plane(final Vector3D p, final Vector3D normal) throws MathArithmeticException {
-// setNormal(normal);
-// originOffset = -p.dotProduct(w);
-// setFrame();
-// }
-//
-// /** 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
-// */
-// public Plane(final Vector3D p1, final Vector3D p2, final Vector3D p3)
-// throws MathArithmeticException {
-// this(p1, p2.subtract(p1).crossProduct(p3.subtract(p1)));
-// }
+ /** 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
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/PolyhedronsSet.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/PolyhedronsSet.java?rev=1555176&r1=1555175&r2=1555176&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/PolyhedronsSet.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/PolyhedronsSet.java Fri Jan 3 18:07:59 2014
@@ -41,6 +41,9 @@ import org.apache.commons.math3.util.Fas
*/
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
@@ -107,61 +110,70 @@ public class PolyhedronsSet extends Abst
super(buildBoundary(xMin, xMax, yMin, yMax, zMin, zMax, tolerance), tolerance);
}
-// /** Build a polyhedrons set representing the whole real line.
-// */
-// public PolyhedronsSet() {
-// super();
-// }
-//
-// /** 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
-// */
-// public PolyhedronsSet(final BSPTree<Euclidean3D> tree) {
-// super(tree);
-// }
-//
-// /** 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
-// */
-// public PolyhedronsSet(final Collection<SubHyperplane<Euclidean3D>> boundary) {
-// super(boundary);
-// }
-//
-// /** 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
-// */
-// public PolyhedronsSet(final double xMin, final double xMax,
-// final double yMin, final double yMax,
-// final double zMin, final double zMax) {
-// super(buildBoundary(xMin, xMax, yMin, yMax, zMin, zMax));
-// }
+ /** 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
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/SubLine.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/SubLine.java?rev=1555176&r1=1555175&r2=1555176&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/SubLine.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/SubLine.java Fri Jan 3 18:07:59 2014
@@ -33,6 +33,9 @@ import org.apache.commons.math3.geometry
*/
public class SubLine {
+ /** Default value for tolerance. */
+ private static final double DEFAULT_TOLERANCE = 1.0e-10;
+
/** Underlying line. */
private final Line line;
@@ -60,16 +63,16 @@ 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, 1.0e-10);
-// }
+ /** 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
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/Line.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/Line.java?rev=1555176&r1=1555175&r2=1555176&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/Line.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/Line.java Fri Jan 3 18:07:59 2014
@@ -62,6 +62,9 @@ import org.apache.commons.math3.util.Mat
*/
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;
@@ -117,35 +120,26 @@ public class Line implements Hyperplane<
this.tolerance = tolerance;
}
-// /** Build a line from two points.
-// * <p>The line is oriented from p1 to p2</p>
-// * @param p1 first point
-// * @param p2 second point
-// */
-// public Line(final Vector2D p1, final Vector2D p2) {
-// reset(p1, p2);
-// }
-//
-// /** 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
-// */
-// public Line(final Vector2D p, final double angle) {
-// reset(p, angle);
-// }
-//
-// /** Build a line from its internal characteristics.
-// * @param angle angle of the line with respect to abscissa axis
-// * @param cos cosine of the angle
-// * @param sin sine of the angle
-// * @param originOffset offset of the origin
-// */
-// private Line(final double angle, final double cos, final double sin, final double originOffset) {
-// this.angle = angle;
-// this.cos = cos;
-// this.sin = sin;
-// this.originOffset = originOffset;
-// }
+ /** 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
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/PolygonsSet.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/PolygonsSet.java?rev=1555176&r1=1555175&r2=1555176&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/PolygonsSet.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/PolygonsSet.java Fri Jan 3 18:07:59 2014
@@ -43,6 +43,9 @@ import org.apache.commons.math3.util.Fas
*/
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;
@@ -143,60 +146,68 @@ public class PolygonsSet extends Abstrac
super(verticesToTree(hyperplaneThickness, vertices), hyperplaneThickness);
}
-// /** Build a polygons set representing the whole real line.
-// */
-// public PolygonsSet() {
-// super();
-// }
-//
-// /** 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
-// */
-// public PolygonsSet(final BSPTree<Euclidean2D> tree) {
-// super(tree);
-// }
-//
-// /** 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.math3.geometry.partitioning.Region#checkPoint(org.apache.commons.math3.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
-// */
-// public PolygonsSet(final Collection<SubHyperplane<Euclidean2D>> boundary) {
-// super(boundary);
-// }
-//
-// /** 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
-// */
-// public PolygonsSet(final double xMin, final double xMax,
-// final double yMin, final double yMax) {
-// super(boxBoundary(xMin, xMax, yMin, yMax));
-// }
-//
+ /** 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.math3.geometry.partitioning.Region#checkPoint(org.apache.commons.math3.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
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/SubLine.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/SubLine.java?rev=1555176&r1=1555175&r2=1555176&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/SubLine.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/twod/SubLine.java Fri Jan 3 18:07:59 2014
@@ -40,6 +40,9 @@ import org.apache.commons.math3.util.Fas
*/
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
@@ -59,13 +62,15 @@ public class SubLine extends AbstractSub
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
-// */
-// public SubLine(final Vector2D start, final Vector2D end) {
-// super(new Line(start, end), buildIntervalSet(start, end));
-// }
+ /** 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