public interface FixedFrameConvexPolygon2DBasics extends FrameConvexPolygon2DReadOnly, ConvexPolygon2DBasics
This implementation of convex polygon is designed for garbage free operations.
EMPTY_SUPPLIER
Modifier and Type | Method and Description |
---|---|
default void |
addVertex(FramePoint2DReadOnly vertex)
Add a vertex to this polygon.
|
default void |
addVertex(FramePoint3DReadOnly vertex)
Add a vertex to this polygon using only the x and y coordinates of the given
vertex . |
default void |
addVertex(ReferenceFrame referenceFrame,
double x,
double y)
Add a vertex to this polygon.
|
default void |
addVertex(ReferenceFrame referenceFrame,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly vertex)
Add a vertex to this polygon.
|
default void |
addVertex(ReferenceFrame referenceFrame,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly vertex)
Add a vertex to this polygon using only the x and y coordinates of the given
vertex . |
default void |
addVertexMatchingFrame(FramePoint2DReadOnly vertex,
boolean checkIfTransformInXYPlane)
Add a vertex to this polygon.
|
default void |
addVertexMatchingFrame(FramePoint3DReadOnly vertex)
Add a vertex to this polygon using only the x and y coordinates of the given
vertex . |
void |
addVertexMatchingFrame(ReferenceFrame referenceFrame,
us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly vertex,
boolean checkIfTransformInXYPlane)
Add a vertex to this polygon.
|
void |
addVertexMatchingFrame(ReferenceFrame referenceFrame,
us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly vertex)
Add a vertex to this polygon.
|
default void |
addVertices(FrameVertex2DSupplier frameVertex2DSupplier)
Adds the vertices from the given vertex supplier.
|
default void |
addVertices(FrameVertex3DSupplier frameVertex3DSupplier)
Adds the vertices from the given vertex supplier.
|
default void |
addVerticesMatchingFrame(FrameVertex2DSupplier frameVertex2DSupplier,
boolean checkIfTransformInXYPlane)
Adds the vertices from the given vertex supplier.
|
default void |
addVerticesMatchingFrame(FrameVertex3DSupplier frameVertex3DSupplier)
Adds the vertices from the given vertex supplier.
|
FixedFramePoint2DBasics |
getVertexUnsafe(int index)
Gets the reference to the
index th vertex of this polygon. |
default void |
scale(FramePoint2DReadOnly pointToScaleAbout,
double scaleFactor)
Scale this convex polygon about
pointToScaleAbout . |
default void |
set(FrameVertex2DSupplier frameVertex2DSupplier)
This method does:
ConvexPolygon2DBasics.clear() . |
default void |
set(FrameVertex2DSupplier firstVertex2DSupplier,
FrameVertex2DSupplier secondVertex2DSupplier)
Sets this polygon such that it represents the smallest convex hull that contains both
polygons.
|
default void |
set(FrameVertex2DSupplier firstVertex2DSupplier,
Vertex2DSupplier secondVertex2DSupplier)
Sets this polygon such that it represents the smallest convex hull that contains both
polygons.
|
default void |
set(FrameVertex3DSupplier frameVertex3DSupplier)
This method does:
ConvexPolygon2DBasics.clear() . |
default void |
set(Vertex2DSupplier firstVertex2DSupplier,
FrameVertex2DSupplier secondVertex2DSupplier)
Sets this polygon such that it represents the smallest convex hull that contains both
polygons.
|
default void |
setMatchingFrame(FrameVertex2DSupplier frameVertex2DSupplier,
boolean checkIfTransformInXYPlane)
This method does:
ConvexPolygon2DBasics.clear() . |
default void |
setMatchingFrame(FrameVertex3DSupplier frameVertex3DSupplier)
This method does:
ConvexPolygon2DBasics.clear() . |
default void |
translate(FrameTuple2DReadOnly translation)
Translates this polygon.
|
canObserverSeeEdge, distance, epsilonEquals, equals, geometricallyEquals, getCentroid, getClosestEdge, getClosestEdge, getClosestEdge, getClosestEdge, getClosestEdge, getClosestEdgeCopy, getClosestEdgeCopy, getClosestEdgeIndex, getClosestPointWithRay, getClosestPointWithRay, getClosestPointWithRay, getClosestPointWithRay, getClosestPointWithRay, getClosestPointWithRay, getClosestPointWithRay, getClosestVertex, getClosestVertex, getClosestVertex, getClosestVertex, getClosestVertex, getClosestVertex, getClosestVertex, getClosestVertex, getClosestVertex, getClosestVertex, getClosestVertexCopy, getClosestVertexCopy, getClosestVertexCopy, getClosestVertexCopy, getClosestVertexIndex, getClosestVertexIndex, getEdge, getEdge, getFramePointsInClockwiseOrder, getNextVertex, getNextVertexCCW, getPolygonVerticesView, getPreviousVertex, getPreviousVertexCCW, getVertex, getVertexBufferView, getVertexCCW, getVerticesInClockwiseOrder, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWith, intersectionWithRay, intersectionWithRay, intersectionWithRay, intersectionWithRay, intersectionWithRay, intersectionWithRay, intersectionWithRay, intersectionWithRay, intersectionWithRay, intersectionWithRay, intersectionWithRay, isPointInside, isPointInside, lineOfSightEndIndex, lineOfSightEndVertex, lineOfSightEndVertex, lineOfSightEndVertex, lineOfSightEndVertex, lineOfSightEndVertex, lineOfSightEndVertexCopy, lineOfSightEndVertexCopy, lineOfSightIndices, lineOfSightStartIndex, lineOfSightStartVertex, lineOfSightStartVertex, lineOfSightStartVertex, lineOfSightStartVertex, lineOfSightStartVertex, lineOfSightStartVertexCopy, lineOfSightStartVertexCopy, lineOfSightVertices, lineOfSightVertices, orthogonalProjection, orthogonalProjection, orthogonalProjection, orthogonalProjection, orthogonalProjection, orthogonalProjection, orthogonalProjection, orthogonalProjectionCopy, orthogonalProjectionCopy, pointIsOnPerimeter, signedDistance, translateCopy, translateCopy
checkReferenceFrameMatch, checkReferenceFrameMatch, getReferenceFrame
asFrameVertex2DSupplier, asFrameVertex2DSupplier, asFrameVertex2DSupplier, asFrameVertex2DSupplier, asFrameVertex2DSupplier, asFrameVertex2DSupplier, emptyFrameVertex2DSupplier, epsilonEquals, equals
addVertex, addVertex, addVertex, addVertices, addVertices, applyInverseTransform, applyInverseTransform, applyTransform, applyTransform, clear, clearAndUpdate, containsNaN, getBoundingBox, notifyVerticesChanged, removeVertex, scale, scale, set, set, set, setToNaN, setToZero, translate, translate, update, updateBoundingBox, updateCentroidAndArea
canObserverSeeEdge, checkIfUpToDate, checkIndexInBoundaries, checkNonEmpty, distance, epsilonEquals, equals, geometricallyEquals, getArea, getBoundingBoxRangeX, getBoundingBoxRangeY, getClosestEdge, getClosestEdgeIndex, getClosestPointWithRay, getClosestVertex, getClosestVertex, getClosestVertexIndex, getClosestVertexIndex, getEdge, getMaxX, getMaxY, getMinX, getMinY, getNextVertexIndex, getNumberOfVertices, getPointsInClockwiseOrder, getPreviousVertexIndex, getVerticesInClockwiseOrder, intersectionWith, intersectionWith, intersectionWithRay, isClockwiseOrdered, isEmpty, isPointInside, isPointInside, isPointInside, isPointInside, isUpToDate, lineOfSightEndIndex, lineOfSightEndVertex, lineOfSightIndices, lineOfSightStartIndex, lineOfSightStartVertex, orthogonalProjection, orthogonalProjection, pointIsOnPerimeter, signedDistance
asVertex2DSupplier, asVertex2DSupplier, asVertex2DSupplier, asVertex2DSupplier, asVertex2DSupplier, asVertex2DSupplier, asVertex2DSupplier, asVertex2DSupplier, asVertex2DSupplier, emptyVertex2DSupplier, epsilonEquals, equals
FixedFramePoint2DBasics getVertexUnsafe(int index)
index
th vertex of this polygon.getVertexUnsafe
in interface ConvexPolygon2DBasics
index
- the index of the vertex in the clockwise ordered list.getVertexUnsafe(int)
default void addVertex(ReferenceFrame referenceFrame, double x, double y)
referenceFrame
- the reference frame in which the given vertex is expressed.x
- the x-coordinate of the new vertex.y
- the y-coordinate of the new vertex.ReferenceFrameMismatchException
- if referenceFrame
and
this.getReferenceFrame()
are not the same.ConvexPolygon2DBasics.addVertex(double, double)
default void addVertex(ReferenceFrame referenceFrame, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly vertex)
referenceFrame
- the reference frame in which the given vertex
is expressed.vertex
- the new vertex. Not modified.ReferenceFrameMismatchException
- if referenceFrame
and
this.getReferenceFrame()
are not the same.ConvexPolygon2DBasics.addVertex(Point2DReadOnly)
void addVertexMatchingFrame(ReferenceFrame referenceFrame, us.ihmc.euclid.tuple2D.interfaces.Point2DReadOnly vertex, boolean checkIfTransformInXYPlane)
If vertex
is expressed in the frame as this
, then this method is equivalent to
ConvexPolygon2DBasics.addVertex(Point2DReadOnly)
.
If vertex
is expressed in a different frame than this
, then the vertex
is added once transformed to be expressed in this.getReferenceFrame()
.
referenceFrame
- the reference frame in which the given vertex
is expressed.vertex
- the new vertex. Not modified.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.us.ihmc.euclid.exceptions.NotAMatrix2DException
- if checkIfTransformInXYPlane == true
and the rotation
part of the transform is not a transformation in the XY plane.ConvexPolygon2DBasics.addVertex(Point2DReadOnly)
default void addVertex(ReferenceFrame referenceFrame, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly vertex)
vertex
.referenceFrame
- the reference frame in which the given vertex
is expressed.vertex
- the new vertex. Not modified.ReferenceFrameMismatchException
- if referenceFrame
and
this.getReferenceFrame()
are not the same.ConvexPolygon2DBasics.addVertex(Point3DReadOnly)
void addVertexMatchingFrame(ReferenceFrame referenceFrame, us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly vertex)
If vertex
is expressed in the frame as this
, then this method is equivalent to
ConvexPolygon2DBasics.addVertex(Point2DReadOnly)
.
If vertex
is expressed in a different frame than this
, then the vertex
is added once transformed to be expressed in this.getReferenceFrame()
.
referenceFrame
- the reference frame in which the given vertex
is expressed.vertex
- the new vertex. Not modified.ConvexPolygon2DBasics.addVertex(Point3DReadOnly)
default void addVertex(FramePoint2DReadOnly vertex)
vertex
- the new vertex. Not modified.ReferenceFrameMismatchException
- if vertex
and this
are not expressed
in the same reference frame.ConvexPolygon2DBasics.addVertex(Point2DReadOnly)
default void addVertexMatchingFrame(FramePoint2DReadOnly vertex, boolean checkIfTransformInXYPlane)
If vertex
is expressed in the frame as this
, then this method is equivalent to
ConvexPolygon2DBasics.addVertex(Point2DReadOnly)
.
If vertex
is expressed in a different frame than this
, then the vertex
is added once transformed to be expressed in this.getReferenceFrame()
.
vertex
- the new vertex. Not modified.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.addVertexMatchingFrame(ReferenceFrame, Point2DReadOnly, boolean)
,
ConvexPolygon2DBasics.addVertex(Point2DReadOnly)
default void addVertex(FramePoint3DReadOnly vertex)
vertex
.vertex
- the new vertex. Not modified.ReferenceFrameMismatchException
- if vertex
and this
are not expressed
in the same reference frame.ConvexPolygon2DBasics.addVertex(Point3DReadOnly)
default void addVertexMatchingFrame(FramePoint3DReadOnly vertex)
vertex
.vertex
- the new vertex. Not modified.addVertexMatchingFrame(ReferenceFrame, Point3DReadOnly)
,
ConvexPolygon2DBasics.addVertex(Point3DReadOnly)
default void addVertices(FrameVertex2DSupplier frameVertex2DSupplier)
Note that this polygon is marked as being out-of-date. The method ConvexPolygon2DBasics.update()
has to be
called afterward before being able to perform operations with this polygon.
frameVertex2DSupplier
- the supplier of vertices.ReferenceFrameMismatchException
- if any of the given vertices
is a
FramePoint2DReadOnly
and is not expressed in the same reference frame as
this
.FrameVertex2DSupplier
,
addVertex(FramePoint2DReadOnly)
default void addVerticesMatchingFrame(FrameVertex2DSupplier frameVertex2DSupplier, boolean checkIfTransformInXYPlane)
Note that this polygon is marked as being out-of-date. The method ConvexPolygon2DBasics.update()
has to be
called afterward before being able to perform operations with this polygon.
frameVertex2DSupplier
- the supplier of vertices.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.FrameVertex2DSupplier
,
addVertexMatchingFrame(FramePoint2DReadOnly, boolean)
default void addVertices(FrameVertex3DSupplier frameVertex3DSupplier)
Note that this polygon is marked as being out-of-date. The method ConvexPolygon2DBasics.update()
has to be
called afterward before being able to perform operations with this polygon.
Only the x and y coordinates of each vertex is used to add a vertex to this polygon.
frameVertex3DSupplier
- the supplier of vertices.ReferenceFrameMismatchException
- if any of the given vertices
is a
FramePoint3DReadOnly
and is not expressed in the same reference frame as
this
.FrameVertex3DSupplier
,
addVertex(FramePoint3DReadOnly)
default void addVerticesMatchingFrame(FrameVertex3DSupplier frameVertex3DSupplier)
Note that this polygon is marked as being out-of-date. The method ConvexPolygon2DBasics.update()
has to be
called afterward before being able to perform operations with this polygon.
frameVertex3DSupplier
- the supplier of vertices.FrameVertex3DSupplier
,
addVertexMatchingFrame(FramePoint3DReadOnly)
default void set(FrameVertex2DSupplier frameVertex2DSupplier)
frameVertex2DSupplier
- the supplier of vertices.ReferenceFrameMismatchException
- if any of the given vertices
is a
FramePoint2DReadOnly
and is not expressed in the same reference frame as
this
.FrameVertex2DSupplier
,
addVertices(FrameVertex2DSupplier)
default void setMatchingFrame(FrameVertex2DSupplier frameVertex2DSupplier, boolean checkIfTransformInXYPlane)
frameVertex2DSupplier
- the supplier of vertices.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.FrameVertex2DSupplier
,
addVerticesMatchingFrame(FrameVertex2DSupplier, boolean)
default void set(FrameVertex3DSupplier frameVertex3DSupplier)
frameVertex3DSupplier
- the supplier of vertices.ReferenceFrameMismatchException
- if any of the given vertices
is a
FramePoint3DReadOnly
and is not expressed in the same reference frame as
this
.FrameVertex3DSupplier
,
addVertices(FrameVertex3DSupplier)
default void setMatchingFrame(FrameVertex3DSupplier frameVertex3DSupplier)
frameVertex3DSupplier
- the supplier of vertices.FrameVertex3DSupplier
,
addVerticesMatchingFrame(FrameVertex3DSupplier)
default void set(FrameVertex2DSupplier firstVertex2DSupplier, FrameVertex2DSupplier secondVertex2DSupplier)
Note that the resulting polygon is ready to be used for any operations, no need to call
ConvexPolygon2DBasics.update()
.
firstVertex2DSupplier
- the first supplier of vertices.secondVertex2DSupplier
- the second supplier of vertices.ReferenceFrameMismatchException
- if any of the vertices provided by
firstVertexSupplier
and secondVertexSupplier
are not expressed in
the same reference frame as this
.FrameVertex2DSupplier
,
addVertices(FrameVertex2DSupplier)
default void set(FrameVertex2DSupplier firstVertex2DSupplier, Vertex2DSupplier secondVertex2DSupplier)
Note that the resulting polygon is ready to be used for any operations, no need to call
ConvexPolygon2DBasics.update()
.
firstVertex2DSupplier
- the first supplier of vertices.secondVertex2DSupplier
- the second supplier of vertices.ReferenceFrameMismatchException
- if any of the vertices provided by
firstVertexSupplier
are not expressed in the same reference frame as
this
.FrameVertex2DSupplier
,
addVertices(FrameVertex2DSupplier)
default void set(Vertex2DSupplier firstVertex2DSupplier, FrameVertex2DSupplier secondVertex2DSupplier)
Note that the resulting polygon is ready to be used for any operations, no need to call
ConvexPolygon2DBasics.update()
.
firstVertex2DSupplier
- the first supplier of vertices.secondVertex2DSupplier
- the second supplier of vertices.ReferenceFrameMismatchException
- if any of the vertices provided by
secondVertexSupplier
are not expressed in the same reference frame as
this
.FrameVertex2DSupplier
,
addVertices(FrameVertex2DSupplier)
default void scale(FramePoint2DReadOnly pointToScaleAbout, double scaleFactor)
pointToScaleAbout
.pointToScaleAbout
- the center of the scale transformation. Not modified.scaleFactor
- the scale factor to apply to this polygon. A value of 1.0
does
nothing.ReferenceFrameMismatchException
- if pointToScaleAbout
and this
are not
expressed in the same reference frame.ConvexPolygon2DBasics.scale(Point2DReadOnly, double)
default void translate(FrameTuple2DReadOnly translation)
translation
- the translation to apply to this polygon's vertices. Not modified.ReferenceFrameMismatchException
- if translation
and this
are not
expressed in the same reference frame.ConvexPolygon2DBasics.translate(Tuple2DReadOnly)