public class DTriangle extends Element implements Comparable<DTriangle>
| Modifier and Type | Field and Description |
|---|---|
static int |
PT_NB |
WEIGHTED_PROPERTIES| Constructor and Description |
|---|
DTriangle(DEdge e1,
DEdge e2,
DEdge e3)
Create a new triangle with the three given edges as a basis.
|
DTriangle(DPoint p1,
DPoint p2,
DPoint p3)
Create a new triangle with three input points.
|
DTriangle(DTriangle aTriangle)
Create a DTriangle from another triangle
NB : it doesn't update edges connection - topology is not preserved. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
belongsTo(DPoint aPoint)
Check if the point is an apex of the triangle
|
boolean |
checkTopology()
Check if triangle topology is correct or not
|
int |
compareTo(DTriangle t)
Implements the Comparable interface.
|
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 |
displayObject(Graphics g,
int decalageX,
int decalageY,
double minX,
double minY,
double scaleX,
double scaleY)
Display the triangle in a JPanel Must be used only when using package
drawing
|
protected void |
displayObjectCircles(Graphics g,
int decalageX,
int decalageY)
Display the triangle in a JPanel Must be used only when using package
drawing
|
boolean |
equals(Object other)
Used to check if this is equal to other.
|
void |
forceCoherenceWithEdges()
This method force the link between this and its edges, and ensure that
edges are not pointing to duplicates of this triangle.
|
DPoint |
getAlterPoint(DPoint p1,
DPoint p2)
Get the point of the triangle that is not one of the 2 points given
in argument.
|
double |
getAngle(int k)
Retrieve the angle, in degrees, at vertex number k.
|
double |
getArea()
Compute triangle area
|
DPoint |
getBarycenter()
Get the barycenter of the triangle as a DPoint
|
BoundaryBox |
getBoundingBox()
Computed bounding box
|
com.vividsolutions.jts.geom.Coordinate |
getCircumCenter()
Get the center of the CircumCircle
|
Element |
getCircumCenterContainer()
Return the triangle of the mesh that contains the center of this DTriangle.
|
Element |
getCircumCenterContainerSafe()
Return the triangle of the mesh that contains the center of this DTriangle.
|
DEdge |
getContainingEdge(DPoint pt)
Get the edge that contains pt (if any, and the first found if pt is an apex)
|
DPoint |
getCounterSteepestIntersection(DPoint dp)
Compute the intersection point according to the vector opposite to the steepest
vector.
|
DEdge |
getEdge(int i)
Get the ith edge
i must be equal to 0, 1 or 2.
|
protected DEdge |
getEdgeFromPoints(DPoint p1,
DPoint p2)
Get the edge of the triangle that includes the two point
|
int |
getEdgeIndex(DEdge ed)
Get the index of the edge in the triangle.
|
DEdge[] |
getEdges()
Return the edges that form this triangle in an array.
|
DEdge |
getLastEdge(DEdge e1,
DEdge e2)
Get the last edge that form, with e1 and e2, this triangle.
|
DPoint |
getLeftMost()
Get the leftmost point of this triangle.
|
double |
getMaxAngle()
Return the maximal angle of this triangle.
|
double |
getMinAngle()
Return the maximal angle og this triangle.
|
double |
getMinSquareDistance(DPoint pt)
Return the square of the minimal distance between pt and the apex
of this triangle.
|
DPoint |
getNormalVector()
Get the normal vector to this triangle, of length 1.
|
DEdge |
getOppositeEdge(DPoint pt)
Return the edge that is not linked to pt, or null if pt is not a
point of this triangle.
|
DPoint |
getOppositePoint(DEdge ed)
Get the point of the triangle that does not belong to the edge
|
DPoint |
getPoint(int i)
Get the ith point. i must be equal to 0, 1 or 2.
|
List<DPoint> |
getPoints()
Get a list of points containing the
DPoint that define this triangle. |
double |
getRadius()
Get the radius of the CircumCircle
|
double |
getSlope()
Get the slope of this DTriangle.
|
double |
getSlopeAspect()
Compute the azimut of the triangle in degrees between north and steeepest vector.
|
double |
getSlopeInDegree()
get the slope of this DTriangle, in degrees.
|
double |
getSlopeInPercent()
Compute the slope of the triangle in percent
|
DPoint |
getSteepestIntersectionPoint(DPoint dPoint)
Compute the intersection point according the steepest vector.
|
DPoint |
getSteepestVector()
Get the vector with the highest down slope in the plan associated to this triangle.
|
int |
hashCode() |
int |
inCircle(DPoint aPoint)
Check if the aPoint is in or on the circumcircle of this triangle.
|
double |
interpolateZ(DPoint aPoint)
Get Z value of a specific point in the triangle
|
boolean |
isCloser(DPoint pt,
double threshold)
Returns true if the minimal distance between pt and one of the apex
is smaller than threshold.
|
boolean |
isEdgeOf(DEdge ed)
Returns true if ed is equals to one of the edges that form this triangle.
|
boolean |
isFlatSlope()
Check if the triangle is flat or not.
|
boolean |
isInside(DPoint aPoint)
Check if the point is inside the triangle
|
boolean |
isOnAnEdge(DPoint pt)
Determines if pt lies on one of the edges of this triangle.
|
boolean |
isProcessed()
If true, the triangle is supposed to be in the structure that stores the
already processed triangles.
|
boolean |
isSeenForFlatRemoval()
check if this triangle has already been encountered (and marked if flat)
during the flat removal operation.
|
boolean |
isTopoOrientedToEdge(DEdge ed)
Returns true if the triangle is turned toward the edge ed.
|
void |
recomputeCenter()
Recompute the center of the circle that joins the ptNb points : the CircumCenter
|
Element |
searchPointContainer(DPoint pt)
This method recursively search for pt in the mesh.
|
boolean |
setEdge(int i,
DEdge anEdge)
Set the ith edge.
|
void |
setProcessed(boolean pro)
Set the processed attribute.
|
void |
setSeenForFlatRemoval(boolean seenForFlatRemoval)
Set the value of the seenForFlatRemoval attribute, that is used to
process flat triangles only once during the flat tiangles removal operation.
|
boolean |
sharedByTwoEdge(DPoint pt)
test if pt is an apex of this triangle.
|
double |
softInterpolateZ(DPoint aPoint)
Get Z value of a specific point in the triangle
Take into account triangles connected to the edge
|
String |
toString()
Gives a rperesentation of this triangle as a String.
|
addProperty, getExternalGID, getGID, getHeight, getMaxWeight, getProperty, hasProperty, removeProperties, setExternalGID, setGID, setHeight, setPropertypublic static final int PT_NB
public DTriangle(DEdge e1, DEdge e2, DEdge e3) throws DelaunayError
An integrity check is processed while building the triangle. This constructor is the best way to ensure that already existing edges will be linked to the good triangles, and that ther won't be any edge duplication in the data structures.
e1 - e2 - e3 - DelaunayError - If there is at least two edges that don't share exactly a point.public DTriangle(DPoint p1, DPoint p2, DPoint p3) throws DelaunayError
p1 - p2 - p3 - DelaunayErrorpublic DTriangle(DTriangle aTriangle)
aTriangle - public final List<DPoint> getPoints()
DPoint that define this triangle.This method is consistent with getPoint, ie getPoints().get(i)==getPoint(i).
public final DPoint getPoint(int i)
This method is consistent with getPoints, ie getPoints().get(i)==getPoint(i).
i - public final DEdge getEdge(int i)
i - public final DEdge[] getEdges()
This method is consistent with getEdge(i), ie getEdge(i)==getEdges()[i]
public final int getEdgeIndex(DEdge ed)
ed - public final boolean setEdge(int i,
DEdge anEdge)
i - anEdge - true if anEdge has been successfully inserted, false otherwise.public final double getRadius()
public final com.vividsolutions.jts.geom.Coordinate getCircumCenter()
public final boolean isSeenForFlatRemoval()
public final void setSeenForFlatRemoval(boolean seenForFlatRemoval)
seenForFlatRemoval - public final boolean isProcessed()
public final void setProcessed(boolean pro)
pro - public final BoundaryBox getBoundingBox()
ElementgetBoundingBox in class Elementpublic final DPoint getLeftMost()
public final DEdge getLastEdge(DEdge e1, DEdge e2)
e1 - e2 - public final boolean contains(DPoint aPoint)
Elementpublic final boolean contains(com.vividsolutions.jts.geom.Coordinate c)
throws DelaunayError
Elementcontains in class ElementDelaunayErrorpublic final boolean isOnAnEdge(DPoint pt)
pt - public final void recomputeCenter()
throws DelaunayError
DelaunayErrorpublic final int inCircle(DPoint aPoint)
aPoint - public final boolean isInside(DPoint aPoint)
aPoint - public final double interpolateZ(DPoint aPoint)
aPoint - public final double softInterpolateZ(DPoint aPoint)
aPoint - public final double getArea()
public final DPoint getNormalVector() throws DelaunayError
DelaunayErrorpublic final DPoint getSteepestVector() throws DelaunayError
DelaunayErrorpublic final double getSlope()
throws DelaunayError
DelaunayErrorpublic final double getSlopeInDegree()
throws DelaunayError
DelaunayErrorpublic final double getMinAngle()
public final double getMaxAngle()
public final boolean checkTopology()
public final boolean sharedByTwoEdge(DPoint pt)
pt - public final boolean isFlatSlope()
public final DPoint getOppositePoint(DEdge ed)
ed - public final DEdge getOppositeEdge(DPoint pt)
pt - public final DPoint getAlterPoint(DPoint p1, DPoint p2)
p1 - p2 - protected final DEdge getEdgeFromPoints(DPoint p1, DPoint p2)
p1 - p2 - public final boolean belongsTo(DPoint aPoint)
aPoint - public final DPoint getBarycenter() throws DelaunayError
DelaunayErrorpublic final String toString()
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 - protected final void displayObjectCircles(Graphics g, int decalageX, int decalageY)
g - decalageX - decalageY - public final boolean equals(Object other)
public final int compareTo(DTriangle t)
compareTo in interface Comparable<DTriangle>t - public final double getAngle(int k)
k - public final double getSlopeInPercent()
throws DelaunayError
DelaunayErrorpublic final double getSlopeAspect()
throws DelaunayError
DelaunayErrorpublic final boolean isTopoOrientedToEdge(DEdge ed) throws DelaunayError
ed - DelaunayErrorpublic final DPoint getSteepestIntersectionPoint(DPoint dPoint) throws DelaunayError
DelaunayErrorpublic final DPoint getCounterSteepestIntersection(DPoint dp) throws DelaunayError
dp - DelaunayErrorpublic final Element getCircumCenterContainer() throws DelaunayError
DelaunayErrorpublic final Element getCircumCenterContainerSafe() throws DelaunayError
null if a constraint is crossed while searching for the circumcenter.DelaunayErrorpublic final Element searchPointContainer(DPoint pt) throws DelaunayError
pt - DelaunayErrorpublic final DEdge getContainingEdge(DPoint pt)
pt - public final boolean isEdgeOf(DEdge ed)
ed - public final double getMinSquareDistance(DPoint pt)
pt - public final boolean isCloser(DPoint pt, double threshold)
pt - threshold - public final void forceCoherenceWithEdges()
Copyright © 2013 IRSTV CNRS-FR-2488. All Rights Reserved.