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 booleancontains(Point p)determinates if this triangle contains the point p.booleancontainsBoundaryIsOutside(Point p)determinates if this triangle contains the point p.booleanfallInsideCircumcircle(Point[] arrayPoints)PointgetA()returns the first vertex of this triangle.TrianglegetAbTriangle()returns the consecutive triangle which shares this triangle a,b edge.PointgetB()returns the second vertex of this triangle.TrianglegetBcTriangle()returns the consecutive triangle which shares this triangle b,c edge.BoundingBoxgetBoundingBox()PointgetC()returns the 3th vertex of this triangle.TrianglegetCaTriangle()returns the consecutive triangle which shares this triangle c,a edge.intgetMc()Modification counter for triangulation fast updatedoublegetZ(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.PointgetZ(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.booleanisCorner(Point p)Checks if the given point is a corner of this triangle.booleanisHalfplane()returns true iff this triangle is actually a half plane.booleanisMark()voidsetA(Point a)voidsetAbTriangle(Triangle abTriangle)voidsetB(Point b)voidsetBcTriangle(Triangle bcTriangle)voidsetC(Point c)voidsetCanext(Triangle canext)voidsetHalfplane(boolean halfplane)voidsetMark(boolean mark)voidsetMc(int mc)StringtoString()doublezValue(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)
-
-