@Override public FramePoint3DReadOnly getVertex(int index) { return new FramePoint3D(referenceFrame, vertex2dSupplier.getVertex(index)); } };
/** * Tests on a per-vertex basis if this supplier and {@code other} are equal to an * {@code epsilon}. * * @param other the other supplier to compare against this. * @param epsilon the tolerance to use. * @return {@code true} if the two suppliers are equal. */ default boolean epsilonEquals(Vertex3DSupplier other, double epsilon) { if (getNumberOfVertices() != other.getNumberOfVertices()) return false; for (int i = 0; i < getNumberOfVertices(); i++) { if (!getVertex(i).epsilonEquals(other.getVertex(i), epsilon)) return false; } return true; }
/** * Adds the vertices from the given vertex supplier. * <p> * Note that this polygon is marked as being out-of-date. The method {@link #update()} has to be * called afterward before being able to perform operations with this polygon. * </p> * <p> * Only the x and y coordinates of each vertex is used to add a vertex to this polygon. * </p> * * @param vertex3DSupplier the supplier of vertices. * @see Vertex3DSupplier */ default void addVertices(Vertex3DSupplier vertex3DSupplier) { for (int index = 0; index < vertex3DSupplier.getNumberOfVertices(); index++) { addVertex(vertex3DSupplier.getVertex(index)); } }
/** * Tests on a per-vertex basis if this supplier and {@code other} are equal. * * @param other the other supplier to compare against this. * @return {@code true} if the two suppliers are equal. */ default boolean equals(Vertex3DSupplier other) { if (other == null) return false; if (getNumberOfVertices() != other.getNumberOfVertices()) return false; for (int i = 0; i < getNumberOfVertices(); i++) { if (!getVertex(i).equals(other.getVertex(i))) return false; } return true; }
assertTrue(original.get(j) == supplier.getVertex(j)); assertTrue(subList.get(j) == supplier.getVertex(j)); assertTrue(subList.get(j) == supplier.getVertex(j)); assertTrue(original.get(j) == supplier.getVertex(j)); assertTrue(subList.get(j) == supplier.getVertex(j)); assertTrue(subList.get(j) == supplier.getVertex(j));