Package il.ac.idc.jdt
Class Triangle
- java.lang.Object
-
- il.ac.idc.jdt.Triangle
-
- All Implemented Interfaces:
Serializable
public class Triangle extends Object implements Serializable
This class performs a 3D triangulation for each point inserted or deleted- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(Point p)
determinates if this triangle contains the point p.boolean
containsBoundaryIsOutside(Point p)
determinates if this triangle contains the point p.boolean
fallInsideCircumcircle(Point[] arrayPoints)
Point
getA()
returns the first vertex of this triangle.Triangle
getAbTriangle()
returns the consecutive triangle which shares this triangle a,b edge.Point
getB()
returns the second vertex of this triangle.Triangle
getBcTriangle()
returns the consecutive triangle which shares this triangle b,c edge.BoundingBox
getBoundingBox()
Point
getC()
returns the 3th vertex of this triangle.Triangle
getCaTriangle()
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.Point
getZ(Point q)
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
isCorner(Point p)
Checks if the given point is a corner of this triangle.boolean
isHalfplane()
returns true iff this triangle is actually a half plane.boolean
isMark()
void
setA(Point a)
void
setAbTriangle(Triangle abTriangle)
void
setB(Point b)
void
setBcTriangle(Triangle bcTriangle)
void
setC(Point c)
void
setCanext(Triangle canext)
void
setHalfplane(boolean halfplane)
void
setMark(boolean mark)
void
setMc(int mc)
String
toString()
double
zValue(Point q)
compute the Z value for the X,Y values of q.
-
-
-
Method Detail
-
getBoundingBox
public BoundingBox getBoundingBox()
- Returns:
- The bounding rectange between the minimum and maximum coordinates of the triangle
-
contains
public boolean contains(Point p)
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
public boolean containsBoundaryIsOutside(Point p)
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
public boolean isCorner(Point p)
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 & Doron Ganel.
-
fallInsideCircumcircle
public boolean fallInsideCircumcircle(Point[] arrayPoints)
-
zValue
public double zValue(Point q)
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
public Point getZ(Point q)
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
public Triangle getAbTriangle()
returns the consecutive triangle which shares this triangle a,b edge.
-
setAbTriangle
public void setAbTriangle(Triangle abTriangle)
-
getBcTriangle
public Triangle getBcTriangle()
returns the consecutive triangle which shares this triangle b,c edge.
-
setBcTriangle
public void setBcTriangle(Triangle bcTriangle)
-
getCaTriangle
public Triangle getCaTriangle()
returns the consecutive triangle which shares this triangle c,a edge.
-
setCanext
public void setCanext(Triangle canext)
-
getA
public Point getA()
returns the first vertex of this triangle.
-
setA
public void setA(Point a)
-
getB
public Point getB()
returns the second vertex of this triangle.
-
setB
public void setB(Point b)
-
getC
public Point getC()
returns the 3th vertex of this triangle.
-
setC
public void setC(Point c)
-
-