public void set(int i, FrameTuple2d<?, ?> frameTuple2d) { get(i).setIncludingFrame(frameTuple2d); }
public void copyFromListAndTrimSize(FrameTuple2dArrayList<?> otherList) { for (int i = 0; i < otherList.size(); i++) { getAndGrowIfNeeded(i).setIncludingFrame(otherList.get(i)); } while(size() > otherList.size()) { remove(size() - 1); } }
public void set(int i, FrameTuple2DReadOnly frameTuple2d) { get(i).setIncludingFrame(frameTuple2d); }
/** * Adds N new vertices to this polygon using a list of {@code FramePoint2d}. * Note that this method recycles memory. * @param vertices {@code FrameTuple2dArrayList<FramePoint2d>} the list of new vertices (it is not modified). * @param numberOfVertices {@code int} that is used to determine the number of vertices to add to this polygon. Note the: {@code vertices.size()} can be greater or equal to numberOfVertices. * @throws ReferenceFrameMismatchException */ public void addVertices(FrameTuple2dArrayList<FramePoint2d> vertices, int numberOfVertices) { for (int i = 0; i < numberOfVertices; i++) { FramePoint2d vertex = vertices.get(i); addVertex(vertex); } }
/** * If the list of vertices is empty, this polygon will be empty and its reference frame won't be changed. * If the list of vertices is not empty, this method does: * 1- {@code clear(vertices.get(0).getReferenceFrame())}; * 2- {@code addVertices(vertices)}; * 3- {@code update()}. * @param referenceFrame {@code ReferenceFrame} the new reference frame of this polygon. * @param vertices {@code FrameTuple2dArrayList<FramePoint2d>} the list of points that is used to creates the vertices. * @throws ReferenceFrameMismatchException */ public void setIncludingFrameAndUpdate(FrameTuple2dArrayList<FramePoint2d> vertices) { int numberOfVertices = vertices.size(); if (numberOfVertices < 1 ) { clear(); update(); } else { clear(vertices.get(0).getReferenceFrame()); addVertices(vertices, numberOfVertices); update(); } }