public class Vertex extends Object
QuadEdgeSubdivision. The sites can be points on a line string representing a linear site.
The vertex can be considered as a vector with a norm, length, inner product, cross product, etc. Additionally, point relations (e.g., is a point to the left of a line, the circle defined by this point and two others, etc.) are also defined in this class.
It is common to want to attach user-defined data to the vertices of a subdivision. One way to do this is to subclass Vertex to carry any desired information.
| Modifier and Type | Field and Description |
|---|---|
static int |
BEHIND
|
static int |
BETWEEN
|
static int |
BEYOND
|
static int |
DESTINATION
|
static int |
LEFT
|
static int |
ORIGIN
|
static int |
RIGHT
|
| Constructor and Description |
|---|
Vertex(Coordinate
|
Vertex(double _x, double _y)
|
Vertex(double _x, double _y, double _z)
|
| Modifier and Type | Method and Description |
|---|---|
Vertex |
circleCenter(Vertex
Computes the centre of the circumcircle of this vertex and two others.
|
double |
circumRadiusRatio(Vertex
Computes the value of the ratio of the circumradius to shortest edge.
|
int |
classify(Vertex
|
boolean |
equals(Vertex
|
boolean |
equals(Vertex
|
Coordinate |
getCoordinate()
|
double |
getX()
|
double |
getY()
|
double |
getZ()
|
static double |
interpolateZ(Coordinate
Computes the interpolated Z-value for a point p lying on the segment p0-p1
|
static double |
interpolateZ(Coordinate
Interpolates the Z-value (height) of a point enclosed in a triangle whose vertices all have Z values.
|
double |
interpolateZValue(Vertex
For this vertex enclosed in a triangle defined by three vertices v0, v1 and v2, interpolate a z value from the surrounding vertices.
|
boolean |
isCCW(Vertex
Tests whether the triangle formed by this vertex and two other vertices is in CCW orientation.
|
boolean |
isInCircle(Vertex
Tests if the vertex is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise).
|
boolean |
leftOf(QuadEdge
|
Vertex |
midPoint(Vertex
returns a new vertex that is mid-way between this vertex and another end point.
|
boolean |
rightOf(QuadEdge
|
void |
setZ(double _z)
|
String |
toString()
|
public static final int LEFT
public static final int RIGHT
public static final int BEYOND
public static final int BEHIND
public static final int BETWEEN
public static final int ORIGIN
public static final int DESTINATION
public Vertex(double _x,
double _y)public Vertex(double _x,
double _y,
double _z)public Vertex(Coordinate_p)
public double getX()
public double getY()
public double getZ()
public void setZ(double _z)
public CoordinategetCoordinate()
public StringtoString()
public boolean equals(Vertex_x)
public boolean equals(Vertex_x, double tolerance)
public boolean isInCircle(Vertexa, Vertex b, Vertex c)
a - a vertex of the triangle
b - a vertex of the triangle
c - a vertex of the triangle
public final boolean isCCW(Vertexb, Vertex c)
b - a vertex
c - a vertex
public final boolean rightOf(QuadEdgee)
public final boolean leftOf(QuadEdgee)
public double circumRadiusRatio(Vertexb, Vertex c)
b - second vertex of the triangle
c - third vertex of the triangle
public VertexmidPoint(Vertex a)
a - the other end point.
public VertexcircleCenter(Vertex b, Vertex c)
b -
c -
public double interpolateZValue(Vertexv0, Vertex v1, Vertex v2)
public static double interpolateZ(Coordinatep, Coordinate v0, Coordinate v1, Coordinate v2)
p - the point to interpolate the Z value of
v0 - a vertex of a triangle containing the p
v1 - a vertex of a triangle containing the p
v2 - a vertex of a triangle containing the p
public static double interpolateZ(Coordinatep, Coordinate p0, Coordinate p1)
p -
p0 -
p1 -