コード例 #1
0
  @Test
  public void testGetRelativeMap() {

    facet.set(0, 1, 2, Integer.valueOf(1));
    facet.set(0, 1, 3, Integer.valueOf(2));
    facet.set(9, 3, 1, Integer.valueOf(3));

    facet.setWorld(13, 28, 34, 2);
    facet.setWorld(10, 21, 35, 1);

    Map<Vector3i, Number> expected =
        ImmutableMap.<Vector3i, Number>of(
            new Vector3i(0, 1, 2), 1,
            new Vector3i(0, 1, 3), 2,
            new Vector3i(3, 8, 4), 2,
            new Vector3i(0, 1, 5), 1,
            new Vector3i(9, 3, 1), 3);

    Assert.assertEquals(expected, facet.getRelativeEntries());
  }
コード例 #2
0
  @Test
  public void testGetWorldMap() {

    facet.set(0, 1, 2, 4);
    facet.set(0, 1, 3, 3);
    facet.set(9, 3, 1, 2);

    facet.setWorld(13, 28, 34, 2);
    facet.setWorld(10, 21, 35, 1);

    Map<Vector3i, Number> expected =
        ImmutableMap.<Vector3i, Number>of(
            new Vector3i(10, 21, 32), 4,
            new Vector3i(10, 21, 33), 3,
            new Vector3i(13, 28, 34), 2,
            new Vector3i(10, 21, 35), 1,
            new Vector3i(19, 23, 31), 2);

    Assert.assertEquals(expected, facet.getWorldEntries());
  }
コード例 #3
0
 @Test
 public void testBoxedGetSetSparse() {
   facet.set(0, 1, 3, new Integer(64));
   Assert.assertEquals(64.0f, facet.get(0, 1, 3), 0.0);
 }