cz.cuni.utils.math.vertexSpace.vertex3Dspace
Class Vertex3DSpaceSimple

java.lang.Object
  extended by cz.cuni.utils.math.vertexSpace.vertex3Dspace.Vertex3DSpaceSimple
All Implemented Interfaces:
Vertex3DSpaceInterface

public class Vertex3DSpaceSimple
extends java.lang.Object
implements Vertex3DSpaceInterface

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

vertexFactory

public final Vertex3DFactoryInterface vertexFactory

vertices

public java.util.HashMap vertices
Constructor Detail

Vertex3DSpaceSimple

public Vertex3DSpaceSimple(Vertex3DFactoryInterface vfi)
Method Detail

get

public Vertex3D get(Tuple3D t)
Description copied from interface: Vertex3DSpaceInterface
Should return existing or new vertex which has "equal" coordinates.

Specified by:
get in interface Vertex3DSpaceInterface
Returns:
Vertex3D

get

public Vertex3D get(double x,
                    double y,
                    double z)
Description copied from interface: Vertex3DSpaceInterface
Should return existing or new vertex which has "equal" coordinates.

Specified by:
get in interface Vertex3DSpaceInterface
Returns:
Vertex3D

set

public void set(Vertex3D v)
Description copied from interface: Vertex3DSpaceInterface
You have to insert this vertex into space, possibly overwriting the existing one.

Specified by:
set in interface Vertex3DSpaceInterface

remove

public void remove(Vertex3D v)
Description copied from interface: Vertex3DSpaceInterface
Vertex must be removed from the space

Specified by:
remove in interface Vertex3DSpaceInterface

clear

public void clear()
Clears information about vertices, which have been created.

Specified by:
clear in interface Vertex3DSpaceInterface

main

public static void main(java.lang.String[] args)
This method is meant for testing the functionality of VertexSpace class.

Parameters:
args -