Package il.ac.idc.jdt
Class Triangle
java.lang.Object
il.ac.idc.jdt.Triangle
- All Implemented Interfaces:
Serializable
This class performs a 3D triangulation for each point inserted or deleted
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
determinates if this triangle contains the point p.boolean
determinates if this triangle contains the point p.boolean
fallInsideCircumcircle
(Point[] arrayPoints) getA()
returns the first vertex of this triangle.returns the consecutive triangle which shares this triangle a,b edge.getB()
returns the second vertex of this triangle.returns the consecutive triangle which shares this triangle b,c edge.getC()
returns the 3th vertex of this triangle.returns the consecutive triangle which shares this triangle c,a edge.int
getMc()
Modification counter for triangulation fast updatedouble
getZ
(double x, double y) compute the Z value for the X,Y values of q. assume this triangle represent a plane --> q does NOT need to be contained in this triangle.compute the Z value for the X,Y values of q. assume this triangle represent a plane --> q does NOT need to be contained in this triangle.boolean
Checks if the given point is a corner of this triangle.boolean
returns true iff this triangle is actually a half plane.boolean
isMark()
void
void
setAbTriangle
(Triangle abTriangle) void
void
setBcTriangle
(Triangle bcTriangle) void
void
void
setHalfplane
(boolean halfplane) void
setMark
(boolean mark) void
setMc
(int mc) toString()
double
compute the Z value for the X,Y values of q.
-
Constructor Details
-
Triangle
constructs a triangle form 3 point - store it in counterclockwised order. -
Triangle
creates a half plane using the segment (A,B).- Parameters:
A
-B
-
-
-
Method Details
-
getBoundingBox
- Returns:
- The bounding rectange between the minimum and maximum coordinates of the triangle
-
toString
-
contains
determinates if this triangle contains the point p.- Parameters:
p
- the query point- Returns:
- true iff p is not null and is inside this triangle (Note: on boundary is considered inside!!).
-
containsBoundaryIsOutside
determinates if this triangle contains the point p.- Parameters:
p
- the query point- Returns:
- true iff p is not null and is inside this triangle (Note: on boundary is considered outside!!).
-
isCorner
Checks if the given point is a corner of this triangle.- Parameters:
p
- The given point.- Returns:
- True iff the given point is a corner of this triangle. By Eyal Roth invalid input: '&' Doron Ganel.
-
fallInsideCircumcircle
-
zValue
compute the Z value for the X,Y values of q.
assume this triangle represent a plane --> q does NOT need to be contained in this triangle.- Parameters:
q
- query point (its Z value is ignored).- Returns:
- the Z value of this plane implies by this triangle 3 points.
-
getZ
public double getZ(double x, double y) compute the Z value for the X,Y values of q. assume this triangle represent a plane --> q does NOT need to be contained in this triangle.- Parameters:
x
- x-coordinate of the query point.y
- y-coordinate of the query point.- Returns:
- z (height) value approximation given by the triangle it falls in.
-
getZ
compute the Z value for the X,Y values of q. assume this triangle represent a plane --> q does NOT need to be contained in this triangle.- Parameters:
q
- query point (its Z value is ignored).- Returns:
- q with updated Z value.
-
isMark
public boolean isMark() -
setMark
public void setMark(boolean mark) -
getMc
public int getMc()Modification counter for triangulation fast update- Returns:
-
isHalfplane
public boolean isHalfplane()returns true iff this triangle is actually a half plane. -
setHalfplane
public void setHalfplane(boolean halfplane) -
setMc
public void setMc(int mc) -
getAbTriangle
returns the consecutive triangle which shares this triangle a,b edge. -
setAbTriangle
-
getBcTriangle
returns the consecutive triangle which shares this triangle b,c edge. -
setBcTriangle
-
getCaTriangle
returns the consecutive triangle which shares this triangle c,a edge. -
setCanext
-
getA
returns the first vertex of this triangle. -
setA
-
getB
returns the second vertex of this triangle. -
setB
-
getC
returns the 3th vertex of this triangle. -
setC
-