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 2011/05/15 18:02:08 UTC
svn commit: r1103438 [1/2] - in /commons/proper/math/trunk: ./
src/main/java/org/apache/commons/math/exception/util/
src/main/java/org/apache/commons/math/geometry/
src/main/java/org/apache/commons/math/geometry/euclidean/
src/main/java/org/apache/comm...
Author: luc
Date: Sun May 15 16:02:05 2011
New Revision: 1103438
URL: http://svn.apache.org/viewvc?rev=1103438&view=rev
Log:
A complete generic implementation of Binary Space Partitioning Trees (BSP trees)
has been added. A few specializations of this implementation are also provided
for 1D, 2D and 3D Euclidean geometry. This allows support for arbitrary
intervals sets (1D), polygons sets (2D) and polyhedrons sets (3D) with all
sets operations (union, intersection, symmetric difference, difference, complement),
with predicates (point inside/outside/on boundary, emptiness, other region contained),
with geometrical computation (barycenter, size, boundary size) and with conversions
from and to boundary representation.
JIRA: MATH-576
Added:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/Interval.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/Interval.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/IntervalsSet.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/IntervalsSet.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/OrientedPoint.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/OrientedPoint.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/Point1D.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/Point1D.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/package.html (with props)
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/CardanEulerSingularityException.java
- copied, changed from r1103365, commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/CardanEulerSingularityException.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Line.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/Line.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/NotARotationMatrixException.java
- copied, changed from r1103365, commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/NotARotationMatrixException.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/OutlineExtractor.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/OutlineExtractor.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Plane.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/Plane.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Point3D.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/Point3D.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/PolyhedronsSet.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/PolyhedronsSet.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Rotation.java
- copied, changed from r1103365, commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Rotation.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/RotationOrder.java
- copied, changed from r1103365, commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/RotationOrder.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Vector3D.java
- copied, changed from r1103365, commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3D.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Vector3DFormat.java
- copied, changed from r1103365, commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/package.html
- copied unchanged from r1103365, commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/package.html
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Line.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/Line.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/NestedLoops.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/NestedLoops.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Point2D.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/Point2D.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/PolygonsSet.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/PolygonsSet.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Segment.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/Segment.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/SegmentBuilder.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/SegmentBuilder.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/package.html (with props)
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/BSPTree.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/BSPTree.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/BSPTreeVisitor.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/BSPTreeVisitor.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Characterization.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Characterization.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Hyperplane.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Hyperplane.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Point.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Point.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Region.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Region.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/SubHyperplane.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/SubHyperplane.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/SubSpace.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/SubSpace.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Transform.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Transform.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/package.html
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/package.html
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/utilities/
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/utilities/AVLTree.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/utilities/AVLTree.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/utilities/OrderedTuple.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/utilities/OrderedTuple.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/utilities/doc-files/
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/utilities/doc-files/OrderedTuple.png
- copied unchanged from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/utilities/doc-files/OrderedTuple.png
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/utilities/package.html (with props)
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/oneD/
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/oneD/IntervalsSetTest.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/test/java/org/apache/commons/bsp/euclidean/oneD/IntervalsSetTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/threeD/
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/threeD/FrenchVector3DFormatTest.java
- copied, changed from r1103365, commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/FrenchVector3DFormatTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/threeD/LineTest.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/test/java/org/apache/commons/bsp/euclidean/threeD/LineTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/threeD/PlaneTest.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/test/java/org/apache/commons/bsp/euclidean/threeD/PlaneTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/threeD/PolyhedronsSetTest.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/test/java/org/apache/commons/bsp/euclidean/threeD/PolyhedronsSetTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/threeD/RotationOrderTest.java
- copied, changed from r1103365, commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/RotationOrderTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/threeD/RotationTest.java
- copied, changed from r1103365, commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/RotationTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/threeD/Vector3DFormatAbstractTest.java
- copied, changed from r1103365, commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/Vector3DFormatAbstractTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/threeD/Vector3DFormatTest.java
- copied, changed from r1103365, commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/Vector3DFormatTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/threeD/Vector3DTest.java
- copied, changed from r1103365, commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/Vector3DTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/twoD/
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/twoD/LineTest.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/test/java/org/apache/commons/bsp/euclidean/twoD/LineTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/euclidean/twoD/PolygonsSetTest.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/test/java/org/apache/commons/bsp/euclidean/twoD/PolygonsSetTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/partitioning/
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/partitioning/utilities/
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/partitioning/utilities/AVLTreeTest.java
- copied, changed from r1102972, commons/sandbox/bsp/trunk/src/test/java/org/apache/commons/bsp/utilities/AVLTreeTest.java
Removed:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/CardanEulerSingularityException.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/NotARotationMatrixException.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Rotation.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/RotationOrder.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3D.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/package.html
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/FrenchVector3DFormatTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/RotationOrderTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/RotationTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/Vector3DFormatAbstractTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/Vector3DFormatTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/geometry/Vector3DTest.java
Modified:
commons/proper/math/trunk/findbugs-exclude-filter.xml
commons/proper/math/trunk/src/main/java/org/apache/commons/math/exception/util/LocalizedFormats.java
commons/proper/math/trunk/src/site/xdoc/changes.xml
commons/proper/math/trunk/src/site/xdoc/userguide/geometry.xml
commons/proper/math/trunk/src/site/xdoc/userguide/overview.xml
Modified: commons/proper/math/trunk/findbugs-exclude-filter.xml
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/findbugs-exclude-filter.xml?rev=1103438&r1=1103437&r2=1103438&view=diff
==============================================================================
--- commons/proper/math/trunk/findbugs-exclude-filter.xml (original)
+++ commons/proper/math/trunk/findbugs-exclude-filter.xml Sun May 15 16:02:05 2011
@@ -65,7 +65,7 @@
<!-- The following equality test is intentional and needed for semantic purposes -->
<Match>
- <Class name="org.apache.commons.math.geometry.Vector3D" />
+ <Class name="org.apache.commons.math.geometry.euclidean.threeD.Vector3D" />
<Method name="equals" params="java.lang.Object" returns="boolean" />
<Bug pattern="FE_FLOATING_POINT_EQUALITY" />
</Match>
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/exception/util/LocalizedFormats.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/exception/util/LocalizedFormats.java?rev=1103438&r1=1103437&r2=1103438&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/exception/util/LocalizedFormats.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/exception/util/LocalizedFormats.java Sun May 15 16:02:05 2011
@@ -77,6 +77,7 @@ public enum LocalizedFormats implements
CONTRACTION_CRITERIA_SMALLER_THAN_EXPANSION_FACTOR("contraction criteria ({0}) smaller than the expansion factor ({1}). This would lead to a never ending loop of expansion and contraction as a newly expanded internal storage array would immediately satisfy the criteria for contraction."),
CONTRACTION_CRITERIA_SMALLER_THAN_ONE("contraction criteria smaller than one ({0}). This would lead to a never ending loop of expansion and contraction as an internal storage array length equal to the number of elements would satisfy the contraction criteria."),
CONVERGENCE_FAILED("convergence failed"), /* keep */
+ CROSSING_BOUNDARY_LOOPS("some outline boundary loops cross each other"),
CUMULATIVE_PROBABILITY_RETURNED_NAN("Cumulative probability function returned NaN for argument {0} p = {1}"),
DIFFERENT_ROWS_LENGTHS("some rows have length {0} while others have length {1}"),
DIGEST_NOT_INITIALIZED("digest not initialized"),
@@ -163,6 +164,7 @@ public enum LocalizedFormats implements
ROBUSTNESS_ITERATIONS("number of robustness iterations ({0})"),
START_POSITION("start position ({0})"), /* keep */
NON_CONVERGENT_CONTINUED_FRACTION("Continued fraction convergents failed to converge (in less than {0} iterations) for value {1}"),
+ NON_INVERTIBLE_TRANSFORM("non-invertible affine transform collapses some lines into single points"),
NON_POSITIVE_MICROSPHERE_ELEMENTS("number of microsphere elements must be positive, but got {0}"),
NON_POSITIVE_POLYNOMIAL_DEGREE("polynomial degree must be positive: degree={0}"),
NON_REAL_FINITE_ABSCISSA("all abscissae must be finite real numbers, but {0}-th is {1}"),
@@ -219,6 +221,7 @@ public enum LocalizedFormats implements
NOT_STRICTLY_INCREASING_NUMBER_OF_POINTS("points {0} and {1} are not strictly increasing ({2} >= {3})"),
NOT_STRICTLY_INCREASING_SEQUENCE("points {3} and {2} are not strictly increasing ({1} >= {0})"), /* keep */
NOT_SUBTRACTION_COMPATIBLE_MATRICES("{0}x{1} and {2}x{3} matrices are not subtraction compatible"),
+ NOT_SUPPORTED_IN_DIMENSION_N("method not supported in dimension {0}"),
NOT_SYMMETRIC_MATRIX("not symmetric matrix"),
NON_SYMMETRIC_MATRIX("non symmetric matrix: the difference between entries at ({0},{1}) and ({1},{0}) is larger than {2}"), /* keep */
NO_BIN_SELECTED("no bin selected"),
@@ -259,6 +262,7 @@ public enum LocalizedFormats implements
OUT_OF_RANGE_ROOT_OF_UNITY_INDEX("out of range root of unity index {0} (must be in [{1};{2}])"),
OUT_OF_RANGE("out of range"), /* keep */
OUT_OF_RANGE_SIMPLE("{0} out of [{1}, {2}] range"), /* keep */
+ OUTLINE_BOUNDARY_LOOP_OPEN("an outline boundary loop is open"),
OVERFLOW_IN_FRACTION("overflow in fraction {0}/{1}, cannot negate"),
OVERFLOW_IN_ADDITION("overflow in addition: {0} + {1}"),
OVERFLOW_IN_SUBTRACTION("overflow in subtraction: {0} - {1}"),
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/Interval.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/Interval.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/Interval.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/Interval.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/Interval.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/Interval.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/Interval.java Sun May 15 16:02:05 2011
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.oneD;
+package org.apache.commons.math.geometry.euclidean.oneD;
/** This class represents a 1D interval.
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/IntervalsSet.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/IntervalsSet.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/IntervalsSet.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/IntervalsSet.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/IntervalsSet.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/IntervalsSet.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/IntervalsSet.java Sun May 15 16:02:05 2011
@@ -14,15 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.oneD;
+package org.apache.commons.math.geometry.euclidean.oneD;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import org.apache.commons.bsp.partitioning.BSPTree;
-import org.apache.commons.bsp.partitioning.Region;
-import org.apache.commons.bsp.partitioning.SubHyperplane;
+import org.apache.commons.math.geometry.partitioning.BSPTree;
+import org.apache.commons.math.geometry.partitioning.Region;
+import org.apache.commons.math.geometry.partitioning.SubHyperplane;
/** This class represents a 1D region: a set of intervals.
* @version $Revision$ $Date$
@@ -71,7 +71,7 @@ public class IntervalsSet extends Region
* 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(org.apache.commons.bsp.partitioning.Point)
+ * Region#checkPoint(org.apache.commons.math.geometry.partitioning.Point)
* checkPoint} method will not be meaningful anymore.</p>
* <p>If the boundary is empty, the region will represent the whole
* space.</p>
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/OrientedPoint.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/OrientedPoint.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/OrientedPoint.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/OrientedPoint.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/OrientedPoint.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/OrientedPoint.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/OrientedPoint.java Sun May 15 16:02:05 2011
@@ -14,16 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.oneD;
+package org.apache.commons.math.geometry.euclidean.oneD;
-import org.apache.commons.bsp.BSPException;
-import org.apache.commons.bsp.BSPMessages;
-import org.apache.commons.bsp.partitioning.BSPTree;
-import org.apache.commons.bsp.partitioning.Hyperplane;
-import org.apache.commons.bsp.partitioning.Point;
-import org.apache.commons.bsp.partitioning.Region;
-import org.apache.commons.bsp.partitioning.SubHyperplane;
-import org.apache.commons.bsp.partitioning.SubSpace;
+import org.apache.commons.math.exception.MathUnsupportedOperationException;
+import org.apache.commons.math.exception.util.LocalizedFormats;
+import org.apache.commons.math.geometry.partitioning.BSPTree;
+import org.apache.commons.math.geometry.partitioning.Hyperplane;
+import org.apache.commons.math.geometry.partitioning.Point;
+import org.apache.commons.math.geometry.partitioning.Region;
+import org.apache.commons.math.geometry.partitioning.SubHyperplane;
+import org.apache.commons.math.geometry.partitioning.SubSpace;
/** This class represents a 1D oriented hyperplane.
* <p>An hyperplane in 1D is a simple point, its orientation being a
@@ -81,7 +81,7 @@ public class OrientedPoint implements Hy
* @see #toSpace
*/
public Point toSubSpace(final Point point) {
- throw new BSPException(BSPMessages.NOT_SUPPORTED_IN_DIMENSION_N, 1);
+ throw new MathUnsupportedOperationException(LocalizedFormats.NOT_SUPPORTED_IN_DIMENSION_N, 1);
}
/** Transform a sub-space point into a space point.
@@ -95,7 +95,7 @@ public class OrientedPoint implements Hy
* @see #toSubSpace
*/
public Point toSpace(final Point point) {
- throw new BSPException(BSPMessages.NOT_SUPPORTED_IN_DIMENSION_N, 1);
+ throw new MathUnsupportedOperationException(LocalizedFormats.NOT_SUPPORTED_IN_DIMENSION_N, 1);
}
/** Build the sub-space shared by the instance and another hyperplane.
@@ -110,7 +110,7 @@ public class OrientedPoint implements Hy
* instance)
*/
public SubSpace intersection(final Hyperplane other) {
- throw new BSPException(BSPMessages.NOT_SUPPORTED_IN_DIMENSION_N, 1);
+ throw new MathUnsupportedOperationException(LocalizedFormats.NOT_SUPPORTED_IN_DIMENSION_N, 1);
}
/** Build a region covering the whole hyperplane.
@@ -137,7 +137,7 @@ public class OrientedPoint implements Hy
/** Check if the instance has the same orientation as another hyperplane.
* <p>This method is expected to be called on parallel hyperplanes
* (i.e. when the {@link #side side} method would return {@link
- * org.apache.commons.bsp.partitioning.Hyperplane.Side#HYPER}
+ * org.apache.commons.math.geometry.partitioning.Hyperplane.Side#HYPER}
* for some sub-hyperplane having the specified hyperplane
* as its underlying hyperplane). The method should <em>not</em>
* re-check for parallelism, only for orientation, typically by
@@ -154,11 +154,11 @@ public class OrientedPoint implements Hy
/** Compute the relative position of a sub-hyperplane with respect
* to the instance.
* @param sub sub-hyperplane to check
- * @return one of {@link org.apache.commons.bsp.partitioning.Hyperplane.Side#PLUS PLUS},
- * {@link org.apache.commons.bsp.partitioning.Hyperplane.Side#MINUS MINUS}
- * or {@link org.apache.commons.bsp.partitioning.Hyperplane.Side#HYPER HYPER}
+ * @return one of {@link org.apache.commons.math.geometry.partitioning.Hyperplane.Side#PLUS PLUS},
+ * {@link org.apache.commons.math.geometry.partitioning.Hyperplane.Side#MINUS MINUS}
+ * or {@link org.apache.commons.math.geometry.partitioning.Hyperplane.Side#HYPER HYPER}
* (in dimension 1, this method <em>never</em> returns {@link
- * org.apache.commons.bsp.partitioning.Hyperplane.Side#BOTH BOTH})
+ * org.apache.commons.math.geometry.partitioning.Hyperplane.Side#BOTH BOTH})
*
*/
public Side side(final SubHyperplane sub) {
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/Point1D.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/Point1D.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/Point1D.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/Point1D.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/Point1D.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/oneD/Point1D.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/Point1D.java Sun May 15 16:02:05 2011
@@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.oneD;
+package org.apache.commons.math.geometry.euclidean.oneD;
-import org.apache.commons.bsp.partitioning.Point;
+import org.apache.commons.math.geometry.partitioning.Point;
/** This class represents a 1D point.
* <p>Instances of this class are guaranteed to be immutable.</p>
Added: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/package.html
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/package.html?rev=1103438&view=auto
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/package.html (added)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/package.html Sun May 15 16:02:05 2011
@@ -0,0 +1,24 @@
+<html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+ <!-- $Revision$ -->
+<body>
+<p>
+This package provides basic 1D geometry components.
+</p>
+</body>
+</html>
Propchange: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/package.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/oneD/package.html
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/CardanEulerSingularityException.java (from r1103365, commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/CardanEulerSingularityException.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/CardanEulerSingularityException.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/CardanEulerSingularityException.java&p1=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/CardanEulerSingularityException.java&r1=1103365&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/CardanEulerSingularityException.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/CardanEulerSingularityException.java Sun May 15 16:02:05 2011
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.math.geometry;
+package org.apache.commons.math.geometry.euclidean.threeD;
import org.apache.commons.math.MathException;
import org.apache.commons.math.exception.util.LocalizedFormats;
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Line.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/Line.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Line.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Line.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/Line.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/Line.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Line.java Sun May 15 16:02:05 2011
@@ -14,12 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.threeD;
+package org.apache.commons.math.geometry.euclidean.threeD;
-import org.apache.commons.bsp.euclidean.oneD.Point1D;
-import org.apache.commons.bsp.partitioning.Point;
-import org.apache.commons.bsp.partitioning.SubSpace;
-import org.apache.commons.math.geometry.Vector3D;
+import org.apache.commons.math.geometry.euclidean.oneD.Point1D;
+import org.apache.commons.math.geometry.partitioning.Point;
+import org.apache.commons.math.geometry.partitioning.SubSpace;
import org.apache.commons.math.util.FastMath;
/** The class represent lines in a three dimensional space.
@@ -84,7 +83,7 @@ public class Line implements SubSpace {
* @param point point to check (must be a {@link Vector3D Vector3D}
* instance)
* @return abscissa of the point (really a
- * {org.apache.commons.bsp.euclidean.oneD.Point1D Point1D} instance)
+ * {org.apache.commons.math.geometry.euclidean.oneD.Point1D Point1D} instance)
*/
public Point toSubSpace(final Point point) {
final double x = Vector3D.dotProduct(((Vector3D) point).subtract(zero), direction);
@@ -93,7 +92,7 @@ public class Line implements SubSpace {
/** Get one point from the line.
* @param point desired abscissa for the point (must be a
- * {org.apache.commons.bsp.euclidean.oneD.Point1D Point1D} instance)
+ * {org.apache.commons.math.geometry.euclidean.oneD.Point1D Point1D} instance)
* @return one point belonging to the line, at specified abscissa
* (really a {@link Vector3D Vector3D} instance)
*/
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/NotARotationMatrixException.java (from r1103365, commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/NotARotationMatrixException.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/NotARotationMatrixException.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/NotARotationMatrixException.java&p1=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/NotARotationMatrixException.java&r1=1103365&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/NotARotationMatrixException.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/NotARotationMatrixException.java Sun May 15 16:02:05 2011
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.math.geometry;
+package org.apache.commons.math.geometry.euclidean.threeD;
import org.apache.commons.math.MathException;
import org.apache.commons.math.exception.util.Localizable;
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/OutlineExtractor.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/OutlineExtractor.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/OutlineExtractor.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/OutlineExtractor.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/OutlineExtractor.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/OutlineExtractor.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/OutlineExtractor.java Sun May 15 16:02:05 2011
@@ -14,16 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.threeD;
+package org.apache.commons.math.geometry.euclidean.threeD;
-import org.apache.commons.bsp.euclidean.twoD.Line;
-import org.apache.commons.bsp.euclidean.twoD.Point2D;
-import org.apache.commons.bsp.euclidean.twoD.PolygonsSet;
-import org.apache.commons.bsp.partitioning.BSPTree;
-import org.apache.commons.bsp.partitioning.BSPTreeVisitor;
-import org.apache.commons.bsp.partitioning.Region;
-import org.apache.commons.bsp.partitioning.SubHyperplane;
-import org.apache.commons.math.geometry.Vector3D;
+import org.apache.commons.math.geometry.euclidean.twoD.Point2D;
+import org.apache.commons.math.geometry.euclidean.twoD.PolygonsSet;
+import org.apache.commons.math.geometry.partitioning.BSPTree;
+import org.apache.commons.math.geometry.partitioning.BSPTreeVisitor;
+import org.apache.commons.math.geometry.partitioning.Region;
+import org.apache.commons.math.geometry.partitioning.SubHyperplane;
import org.apache.commons.math.util.FastMath;
import java.util.ArrayList;
@@ -202,14 +200,16 @@ public class OutlineExtractor {
final Vector3D current3D = (Vector3D) plane.toSpace(loop[current]);
final Point2D cPoint = new Point2D(Vector3D.dotProduct(current3D, u),
Vector3D.dotProduct(current3D, v));
- final Line line = new Line(pPoint, cPoint);
+ final org.apache.commons.math.geometry.euclidean.twoD.Line line =
+ new org.apache.commons.math.geometry.euclidean.twoD.Line(pPoint, cPoint);
SubHyperplane edge = new SubHyperplane(line);
if (closed || (previous != 1)) {
// the previous point is a real vertex
// it defines one bounding point of the edge
final double angle = line.getAngle() + 0.5 * FastMath.PI;
- final Line l = new Line(pPoint, angle);
+ final org.apache.commons.math.geometry.euclidean.twoD.Line l =
+ new org.apache.commons.math.geometry.euclidean.twoD.Line(pPoint, angle);
edge = l.split(edge).getPlus();
}
@@ -217,7 +217,8 @@ public class OutlineExtractor {
// the current point is a real vertex
// it defines one bounding point of the edge
final double angle = line.getAngle() + 0.5 * FastMath.PI;
- final Line l = new Line(cPoint, angle);
+ final org.apache.commons.math.geometry.euclidean.twoD.Line l =
+ new org.apache.commons.math.geometry.euclidean.twoD.Line(cPoint, angle);
edge = l.split(edge).getMinus();
}
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Plane.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/Plane.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Plane.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Plane.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/Plane.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/Plane.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Plane.java Sun May 15 16:02:05 2011
@@ -14,19 +14,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.threeD;
+package org.apache.commons.math.geometry.euclidean.threeD;
-import org.apache.commons.bsp.euclidean.oneD.Point1D;
-import org.apache.commons.bsp.euclidean.twoD.Point2D;
-import org.apache.commons.bsp.euclidean.twoD.PolygonsSet;
-import org.apache.commons.bsp.partitioning.BSPTree;
-import org.apache.commons.bsp.partitioning.Hyperplane;
-import org.apache.commons.bsp.partitioning.Point;
-import org.apache.commons.bsp.partitioning.Region;
-import org.apache.commons.bsp.partitioning.SubHyperplane;
-import org.apache.commons.bsp.partitioning.SubSpace;
-import org.apache.commons.math.geometry.Rotation;
-import org.apache.commons.math.geometry.Vector3D;
+import org.apache.commons.math.geometry.euclidean.oneD.Point1D;
+import org.apache.commons.math.geometry.euclidean.twoD.Point2D;
+import org.apache.commons.math.geometry.euclidean.twoD.PolygonsSet;
+import org.apache.commons.math.geometry.partitioning.BSPTree;
+import org.apache.commons.math.geometry.partitioning.Hyperplane;
+import org.apache.commons.math.geometry.partitioning.Point;
+import org.apache.commons.math.geometry.partitioning.Region;
+import org.apache.commons.math.geometry.partitioning.SubHyperplane;
+import org.apache.commons.math.geometry.partitioning.SubSpace;
import org.apache.commons.math.util.FastMath;
/** The class represent planes in a three dimensional space.
@@ -219,7 +217,7 @@ public class Plane implements Hyperplane
* @param point point of the space (must be a {@link Vector3D
* Vector3D} instance)
* @return in-plane point (really a {@link
- * org.apache.commons.bsp.euclidean.twoD.Point2D Point2D} instance)
+ * org.apache.commons.math.geometry.euclidean.twoD.Point2D Point2D} instance)
* @see #toSpace
*/
public Point toSubSpace(final Point point) {
@@ -230,7 +228,7 @@ public class Plane implements Hyperplane
/** Transform an in-plane point into a 3D space point.
* @param point in-plane point (must be a {@link
- * org.apache.commons.bsp.euclidean.twoD.Point2D Point2D} instance)
+ * org.apache.commons.math.geometry.euclidean.twoD.Point2D Point2D} instance)
* @return 3D space point (really a {@link Vector3D Vector3D} instance)
* @see #toSubSpace
*/
@@ -434,10 +432,10 @@ public class Plane implements Hyperplane
/** Compute the relative position of a sub-hyperplane with respect
* to the instance.
* @param sub sub-hyperplane to check
- * @return one of {@link org.apache.commons.bsp.partitioning.Hyperplane.Side#PLUS PLUS},
- * {@link org.apache.commons.bsp.partitioning.Hyperplane.Side#MINUS MINUS},
- * {@link org.apache.commons.bsp.partitioning.Hyperplane.Side#BOTH BOTH},
- * {@link org.apache.commons.bsp.partitioning.Hyperplane.Side#HYPER HYPER}
+ * @return one of {@link org.apache.commons.math.geometry.partitioning.Hyperplane.Side#PLUS PLUS},
+ * {@link org.apache.commons.math.geometry.partitioning.Hyperplane.Side#MINUS MINUS},
+ * {@link org.apache.commons.math.geometry.partitioning.Hyperplane.Side#BOTH BOTH},
+ * {@link org.apache.commons.math.geometry.partitioning.Hyperplane.Side#HYPER HYPER}
*/
public Side side(final SubHyperplane sub) {
@@ -467,7 +465,7 @@ public class Plane implements Hyperplane
p = q;
q = tmp;
}
- final Hyperplane line2D = new org.apache.commons.bsp.euclidean.twoD.Line(p, q);
+ final Hyperplane line2D = new org.apache.commons.math.geometry.euclidean.twoD.Line(p, q);
// check the side on the 2D plane
return sub.getRemainingRegion().side(line2D);
@@ -502,9 +500,9 @@ public class Plane implements Hyperplane
q = tmp;
}
final SubHyperplane l2DMinus =
- new SubHyperplane(new org.apache.commons.bsp.euclidean.twoD.Line(p, q));
+ new SubHyperplane(new org.apache.commons.math.geometry.euclidean.twoD.Line(p, q));
final SubHyperplane l2DPlus =
- new SubHyperplane(new org.apache.commons.bsp.euclidean.twoD.Line(q, p));
+ new SubHyperplane(new org.apache.commons.math.geometry.euclidean.twoD.Line(q, p));
final BSPTree splitTree =
sub.getRemainingRegion().getTree(false).split(l2DMinus);
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Point3D.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/Point3D.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Point3D.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Point3D.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/Point3D.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/Point3D.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Point3D.java Sun May 15 16:02:05 2011
@@ -14,10 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.threeD;
+package org.apache.commons.math.geometry.euclidean.threeD;
-import org.apache.commons.bsp.partitioning.Point;
-import org.apache.commons.math.geometry.Vector3D;
+import org.apache.commons.math.geometry.partitioning.Point;
/** This class represents a 3D point.
* <p>Instances of this class are guaranteed to be immutable.</p>
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/PolyhedronsSet.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/PolyhedronsSet.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/PolyhedronsSet.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/PolyhedronsSet.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/PolyhedronsSet.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/threeD/PolyhedronsSet.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/PolyhedronsSet.java Sun May 15 16:02:05 2011
@@ -14,22 +14,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.threeD;
+package org.apache.commons.math.geometry.euclidean.threeD;
import java.awt.geom.AffineTransform;
import java.util.Arrays;
import java.util.Collection;
-import org.apache.commons.bsp.euclidean.twoD.Point2D;
-import org.apache.commons.bsp.partitioning.BSPTree;
-import org.apache.commons.bsp.partitioning.BSPTreeVisitor;
-import org.apache.commons.bsp.partitioning.Hyperplane;
-import org.apache.commons.bsp.partitioning.Point;
-import org.apache.commons.bsp.partitioning.Region;
-import org.apache.commons.bsp.partitioning.SubHyperplane;
-import org.apache.commons.bsp.partitioning.Transform;
-import org.apache.commons.math.geometry.Rotation;
-import org.apache.commons.math.geometry.Vector3D;
+import org.apache.commons.math.geometry.euclidean.twoD.Point2D;
+import org.apache.commons.math.geometry.partitioning.BSPTree;
+import org.apache.commons.math.geometry.partitioning.BSPTreeVisitor;
+import org.apache.commons.math.geometry.partitioning.Hyperplane;
+import org.apache.commons.math.geometry.partitioning.Point;
+import org.apache.commons.math.geometry.partitioning.Region;
+import org.apache.commons.math.geometry.partitioning.SubHyperplane;
+import org.apache.commons.math.geometry.partitioning.Transform;
import org.apache.commons.math.util.FastMath;
/** This class represents a 3D region: a set of polyhedrons.
@@ -342,8 +340,7 @@ public class PolyhedronsSet extends Regi
tP00.getX(), tP00.getY());
cachedOriginal = original;
- cachedTransform =
- org.apache.commons.bsp.euclidean.twoD.Line.getTransform(at);
+ cachedTransform = org.apache.commons.math.geometry.euclidean.twoD.Line.getTransform(at);
}
return sub.applyTransform(cachedTransform);
@@ -403,7 +400,7 @@ public class PolyhedronsSet extends Regi
cachedOriginal = original;
cachedTransform =
- org.apache.commons.bsp.euclidean.twoD.Line.getTransform(at);
+ org.apache.commons.math.geometry.euclidean.twoD.Line.getTransform(at);
}
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Rotation.java (from r1103365, commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Rotation.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Rotation.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Rotation.java&p1=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Rotation.java&r1=1103365&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Rotation.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Rotation.java Sun May 15 16:02:05 2011
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.math.geometry;
+package org.apache.commons.math.geometry.euclidean.threeD;
import java.io.Serializable;
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/RotationOrder.java (from r1103365, commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/RotationOrder.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/RotationOrder.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/RotationOrder.java&p1=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/RotationOrder.java&r1=1103365&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/RotationOrder.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/RotationOrder.java Sun May 15 16:02:05 2011
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.math.geometry;
+package org.apache.commons.math.geometry.euclidean.threeD;
/**
* This class is a utility representing a rotation order specification
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Vector3D.java (from r1103365, commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3D.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Vector3D.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Vector3D.java&p1=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3D.java&r1=1103365&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3D.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Vector3D.java Sun May 15 16:02:05 2011
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.math.geometry;
+package org.apache.commons.math.geometry.euclidean.threeD;
import java.io.Serializable;
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Vector3DFormat.java (from r1103365, commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Vector3DFormat.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Vector3DFormat.java&p1=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java&r1=1103365&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/threeD/Vector3DFormat.java Sun May 15 16:02:05 2011
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.math.geometry;
+package org.apache.commons.math.geometry.euclidean.threeD;
import java.text.FieldPosition;
import java.text.NumberFormat;
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Line.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/Line.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Line.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Line.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/Line.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/Line.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Line.java Sun May 15 16:02:05 2011
@@ -14,22 +14,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.twoD;
+package org.apache.commons.math.geometry.euclidean.twoD;
import java.awt.geom.AffineTransform;
-import org.apache.commons.bsp.BSPException;
-import org.apache.commons.bsp.BSPMessages;
-import org.apache.commons.bsp.euclidean.oneD.IntervalsSet;
-import org.apache.commons.bsp.euclidean.oneD.OrientedPoint;
-import org.apache.commons.bsp.euclidean.oneD.Point1D;
-import org.apache.commons.bsp.partitioning.BSPTree;
-import org.apache.commons.bsp.partitioning.Hyperplane;
-import org.apache.commons.bsp.partitioning.Point;
-import org.apache.commons.bsp.partitioning.Region;
-import org.apache.commons.bsp.partitioning.SubHyperplane;
-import org.apache.commons.bsp.partitioning.SubSpace;
-import org.apache.commons.bsp.partitioning.Transform;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
+import org.apache.commons.math.exception.util.LocalizedFormats;
+import org.apache.commons.math.geometry.euclidean.oneD.IntervalsSet;
+import org.apache.commons.math.geometry.euclidean.oneD.OrientedPoint;
+import org.apache.commons.math.geometry.euclidean.oneD.Point1D;
+import org.apache.commons.math.geometry.partitioning.BSPTree;
+import org.apache.commons.math.geometry.partitioning.Hyperplane;
+import org.apache.commons.math.geometry.partitioning.Point;
+import org.apache.commons.math.geometry.partitioning.Region;
+import org.apache.commons.math.geometry.partitioning.SubHyperplane;
+import org.apache.commons.math.geometry.partitioning.SubSpace;
+import org.apache.commons.math.geometry.partitioning.Transform;
import org.apache.commons.math.util.FastMath;
import org.apache.commons.math.util.MathUtils;
@@ -180,7 +180,7 @@ public class Line implements Hyperplane
* @param point 2D point (must be a {@link Point2D Point2D}
* instance)
* @return line point corresponding to the 2D point (really a {@link
- * org.apache.commons.bsp.euclidean.oneD.Point1D Point1D} instance)
+ * org.apache.commons.math.geometry.euclidean.oneD.Point1D Point1D} instance)
* @see #toSpace
*/
public Point toSubSpace(final Point point) {
@@ -190,7 +190,7 @@ public class Line implements Hyperplane
/** Get one point from the line.
* @param point desired abscissa for the point (must be a {@link
- * org.apache.commons.bsp.euclidean.oneD.Point1D Point1D} instance)
+ * org.apache.commons.math.geometry.euclidean.oneD.Point1D Point1D} instance)
* @return line point at specified abscissa (really a {@link Point2D
* Point2D} instance)
*/
@@ -261,7 +261,7 @@ public class Line implements Hyperplane
/** Check if the instance has the same orientation as another hyperplane.
* <p>This method is expected to be called on parallel hyperplanes
* (i.e. when the {@link #side side} method would return {@link
- * org.apache.commons.bsp.partitioning.Hyperplane.Side#HYPER HYPER}
+ * org.apache.commons.math.geometry.partitioning.Hyperplane.Side#HYPER HYPER}
* for some sub-hyperplane having the specified hyperplane
* as its underlying hyperplane). The method should <em>not</em>
* re-check for parallelism, only for orientation, typically by
@@ -345,10 +345,10 @@ public class Line implements Hyperplane
/** Compute the relative position of a sub-hyperplane with respect
* to the instance.
* @param sub sub-hyperplane to check
- * @return one of {@link org.apache.commons.bsp.partitioning.Hyperplane.Side#PLUS PLUS},
- * {@link org.apache.commons.bsp.partitioning.Hyperplane.Side#MINUS MINUS},
- * {@link org.apache.commons.bsp.partitioning.Hyperplane.Side#BOTH BOTH},
- * {@link org.apache.commons.bsp.partitioning.Hyperplane.Side#HYPER HYPER}
+ * @return one of {@link org.apache.commons.math.geometry.partitioning.Hyperplane.Side#PLUS PLUS},
+ * {@link org.apache.commons.math.geometry.partitioning.Hyperplane.Side#MINUS MINUS},
+ * {@link org.apache.commons.math.geometry.partitioning.Hyperplane.Side#BOTH BOTH},
+ * {@link org.apache.commons.math.geometry.partitioning.Hyperplane.Side#HYPER HYPER}
*/
public Side side(final SubHyperplane sub) {
@@ -411,20 +411,20 @@ public class Line implements Hyperplane
}
- /** Get a {@link org.apache.commons.bsp.partitioning.Transform
+ /** Get a {@link org.apache.commons.math.geometry.partitioning.Transform
* Transform} embedding an affine transform.
* @param transform affine transform to embed (must be inversible
* otherwise the {@link
- * org.apache.commons.bsp.partitioning.Transform#apply(Hyperplane)
+ * org.apache.commons.math.geometry.partitioning.Transform#apply(Hyperplane)
* apply(Hyperplane)} method would work only for some lines, and
* fail for other ones)
* @return a new transform that can be applied to either {@link
* Point2D Point2D}, {@link Line Line} or {@link
- * org.apache.commons.bsp.partitioning.SubHyperplane
+ * org.apache.commons.math.geometry.partitioning.SubHyperplane
* SubHyperplane} instances
- * @exception BSPException if the transform is non invertible
+ * @exception MathIllegalArgumentException if the transform is non invertible
*/
- public static Transform getTransform(final AffineTransform transform) throws BSPException {
+ public static Transform getTransform(final AffineTransform transform) throws MathIllegalArgumentException {
return new LineTransform(transform);
}
@@ -454,9 +454,9 @@ public class Line implements Hyperplane
* @param transform transform to use (must be invertible otherwise
* the {@link LineTransform#apply(Hyperplane)} method would work
* only for some lines, and fail for other ones)
- * @exception BSPException if the transform is non invertible
+ * @exception MathIllegalArgumentException if the transform is non invertible
*/
- public LineTransform(final AffineTransform transform) throws BSPException {
+ public LineTransform(final AffineTransform transform) throws MathIllegalArgumentException {
final double[] m = new double[6];
transform.getMatrix(m);
@@ -472,7 +472,7 @@ public class Line implements Hyperplane
c11 = cXX * cYY - cYX * cXY;
if (FastMath.abs(c11) < 1.0e-20) {
- throw new BSPException(BSPMessages.NON_INVERTIBLE_TRANSFORM);
+ throw new MathIllegalArgumentException(LocalizedFormats.NON_INVERTIBLE_TRANSFORM);
}
}
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/NestedLoops.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/NestedLoops.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/NestedLoops.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/NestedLoops.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/NestedLoops.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/NestedLoops.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/NestedLoops.java Sun May 15 16:02:05 2011
@@ -14,20 +14,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.twoD;
+package org.apache.commons.math.geometry.euclidean.twoD;
-import org.apache.commons.bsp.BSPException;
-import org.apache.commons.bsp.BSPMessages;
-import org.apache.commons.bsp.euclidean.oneD.OrientedPoint;
-import org.apache.commons.bsp.euclidean.oneD.Point1D;
-import org.apache.commons.bsp.partitioning.Hyperplane;
-import org.apache.commons.bsp.partitioning.Region;
-import org.apache.commons.bsp.partitioning.SubHyperplane;
-
-import java.util.Arrays;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
+import org.apache.commons.math.exception.util.LocalizedFormats;
+import org.apache.commons.math.geometry.euclidean.oneD.OrientedPoint;
+import org.apache.commons.math.geometry.euclidean.oneD.Point1D;
+import org.apache.commons.math.geometry.partitioning.Hyperplane;
+import org.apache.commons.math.geometry.partitioning.Region;
+import org.apache.commons.math.geometry.partitioning.SubHyperplane;
+
/** This class represent a tree of nested 2D boundary loops.
* <p>This class is used during Piece instances construction.
@@ -72,12 +72,12 @@ class NestedLoops {
/** Constructor.
* <p>Build a tree node with neither parent nor children</p>
* @param loop boundary loop (will be reversed in place if needed)
- * @exception BSPException if an outline has an open boundary loop
+ * @exception MathIllegalArgumentException if an outline has an open boundary loop
*/
- private NestedLoops(final Point2D[] loop) throws BSPException {
+ private NestedLoops(final Point2D[] loop) throws MathIllegalArgumentException {
if (loop[0] == null) {
- throw new BSPException(BSPMessages.OUTLINE_BOUNDARY_LOOP_OPEN);
+ throw new MathIllegalArgumentException(LocalizedFormats.OUTLINE_BOUNDARY_LOOP_OPEN);
}
this.loop = loop;
@@ -110,19 +110,19 @@ class NestedLoops {
/** Add a loop in a tree.
* @param bLoop boundary loop (will be reversed in place if needed)
- * @exception BSPException if an outline has crossing
+ * @exception MathIllegalArgumentException if an outline has crossing
* boundary loops or open boundary loops
*/
- public void add(final Point2D[] bLoop) throws BSPException {
+ public void add(final Point2D[] bLoop) throws MathIllegalArgumentException {
add(new NestedLoops(bLoop));
}
/** Add a loop in a tree.
* @param node boundary loop (will be reversed in place if needed)
- * @exception BSPException if an outline has boundary
+ * @exception MathIllegalArgumentException if an outline has boundary
* loops that cross each other
*/
- private void add(final NestedLoops node) throws BSPException {
+ private void add(final NestedLoops node) throws MathIllegalArgumentException {
// check if we can go deeper in the tree
for (final NestedLoops child : surrounded) {
@@ -144,7 +144,7 @@ class NestedLoops {
// we should be separate from the remaining children
for (final NestedLoops child : surrounded) {
if (!Region.intersection(node.polygon, child.polygon).isEmpty()) {
- throw new BSPException(BSPMessages.CROSSING_BOUNDARY_LOOPS);
+ throw new MathIllegalArgumentException(LocalizedFormats.CROSSING_BOUNDARY_LOOPS);
}
}
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Point2D.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/Point2D.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Point2D.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Point2D.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/Point2D.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/Point2D.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Point2D.java Sun May 15 16:02:05 2011
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.twoD;
+package org.apache.commons.math.geometry.euclidean.twoD;
-import org.apache.commons.bsp.partitioning.Point;
-import org.apache.commons.bsp.partitioning.SubSpace;
+import org.apache.commons.math.geometry.partitioning.Point;
+import org.apache.commons.math.geometry.partitioning.SubSpace;
/** This class represents a 2D point.
* <p>Instances of this class are guaranteed to be immutable.</p>
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/PolygonsSet.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/PolygonsSet.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/PolygonsSet.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/PolygonsSet.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/PolygonsSet.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/PolygonsSet.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/PolygonsSet.java Sun May 15 16:02:05 2011
@@ -14,19 +14,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.twoD;
+package org.apache.commons.math.geometry.euclidean.twoD;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
-import org.apache.commons.bsp.euclidean.oneD.Point1D;
-import org.apache.commons.bsp.partitioning.BSPTree;
-import org.apache.commons.bsp.partitioning.Hyperplane;
-import org.apache.commons.bsp.partitioning.Region;
-import org.apache.commons.bsp.partitioning.SubHyperplane;
-import org.apache.commons.bsp.utilities.AVLTree;
+import org.apache.commons.math.geometry.euclidean.oneD.Point1D;
+import org.apache.commons.math.geometry.partitioning.BSPTree;
+import org.apache.commons.math.geometry.partitioning.Hyperplane;
+import org.apache.commons.math.geometry.partitioning.Region;
+import org.apache.commons.math.geometry.partitioning.SubHyperplane;
+import org.apache.commons.math.geometry.partitioning.utilities.AVLTree;
import org.apache.commons.math.util.FastMath;
/** This class represents a 2D region: a set of polygons.
@@ -69,7 +69,7 @@ public class PolygonsSet extends Region
* 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(org.apache.commons.bsp.partitioning.Point)
+ * Region#checkPoint(org.apache.commons.math.geometry.partitioning.Point)
* checkPoint} method will not be meaningful anymore.</p>
* <p>If the boundary is empty, the region will represent the whole
* space.</p>
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Segment.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/Segment.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Segment.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Segment.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/Segment.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/Segment.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/Segment.java Sun May 15 16:02:05 2011
@@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.twoD;
+package org.apache.commons.math.geometry.euclidean.twoD;
-import org.apache.commons.bsp.utilities.OrderedTuple;
+import org.apache.commons.math.geometry.partitioning.utilities.OrderedTuple;
/** This class holds segments information before they are connected.
* @version $Revision$ $Date$
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/SegmentBuilder.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/SegmentBuilder.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/SegmentBuilder.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/SegmentBuilder.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/SegmentBuilder.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/euclidean/twoD/SegmentBuilder.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/SegmentBuilder.java Sun May 15 16:02:05 2011
@@ -14,18 +14,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.euclidean.twoD;
+package org.apache.commons.math.geometry.euclidean.twoD;
import java.util.List;
-import org.apache.commons.bsp.euclidean.oneD.Interval;
-import org.apache.commons.bsp.euclidean.oneD.IntervalsSet;
-import org.apache.commons.bsp.euclidean.oneD.Point1D;
-import org.apache.commons.bsp.partitioning.BSPTree;
-import org.apache.commons.bsp.partitioning.BSPTreeVisitor;
-import org.apache.commons.bsp.partitioning.SubHyperplane;
-import org.apache.commons.bsp.partitioning.Region.BoundaryAttribute;
-import org.apache.commons.bsp.utilities.AVLTree;
+import org.apache.commons.math.geometry.euclidean.oneD.Interval;
+import org.apache.commons.math.geometry.euclidean.oneD.IntervalsSet;
+import org.apache.commons.math.geometry.euclidean.oneD.Point1D;
+import org.apache.commons.math.geometry.partitioning.BSPTree;
+import org.apache.commons.math.geometry.partitioning.BSPTreeVisitor;
+import org.apache.commons.math.geometry.partitioning.Region.BoundaryAttribute;
+import org.apache.commons.math.geometry.partitioning.SubHyperplane;
+import org.apache.commons.math.geometry.partitioning.utilities.AVLTree;
/** Visitor building segments.
* @version $Revision$ $Date$
Added: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/package.html
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/package.html?rev=1103438&view=auto
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/package.html (added)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/package.html Sun May 15 16:02:05 2011
@@ -0,0 +1,24 @@
+<html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+ <!-- $Revision$ -->
+<body>
+<p>
+This package provides basic 2D geometry components.
+</p>
+</body>
+</html>
Propchange: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/package.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/euclidean/twoD/package.html
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/BSPTree.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/BSPTree.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/BSPTree.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/BSPTree.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/BSPTree.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/BSPTree.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/BSPTree.java Sun May 15 16:02:05 2011
@@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.partitioning;
+package org.apache.commons.math.geometry.partitioning;
-import org.apache.commons.bsp.partitioning.Hyperplane.Side;
+import org.apache.commons.math.geometry.partitioning.Hyperplane.Side;
import org.apache.commons.math.util.FastMath;
/** This class represent a Binary Space Partition tree.
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/BSPTreeVisitor.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/BSPTreeVisitor.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/BSPTreeVisitor.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/BSPTreeVisitor.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/BSPTreeVisitor.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/BSPTreeVisitor.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/BSPTreeVisitor.java Sun May 15 16:02:05 2011
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.partitioning;
+package org.apache.commons.math.geometry.partitioning;
/** This interface is used to visit {@link BSPTree BSP tree} nodes.
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Characterization.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Characterization.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Characterization.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Characterization.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Characterization.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Characterization.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Characterization.java Sun May 15 16:02:05 2011
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.partitioning;
+package org.apache.commons.math.geometry.partitioning;
/** Characterization of a sub-hyperplane.
* @version $Revision$ $Date$
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Hyperplane.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Hyperplane.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Hyperplane.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Hyperplane.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Hyperplane.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Hyperplane.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Hyperplane.java Sun May 15 16:02:05 2011
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.partitioning;
+package org.apache.commons.math.geometry.partitioning;
/** This interface represents an hyperplane of a space.
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Point.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Point.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Point.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Point.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Point.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Point.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Point.java Sun May 15 16:02:05 2011
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.partitioning;
+package org.apache.commons.math.geometry.partitioning;
/** This interface represents a generic point to be used in a space partition.
* <p>Points are completely virtual entities with no specification at
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Region.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Region.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Region.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Region.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Region.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Region.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Region.java Sun May 15 16:02:05 2011
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.partitioning;
+package org.apache.commons.math.geometry.partitioning;
import java.util.Collection;
import java.util.TreeSet;
@@ -609,6 +609,9 @@ public abstract class Region {
public void visitLeafNode(final BSPTree node) {
}
+ /** Get the size of the boundary.
+ * @return size of the boundary
+ */
public double getSize() {
return boundarySize;
}
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/SubHyperplane.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/SubHyperplane.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/SubHyperplane.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/SubHyperplane.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/SubHyperplane.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/SubHyperplane.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/SubHyperplane.java Sun May 15 16:02:05 2011
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.partitioning;
+package org.apache.commons.math.geometry.partitioning;
/** This interface represents the remaining parts of an hyperplane after
* other parts have been chopped off.
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/SubSpace.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/SubSpace.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/SubSpace.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/SubSpace.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/SubSpace.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/SubSpace.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/SubSpace.java Sun May 15 16:02:05 2011
@@ -14,7 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.partitioning;
+package org.apache.commons.math.geometry.partitioning;
+
/** This interface represents a sub-space of a space.
Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Transform.java (from r1102972, commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Transform.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Transform.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Transform.java&p1=commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Transform.java&r1=1102972&r2=1103438&rev=1103438&view=diff
==============================================================================
--- commons/sandbox/bsp/trunk/src/main/java/org/apache/commons/bsp/partitioning/Transform.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/partitioning/Transform.java Sun May 15 16:02:05 2011
@@ -14,7 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.bsp.partitioning;
+package org.apache.commons.math.geometry.partitioning;
+
/** This interface represents an inversible affine transform in a space.
* <p>Inversible affine transform include for example scalings,