/** * Add a vertex to this polygon using only the x and y coordinates of the given {@code vertex}. * * @param vertex the new vertex. Not modified. * @see #addVertexMatchingFrame(ReferenceFrame, Point3DReadOnly) * @see #addVertex(Point3DReadOnly) */ default void addVertexMatchingFrame(FramePoint3DReadOnly vertex) { addVertexMatchingFrame(vertex.getReferenceFrame(), vertex); }
/** * Add a vertex to this polygon. * <p> * If {@code vertex} is expressed in the frame as {@code this}, then this method is equivalent to * {@link #addVertex(Point2DReadOnly)}. * </p> * <p> * If {@code vertex} is expressed in a different frame than {@code this}, then the {@code vertex} * is added once transformed to be expressed in {@code this.getReferenceFrame()}. * </p> * * @param vertex the new vertex. Not modified. * @param checkIfTransformInXYPlane whether this method should assert that the rotation part of * the transform from the vertex's frame to this frame represents a transformation in * the XY plane. * @see #addVertexMatchingFrame(ReferenceFrame, Point2DReadOnly, boolean) * @see #addVertex(Point2DReadOnly) */ default void addVertexMatchingFrame(FramePoint2DReadOnly vertex, boolean checkIfTransformInXYPlane) { addVertexMatchingFrame(vertex.getReferenceFrame(), vertex, checkIfTransformInXYPlane); }
/** * 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> * * @param frameVertex3DSupplier the supplier of vertices. * @see FrameVertex3DSupplier * @see #addVertexMatchingFrame(FramePoint3DReadOnly) */ default void addVerticesMatchingFrame(FrameVertex3DSupplier frameVertex3DSupplier) { for (int index = 0; index < frameVertex3DSupplier.getNumberOfVertices(); index++) { addVertexMatchingFrame(frameVertex3DSupplier.getVertex(index)); } }
/** * 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> * * @param frameVertex2DSupplier the supplier of vertices. * @param checkIfTransformInXYPlane whether this method should assert that the rotation part of * the transform from the vertex's frame to this frame represents a transformation in * the XY plane. * @see FrameVertex2DSupplier * @see #addVertexMatchingFrame(FramePoint2DReadOnly, boolean) */ default void addVerticesMatchingFrame(FrameVertex2DSupplier frameVertex2DSupplier, boolean checkIfTransformInXYPlane) { for (int index = 0; index < frameVertex2DSupplier.getNumberOfVertices(); index++) { addVertexMatchingFrame(frameVertex2DSupplier.getVertex(index), checkIfTransformInXYPlane); } }