|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdelaunay.delaunay.geometries.Element
org.jdelaunay.delaunay.geometries.DEdge
public class DEdge
An edge in the tringulation. A DEdge is formed with two DPoint instances. A DEdge is linked to up to two DTriangle : one on its left, and one on its right. This DEdge is an edge of these DTriangle. The left and right sides are relative to the orientation of the edge. Indeed, a DEdge has a start and an end. If you want to know the leftmost point, you can use getPointLeft (resp getPointRight for the rightmost point). The leftmost point is not necessarily the start point. To swap the start and the end, you can use the swap() method.
| Field Summary | |
|---|---|
static int |
COLINEAR
Value returned by the intersects method when the two edges are colinear and don't intersect |
static int |
DOWNSLOPE
|
static int |
FLATSLOPE
|
static int |
INTERSECT
Value returned by the intersects method when the two edges intersect in one point |
static int |
NO_INTERSECTION
Value returned by the intersects method when the two edges don't intersect |
static int |
SHARE_EDGE_PART
Value returned by the intersects method when the two edges intersect in more than one point (ie they are colinear and do not just share their extremities). |
static int |
SHARE_EXTREMITY
Value returned by the intersects method when the two edges intersect in one point that is an extremity for both of them. |
static int |
UPSLOPE
|
| Fields inherited from class org.jdelaunay.delaunay.geometries.Element |
|---|
WEIGHTED_PROPERTIES |
| Constructor Summary | |
|---|---|
DEdge()
Generate a new edge. |
|
DEdge(DEdge ed)
Generate an edge from another edge. |
|
DEdge(double x,
double y,
double z,
double u,
double v,
double w)
Create a new edge given the coordinates of its two extremities |
|
DEdge(DPoint start,
DPoint end)
Generate an edge from two points. |
|
| Method Summary | |
|---|---|
void |
addProperty(int prop)
Overrides the default method. |
int |
compareTo(DEdge edge)
Realization of Compare. |
boolean |
contains(com.vividsolutions.jts.geom.Coordinate c)
Check if the coordinate is inside the element |
boolean |
contains(DPoint aPoint)
Check if the point is inside the element |
void |
deepSwap()
Perform a "deep swap" on this edge. |
void |
displayObject(Graphics g,
int decalageX,
int decalageY,
double minX,
double minY,
double scaleX,
double scaleY)
Display the edge in a JPanel |
boolean |
equals(Object other)
Two edges are supposed to be equals if the points they are defined by are the same. |
void |
forceTopographicOrientation()
This method wil force the point marked as the end of the edge to be the point with the lower altitude. |
void |
forceTriangleSide()
This method takes care to ensure that the left and right triangles are actually on the left and on the right, and not on the right and on the left. |
double |
get2DLength()
get 2D length |
double |
get3DLength()
get 3D length |
DPoint |
getBarycenter()
Get the barycenter of the DEdge. |
BoundaryBox |
getBoundingBox()
Computed bounding box |
DPoint |
getDirectionVector()
Get the direction vector of the associated line. |
double |
getDistance2D(DPoint p)
Get the euclidean distance between p and the line defined by this edge. |
DPoint |
getEndPoint()
|
int |
getGradient()
|
Element |
getIntersection(DEdge ed)
intersects two edges returns null if there is no intersection |
Element |
getIntersection(DEdge ed,
Map<Integer,Integer> weights)
Get the intersection, using the weights given in argument to compute the z : we will use the z from the edge with the highest weight. |
Element |
getIntersection(DPoint p1,
DPoint p2)
intersects two edges returns null if there is no intersection |
Element |
getIntersection(DPoint point1,
DPoint point2,
boolean useCoordZOfp1p2)
intersects two edges returns null if there is no intersection if the two edgse are colinear, returns the minimum intersection point, if such a point exists. |
DTriangle |
getLeft()
|
DPoint |
getMiddle()
Get the middle of the segment, in 3 dimensions. |
DTriangle |
getOtherTriangle(DTriangle tri)
Return the left triangle if tri is the right one, the right triangle if tri is the left one, and null otherwise. |
DPoint |
getPointFromItsX(double abs)
This method retrieves the point that would stand on the line defined by this edge, and whose absciss is abs. |
DPoint |
getPointLeft()
Get the point of this edge that is on the left from the other. |
DPoint |
getPointRight()
Get the point of this edge that is on the left from the other. |
DTriangle |
getRight()
|
double |
getSlope()
Get the slope of the edge |
double |
getSlopeAspect()
Compute the aspect of an edge. |
double |
getSlopeInDegree()
Get the slope of the edge in degree. |
double |
getSquared2DLength()
get squared 2D length |
protected double |
getSquared3DLength()
get squared 3D length |
DPoint |
getStartPoint()
|
DPoint |
getUpperPoint()
return the point of the edge that have the greatest Z coordinate. |
double |
getZOnEdge(DPoint p)
Make a linear interpolation for the points that lie on the edge. |
int |
hashCode()
Get edge hashCode as min hashCode of its points |
boolean |
haveSamePoint(DEdge anEdge)
Check if two edges have the same points. |
int |
intersects(DEdge other)
Check if this and other intersect. |
int |
intersects(DPoint p1,
DPoint p2)
check if two edges intersect |
boolean |
isColinear(DPoint p)
check if the point is colinear to the edge |
boolean |
isColinear2D(DPoint p)
check if the point is colinear to the edge in the XY plane, ie if it lies on the line defined by this edge. |
boolean |
isDegenerated()
Checks if this edge is "degenerated" or not. |
boolean |
isEncroached()
An edge is said to be encroached in a mesh if : (The edge is a constraint OR an edge of the mesh' boundary) AND there is a point lying in the circle it is the diameter of. |
boolean |
isEncroachedBy(DPoint pt)
Test if this edge is encroached by the given point. |
boolean |
isExtremity(DPoint p)
check if the point is one of the extremities of the edge (on the xy-plane) |
boolean |
isFlatSlope()
Check if the edge is flat or not |
boolean |
isInside(DPoint p)
check if the point is between the extremities of the edge (on the xy-plane) |
boolean |
isLeft(DPoint p)
Check if the point p is on the left |
boolean |
isLeftTriangleGoToEdge()
Returns true if the triangle connected to the left of the edge is pouring into it. |
boolean |
isLocked()
get the mark of the edge |
boolean |
isOnEdge(DPoint p)
Check if the point p is on edge. |
boolean |
isRight(DPoint p)
Check if the point p is on the right |
boolean |
isRightTriangleGoToEdge()
Returns true if the triangle connected to the right of the edge is pouring into it. |
boolean |
isShared()
An edge is shared when in use by two boundary parts. |
boolean |
isVertical()
Returns true if the two points of this edge have the same x coordinate. |
protected void |
setColor(Graphics g)
Set the edge color for the JFrame panel |
void |
setDegenerated(boolean degen)
Determines if this edge must be considered as degenerated or not. |
void |
setEndPoint(DPoint p)
Set edge end point. |
void |
setLeft(DTriangle aTriangle)
Set DTriangle at left of edge. |
void |
setLocked(boolean locked)
set the mark of the edge |
void |
setRight(DTriangle aTriangle)
Set DTriangle at right of edge. |
void |
setShared(boolean share)
set the shared status of this DEdge. |
void |
setStartPoint(DPoint p)
Set edge start point. |
int |
sortLeftRight(DEdge edge)
This method will be used to sort the edges using the following strategy. |
void |
swap()
Swap the 2 points of the edge also swap connected triangles |
String |
toString()
Gives a string representation of this object. |
int |
verticalSort(DEdge edge,
double abs)
Sort two edges (this and edge, indeed), and sort them according to their intersection point with the line l of equation x=abs. |
| Methods inherited from class org.jdelaunay.delaunay.geometries.Element |
|---|
getExternalGID, getGID, getHeight, getMaxWeight, getProperty, hasProperty, removeProperties, setExternalGID, setGID, setHeight, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int UPSLOPE
public static final int DOWNSLOPE
public static final int FLATSLOPE
public static final int NO_INTERSECTION
public static final int INTERSECT
public static final int COLINEAR
public static final int SHARE_EXTREMITY
public static final int SHARE_EDGE_PART
| Constructor Detail |
|---|
public DEdge()
public DEdge(DPoint start,
DPoint end)
start - end - public DEdge(DEdge ed)
ed -
public DEdge(double x,
double y,
double z,
double u,
double v,
double w)
throws DelaunayError
x - y - z - u - v - w -
DelaunayError| Method Detail |
|---|
public final void addProperty(int prop)
addProperty in class Elementprop - public final DTriangle getLeft()
public final DTriangle getRight()
public final DTriangle getOtherTriangle(DTriangle tri)
tri -
public final void setLeft(DTriangle aTriangle)
aTriangle - A triangle at left of edge.public final void setRight(DTriangle aTriangle)
aTriangle - A triangle at right of edge.public final DPoint getStartPoint()
public final DPoint getEndPoint()
public final boolean isDegenerated()
true if this is marked as degenerated.public final void setDegenerated(boolean degen)
degen - public final boolean isShared()
true if this is shared between two boundary parts.public final void setShared(boolean share)
share - public final void setStartPoint(DPoint p)
p - Start point.public final void setEndPoint(DPoint p)
p - End point.public final DPoint getPointLeft()
public final DPoint getPointRight()
public final double getSquared2DLength()
public final double get2DLength()
protected final double getSquared3DLength()
public final double get3DLength()
public final boolean isLocked()
public final void setLocked(boolean locked)
locked - public final BoundaryBox getBoundingBox()
Element
getBoundingBox in class Elementpublic final boolean contains(DPoint aPoint)
Element
contains in class Elementpublic final boolean contains(com.vividsolutions.jts.geom.Coordinate c)
Element
contains in class Elementpublic final double getDistance2D(DPoint p)
p -
public final int intersects(DEdge other)
throws DelaunayError
other -
DelaunayError
public final int intersects(DPoint p1,
DPoint p2)
throws DelaunayError
p1 - the start point of the other edgep2 - the end point of the other edge
DelaunayError
public final Element getIntersection(DPoint p1,
DPoint p2)
throws DelaunayError
p1 - p2 -
DelaunayError
public final Element getIntersection(DPoint point1,
DPoint point2,
boolean useCoordZOfp1p2)
throws DelaunayError
point1 - point2 - useCoordZOfp1p2 - If true, the coordinate of intersection get in Z the average of p1 and p2 Z. Don't care of p3 and, p4 Z.
Else if false, the coordinate of intersection get in Z the average of p1, p2, p3 and p4 Z.
DelaunayError
public final Element getIntersection(DEdge ed)
throws DelaunayError
ed -
DelaunayError
public final Element getIntersection(DEdge ed,
Map<Integer,Integer> weights)
throws DelaunayError
ed - weights -
DelaunayErrorpublic final double getZOnEdge(DPoint p)
p -
Double.NaN is returned instead.public final double getSlope()
public final double getSlopeInDegree()
public final DPoint getDirectionVector()
throws DelaunayError
DelaunayErrorpublic final boolean isInside(DPoint p)
p -
public final boolean isColinear2D(DPoint p)
p -
public final boolean isColinear(DPoint p)
p -
public final boolean haveSamePoint(DEdge anEdge)
anEdge -
public final boolean isExtremity(DPoint p)
p -
public final boolean isLeft(DPoint p)
p -
public final boolean isRight(DPoint p)
p -
public final boolean isOnEdge(DPoint p)
p -
public final boolean isVertical()
public final DPoint getPointFromItsX(double abs)
throws DelaunayError
abs -
DelaunayError - If this is vertical and this.x != abs.public final DPoint getUpperPoint()
public final DPoint getMiddle()
throws DelaunayError
DelaunayError
public final boolean isEncroached()
throws DelaunayError
DelaunayError
public final boolean isEncroachedBy(DPoint pt)
throws DelaunayError
pt -
DelaunayErrorpublic final void swap()
public final boolean isFlatSlope()
public final DPoint getBarycenter()
throws DelaunayError
DelaunayErrorpublic final boolean equals(Object other)
equals in class Objectother -
public final int hashCode()
hashCode in class Objectprotected final void setColor(Graphics g)
g -
public final void displayObject(Graphics g,
int decalageX,
int decalageY,
double minX,
double minY,
double scaleX,
double scaleY)
g - decalageX - decalageY - minX - minY - scaleX - scaleY - public final int sortLeftRight(DEdge edge)
edge -
public final void forceTopographicOrientation()
public final int compareTo(DEdge edge)
compareTo in interface Comparable<DEdge>edge -
public final int verticalSort(DEdge edge,
double abs)
throws DelaunayError
edge -
DelaunayErrorpublic final int getGradient()
public final double getSlopeAspect()
public final boolean isLeftTriangleGoToEdge()
throws DelaunayError
DelaunayError
public final boolean isRightTriangleGoToEdge()
throws DelaunayError
DelaunayErrorpublic final String toString()
toString in class Objectpublic final void deepSwap()
public final void forceTriangleSide()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||