|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.utils.math.extended.Triangle2D
public class Triangle2D
Field Summary | |
---|---|
int |
hashCode
|
double[] |
max
contains maximums from vertices x, y ... indexed 0 == X, 1 == Y |
double[] |
min
contains minimums from vertices x, y ... indexed 0 == X, 1 == Y |
Vertex2D[] |
vertices
List of triangles vertices. |
protected java.util.HashMap |
verticesHM
We will store vertices also in hashset allowing method equals() to be as fast as possible. |
Constructor Summary | |
---|---|
Triangle2D(Segment2D s1,
Segment2D s2,
Segment2D s3)
|
|
Triangle2D(Vertex2D v1,
Vertex2D v2,
Vertex2D v3)
|
Method Summary | |
---|---|
protected int |
countHashCode()
If triangle is a one point ... hash code == 0 If exactly two vertices are the same ... hash code == 1 Otherwise we need to sort it according to verties' coordinates. |
boolean |
equals(java.lang.Object o)
|
Tuple2D |
getOrthocenter()
|
Vertex2D |
getVertex2D(int index)
|
int |
hashCode()
|
boolean |
hasVertex(Vertex2D v)
|
protected void |
checkMinMax(Vertex2D v)
|
protected void |
init()
|
protected void |
initVertices(Vertex2D v1,
Vertex2D v2,
Vertex2D v3)
|
protected void |
initVerticesFromEdges(Segment2D s1,
Segment2D s2,
Segment2D s3)
|
protected void |
recountMinMax()
Recount min / max properties. |
protected void |
setVertex(int index,
Vertex2D vertex)
|
protected void |
setVertexAndHS(int index,
Vertex2D vertex)
|
boolean |
swapVertex(Vertex2D toBeSwapped,
Vertex2D newVertex)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Vertex2D[] vertices
protected java.util.HashMap verticesHM
public double[] min
public double[] max
public final int hashCode
Constructor Detail |
---|
public Triangle2D(Vertex2D v1, Vertex2D v2, Vertex2D v3)
public Triangle2D(Segment2D s1, Segment2D s2, Segment2D s3)
Method Detail |
---|
protected void init()
protected void initVertices(Vertex2D v1, Vertex2D v2, Vertex2D v3)
protected void initVerticesFromEdges(Segment2D s1, Segment2D s2, Segment2D s3)
public java.lang.String toString()
toString
in class java.lang.Object
protected int countHashCode()
protected void setVertexAndHS(int index, Vertex2D vertex)
protected void setVertex(int index, Vertex2D vertex)
public Vertex2D getVertex2D(int index)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
protected void checkMinMax(Vertex2D v)
protected void recountMinMax()
public boolean hasVertex(Vertex2D v)
public boolean swapVertex(Vertex2D toBeSwapped, Vertex2D newVertex)
public Tuple2D getOrthocenter()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |