|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object PolygonXZ
public class PolygonXZ
Field Summary | |
---|---|
protected List<VectorXZ> |
vertexLoop
polygon vertices; first and last vertex are equal |
Constructor Summary | |
---|---|
PolygonXZ(List<VectorXZ> vertexLoop)
|
Method Summary | |
---|---|
protected static void |
assertLoopProperty(List<VectorXZ> vertexLoop)
checks that the first and last vertex of the vertex list are equal. |
SimplePolygonXZ |
asSimplePolygon()
returns a polygon with the coordinates of this polygon that is an instance of SimplePolygonXZ . |
TriangleXZ |
asTriangleXZ()
returns a triangle with the same vertices as this polygon. |
VectorXZ |
getCenter()
returns the average of all vertex coordinates. |
LineSegmentXZ |
getClosestSegment(VectorXZ point)
returns the polygon segment with minimum distance to a given point |
double |
getOutlineLength()
returns the length of the polygon's outline. |
List<LineSegmentXZ> |
getSegments()
|
VectorXZ |
getVertex(int index)
returns the vertex at a position in the vertex sequence |
VectorXZ |
getVertexAfter(int index)
returns the successor of the vertex at a position in the vertex sequence. |
VectorXZ |
getVertexBefore(int index)
returns the predecessor of the vertex at a position in the vertex sequence. |
List<VectorXZ> |
getVertexCollection()
returns a collection that contains all vertices of this polygon at least once. |
List<VectorXZ> |
getVertexLoop()
returns the polygon's vertices. |
List<VectorXZ> |
getVertices()
returns the polygon's vertices. |
Collection<VectorXZ> |
intersectionPositions(LineSegmentXZ lineSegment)
|
Collection<LineSegmentXZ> |
intersectionSegments(LineSegmentXZ lineSegment)
|
boolean |
intersects(LineSegmentXZ lineSegment)
|
boolean |
intersects(PolygonXZ outlinePolygonXZ)
returns true if there is an intersection between this polygon's and the parameter polygon's sides |
boolean |
intersects(VectorXZ segmentP1,
VectorXZ segmentP2)
returns true if there is an intersection between this polygon and the line segment defined by the parameter |
boolean |
isEquivalentTo(PolygonXZ other)
returns true if the other polygon has the same vertices in the same order, possibly with a different start vertex |
boolean |
isSelfIntersecting()
returns whether this polygon is self-intersecting |
static boolean |
isSelfIntersecting(List<VectorXZ> polygonVertexLoop)
returns true if the polygon defined by the polygonVertexLoop parameter is self-intersecting |
boolean |
isSimple()
checks whether this polygon is simple |
PolygonXZ |
reverse()
|
int |
size()
returns the number of vertices in this polygon. |
String |
toString()
|
PolygonXYZ |
xyz(double y)
|
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final List<VectorXZ> vertexLoop
Constructor Detail |
---|
public PolygonXZ(List<VectorXZ> vertexLoop)
vertexLoop
- vertices defining the polygon;
first and last vertex must be equal
InvalidGeometryException
- if the polygon is self-intersecting
or produces invalid area calculation resultsMethod Detail |
---|
public int size()
getVertices()
.size().
public List<VectorXZ> getVertices()
getVertexLoop()
, there is no duplication
of the first/last vertex.
public List<VectorXZ> getVertexLoop()
public List<VectorXZ> getVertexCollection()
public VectorXZ getVertex(int index)
public VectorXZ getVertexAfter(int index)
public VectorXZ getVertexBefore(int index)
public List<LineSegmentXZ> getSegments()
public LineSegmentXZ getClosestSegment(VectorXZ point)
public boolean intersects(VectorXZ segmentP1, VectorXZ segmentP2)
public boolean intersects(LineSegmentXZ lineSegment)
public boolean intersects(PolygonXZ outlinePolygonXZ)
public Collection<LineSegmentXZ> intersectionSegments(LineSegmentXZ lineSegment)
public Collection<VectorXZ> intersectionPositions(LineSegmentXZ lineSegment)
public boolean isSelfIntersecting()
public static boolean isSelfIntersecting(List<VectorXZ> polygonVertexLoop)
public boolean isSimple()
public SimplePolygonXZ asSimplePolygon()
SimplePolygonXZ
.
Only works if it actually isSimple()
!
public TriangleXZ asTriangleXZ()
public PolygonXYZ xyz(double y)
public PolygonXZ reverse()
public VectorXZ getCenter()
public double getOutlineLength()
public boolean isEquivalentTo(PolygonXZ other)
protected static void assertLoopProperty(List<VectorXZ> vertexLoop)
IllegalArgumentException
- if first and last vertex aren't equal
(this is usually a programming error,
therefore InvalidGeometryException is not used)public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |