|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.utils.math.vertexSpace.vertex3Dspace.Vertex3DSpaceSimple
public class Vertex3DSpaceSimple
In graphics we're in fact are working with discreet space. In math.M you have constants EPSILON / etc. which defines precision we're counting with. Vertex hash codes are created with respect to this precision (as they won't have doubles in x, y, z but long ~ discreet space). Idea behind this class is, that we're filling HashMap with vertexes and when we want to add vertex to a place where already someone is, we returns reference to an existing vertex instead.
Field Summary | |
---|---|
Vertex3DFactoryInterface |
vertexFactory
|
java.util.HashMap |
vertices
|
Constructor Summary | |
---|---|
Vertex3DSpaceSimple(Vertex3DFactoryInterface vfi)
|
Method Summary | |
---|---|
void |
clear()
Clears information about vertices, which have been created. |
Vertex3D |
get(double x,
double y,
double z)
Should return existing or new vertex which has "equal" coordinates. |
Vertex3D |
get(Tuple3D t)
Should return existing or new vertex which has "equal" coordinates. |
static void |
main(java.lang.String[] args)
This method is meant for testing the functionality of VertexSpace class. |
void |
remove(Vertex3D v)
Vertex must be removed from the space |
void |
set(Vertex3D v)
You have to insert this vertex into space, possibly overwriting the existing one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Vertex3DFactoryInterface vertexFactory
public java.util.HashMap vertices
Constructor Detail |
---|
public Vertex3DSpaceSimple(Vertex3DFactoryInterface vfi)
Method Detail |
---|
public Vertex3D get(Tuple3D t)
Vertex3DSpaceInterface
get
in interface Vertex3DSpaceInterface
public Vertex3D get(double x, double y, double z)
Vertex3DSpaceInterface
get
in interface Vertex3DSpaceInterface
public void set(Vertex3D v)
Vertex3DSpaceInterface
set
in interface Vertex3DSpaceInterface
public void remove(Vertex3D v)
Vertex3DSpaceInterface
remove
in interface Vertex3DSpaceInterface
public void clear()
clear
in interface Vertex3DSpaceInterface
public static void main(java.lang.String[] args)
args
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |