jhu.htmIndex
Class SpatialEdge
java.lang.Object
|
+--jhu.htmIndex.SpatialEdge
- public class SpatialEdge
- extends java.lang.Object
Spatial Edge class
The Edges are needed at construction time of the spatial index.
They are used to generate the midpoints of the nodes in a certain layer.
The interface is simple: construct a class giving it the SpatialIndex
and the layer number. Then call makeMidPoints. The SpatialIndex will
then have its midpoint constructed in every QuadNode.
Constructor Summary |
(package private) |
SpatialEdge(SpatialIndex tree,
int layerindex)
Constructor : give the tree and its layer |
Method Summary |
(package private) SpatialEdge.Edge |
edgeMatch(SpatialEdge.Edge em)
edgeMatch: fast lookup using the first index em->start_. |
(package private) int |
getMidPoint(SpatialEdge.Edge em)
getMidPoint: compute the midpoint of the edge using vector
algebra and return its index in the vertex list |
(package private) void |
insertLookup(SpatialEdge.Edge em)
insertLookup: insert the edge em into the lookup table. |
(package private) void |
makeMidPoints()
makeMidPoints: interface to this class. |
(package private) int |
newEdge(int emindex,
int index,
int k)
Make a new edge, in the temporary edges_ at emindex, at
node_[index] using the k'th side. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tree_
SpatialIndex tree_
lTab_
SpatialEdge.Edge[] lTab_
edges_
SpatialEdge.Edge[] edges_
index_
int index_
layer_
SpatialLayer layer_
SpatialEdge
SpatialEdge(SpatialIndex tree,
int layerindex)
- Constructor : give the tree and its layer
makeMidPoints
void makeMidPoints()
- makeMidPoints: interface to this class. Set midpoints of every
node in this layer.
newEdge
int newEdge(int emindex,
int index,
int k)
- Make a new edge, in the temporary edges_ at emindex, at
node_[index] using the k'th side. Since every edge belongs to
two faces, we have to check wether an edge has been already
processed or not (i.e. the midpoint has been constructed or
not). We have a lookup table for this purpose. Every edge is
stored at lTab[start_]. There may be up to 6 edges in every
vertex[start_] so if that table place is occupied, store it in
the next table position (and so on). So we only have to look up
6 positions at most.
insertLookup
void insertLookup(SpatialEdge.Edge em)
- insertLookup: insert the edge em into the lookup table.
indexed by em->start_.
Every vertex has at most 6 edges, so only
that much lookup needs to be done.
edgeMatch
SpatialEdge.Edge edgeMatch(SpatialEdge.Edge em)
- edgeMatch: fast lookup using the first index em->start_.
return pointer to edge if matches, null if not.
getMidPoint
int getMidPoint(SpatialEdge.Edge em)
- getMidPoint: compute the midpoint of the edge using vector
algebra and return its index in the vertex list