No tabs allowed.

This commit is contained in:
Gilles 2018-01-26 12:41:34 +01:00
parent 24d3dd8ba7
commit ed98d264cf
1 changed files with 42 additions and 42 deletions

View File

@ -65,73 +65,73 @@ public class SubOrientedPointTest {
@Test @Test
public void testSplit_resultOnMinusSide() { public void testSplit_resultOnMinusSide() {
// arrange // arrange
OrientedPoint hyperplane = new OrientedPoint(new Cartesian1D(1), true, TEST_TOLERANCE); OrientedPoint hyperplane = new OrientedPoint(new Cartesian1D(1), true, TEST_TOLERANCE);
IntervalsSet interval = new IntervalsSet(TEST_TOLERANCE); IntervalsSet interval = new IntervalsSet(TEST_TOLERANCE);
SubOrientedPoint pt = new SubOrientedPoint(hyperplane, interval); SubOrientedPoint pt = new SubOrientedPoint(hyperplane, interval);
OrientedPoint splitter = new OrientedPoint(new Cartesian1D(2), true, TEST_TOLERANCE); OrientedPoint splitter = new OrientedPoint(new Cartesian1D(2), true, TEST_TOLERANCE);
// act // act
SplitSubHyperplane<Euclidean1D> split = pt.split(splitter); SplitSubHyperplane<Euclidean1D> split = pt.split(splitter);
// assert // assert
Assert.assertEquals(Side.MINUS, split.getSide()); Assert.assertEquals(Side.MINUS, split.getSide());
SubOrientedPoint minusSub = ((SubOrientedPoint) split.getMinus()); SubOrientedPoint minusSub = ((SubOrientedPoint) split.getMinus());
Assert.assertNotNull(minusSub); Assert.assertNotNull(minusSub);
OrientedPoint minusHyper = (OrientedPoint) minusSub.getHyperplane(); OrientedPoint minusHyper = (OrientedPoint) minusSub.getHyperplane();
Assert.assertEquals(1, minusHyper.getLocation().getX(), TEST_TOLERANCE); Assert.assertEquals(1, minusHyper.getLocation().getX(), TEST_TOLERANCE);
Assert.assertSame(interval, minusSub.getRemainingRegion()); Assert.assertSame(interval, minusSub.getRemainingRegion());
Assert.assertNull(split.getPlus()); Assert.assertNull(split.getPlus());
} }
@Test @Test
public void testSplit_resultOnPlusSide() { public void testSplit_resultOnPlusSide() {
// arrange // arrange
OrientedPoint hyperplane = new OrientedPoint(new Cartesian1D(1), true, TEST_TOLERANCE); OrientedPoint hyperplane = new OrientedPoint(new Cartesian1D(1), true, TEST_TOLERANCE);
IntervalsSet interval = new IntervalsSet(TEST_TOLERANCE); IntervalsSet interval = new IntervalsSet(TEST_TOLERANCE);
SubOrientedPoint pt = new SubOrientedPoint(hyperplane, interval); SubOrientedPoint pt = new SubOrientedPoint(hyperplane, interval);
OrientedPoint splitter = new OrientedPoint(new Cartesian1D(0), true, TEST_TOLERANCE); OrientedPoint splitter = new OrientedPoint(new Cartesian1D(0), true, TEST_TOLERANCE);
// act // act
SplitSubHyperplane<Euclidean1D> split = pt.split(splitter); SplitSubHyperplane<Euclidean1D> split = pt.split(splitter);
// assert // assert
Assert.assertEquals(Side.PLUS, split.getSide()); Assert.assertEquals(Side.PLUS, split.getSide());
Assert.assertNull(split.getMinus()); Assert.assertNull(split.getMinus());
SubOrientedPoint plusSub = ((SubOrientedPoint) split.getPlus()); SubOrientedPoint plusSub = ((SubOrientedPoint) split.getPlus());
Assert.assertNotNull(plusSub); Assert.assertNotNull(plusSub);
OrientedPoint plusHyper = (OrientedPoint) plusSub.getHyperplane(); OrientedPoint plusHyper = (OrientedPoint) plusSub.getHyperplane();
Assert.assertEquals(1, plusHyper.getLocation().getX(), TEST_TOLERANCE); Assert.assertEquals(1, plusHyper.getLocation().getX(), TEST_TOLERANCE);
Assert.assertSame(interval, plusSub.getRemainingRegion()); Assert.assertSame(interval, plusSub.getRemainingRegion());
} }
@Test @Test
public void testSplit_equivalentHyperplanes() { public void testSplit_equivalentHyperplanes() {
// arrange // arrange
OrientedPoint hyperplane = new OrientedPoint(new Cartesian1D(1), true, TEST_TOLERANCE); OrientedPoint hyperplane = new OrientedPoint(new Cartesian1D(1), true, TEST_TOLERANCE);
IntervalsSet interval = new IntervalsSet(TEST_TOLERANCE); IntervalsSet interval = new IntervalsSet(TEST_TOLERANCE);
SubOrientedPoint pt = new SubOrientedPoint(hyperplane, interval); SubOrientedPoint pt = new SubOrientedPoint(hyperplane, interval);
OrientedPoint splitter = new OrientedPoint(new Cartesian1D(1), true, TEST_TOLERANCE); OrientedPoint splitter = new OrientedPoint(new Cartesian1D(1), true, TEST_TOLERANCE);
// act // act
SplitSubHyperplane<Euclidean1D> split = pt.split(splitter); SplitSubHyperplane<Euclidean1D> split = pt.split(splitter);
// assert // assert
Assert.assertEquals(Side.HYPER, split.getSide()); Assert.assertEquals(Side.HYPER, split.getSide());
Assert.assertNull(split.getMinus()); Assert.assertNull(split.getMinus());
Assert.assertNull(split.getPlus()); Assert.assertNull(split.getPlus());
} }
@Test @Test
@ -157,4 +157,4 @@ public class SubOrientedPointTest {
Assert.assertNotNull(minusSplit.getMinus()); Assert.assertNotNull(minusSplit.getMinus());
Assert.assertNull(minusSplit.getPlus()); Assert.assertNull(minusSplit.getPlus());
} }
} }