|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.utils.math.vertexSpace.vertex3Dspace.Vertex3DSpaceCube
public class Vertex3DSpaceCube
This represent one cube of the VertexSpace. It may contain more then one vertex and is responsible for raising the errors if three vertices which are too close are inserted. It goes like this: 1) first vertex creates an epsilon surrounding, other vertices in those surrounding is reported as the first one 2) note that distance of 2 points may be 1.5 epsilon and the third one may lie in both surroundings - that's the time when error is reported Also - those cubes will be stored in HashMap for quick search. So we will need a hash and equal function. equals() is considering precision, size, x, y, z, NOT STORED VERTICES! Use add(Tuple3D) to insert and obtain a Vertex.
Field Summary | |
---|---|
protected int |
hashCode
|
protected double |
precision
|
protected int |
precisionInt
|
(package private) java.util.HashSet |
vertices
|
protected double[] |
x
X-Extends of the space cube. x[0] < x[1] |
protected double[] |
y
Y-Extends of the space cube. y[0] < y[1] |
protected double[] |
z
Z-Extends of the space cube. z[0] < z[1] |
Constructor Summary | |
---|---|
Vertex3DSpaceCube(double[] xyz,
double iSize,
int iPrecisionInt)
|
|
Vertex3DSpaceCube(double iX,
double iY,
double iZ,
double iSize,
int iPrecisionInt)
|
Method Summary | |
---|---|
Vertex3D |
addReferenceUnsafe(Vertex3D v)
|
boolean |
equals(java.lang.Object obj)
|
static int |
getHash(double x,
double y,
double z,
double size,
int precisionInt)
Returns hash code for the cube which starts at x, y, z with a certain precision. |
int |
hashCode()
|
java.util.ArrayList |
check(Tuple3D tuple)
Returns list of vertices in whose surroundings tuple lies. |
void |
remove(Vertex3D vertex)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double[] x
protected double[] y
protected double[] z
protected int precisionInt
protected double precision
protected final int hashCode
java.util.HashSet vertices
Constructor Detail |
---|
public Vertex3DSpaceCube(double iX, double iY, double iZ, double iSize, int iPrecisionInt)
public Vertex3DSpaceCube(double[] xyz, double iSize, int iPrecisionInt)
Method Detail |
---|
public static int getHash(double x, double y, double z, double size, int precisionInt)
x
- y
- z
- precisionInt
- public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.util.ArrayList check(Tuple3D tuple)
tuple
-
public void remove(Vertex3D vertex)
public Vertex3D addReferenceUnsafe(Vertex3D v)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |