|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.utils.math.extended.Triangle3D
public class Triangle3D
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 |
protected Tuple3D |
orthocenter
|
Plane3D |
plane
|
Vertex3D[] |
vertices
List of triangles vertices in normalizedOrder. |
protected java.util.HashMap |
verticesHM
We will store vertices also in hashset allowing method equals() to be as fast as possible. |
Constructor Summary | |
---|---|
Triangle3D(Segment3D s1,
Segment3D s2,
Segment3D s3)
|
|
Triangle3D(Vertex3D v1,
Vertex3D v2,
Vertex3D 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)
|
Tuple3D |
getOrthocenter()
|
Vertex3D |
getVertex3D(int index)
|
int |
hashCode()
|
boolean |
hasVertex(Vertex3D v)
|
protected void |
checkMinMax(Vertex3D v)
|
protected void |
init()
|
protected void |
initVertices(Vertex3D v1,
Vertex3D v2,
Vertex3D v3)
|
protected void |
initVerticesFromEdges(Segment3D s1,
Segment3D s2,
Segment3D s3)
|
protected void |
recountMinMax()
Recount min / max properties. |
void |
recountPlane()
Recounts plane equation, taking first three vertices from property 'vertices'. |
void |
recountPlane(Tuple3D normal)
Recounts plane equation using normal provided. |
protected void |
setVertex(int index,
Vertex3D vertex)
|
protected void |
setVertexAndHM(int index,
Vertex3D vertex)
|
boolean |
swapVertex(Vertex3D toBeSwapped,
Vertex3D newVertex)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Vertex3D[] vertices
protected java.util.HashMap verticesHM
public double[] min
public double[] max
public Plane3D plane
protected Tuple3D orthocenter
public final int hashCode
Constructor Detail |
---|
public Triangle3D(Vertex3D v1, Vertex3D v2, Vertex3D v3)
public Triangle3D(Segment3D s1, Segment3D s2, Segment3D s3)
Method Detail |
---|
protected void init()
protected void initVertices(Vertex3D v1, Vertex3D v2, Vertex3D v3)
protected void initVerticesFromEdges(Segment3D s1, Segment3D s2, Segment3D s3)
public java.lang.String toString()
toString
in class java.lang.Object
protected int countHashCode()
protected void setVertexAndHM(int index, Vertex3D vertex)
protected void setVertex(int index, Vertex3D vertex)
public Vertex3D getVertex3D(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(Vertex3D v)
protected void recountMinMax()
public void recountPlane()
public void recountPlane(Tuple3D normal)
public boolean hasVertex(Vertex3D v)
public boolean swapVertex(Vertex3D toBeSwapped, Vertex3D newVertex)
public Tuple3D getOrthocenter()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |