|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.jhu.htm.core.HTMindexImp
HTMindex is the class for the the sky indexing routines. Author: Peter Z. Kunszt initial java port by William O'Mullane The Spatial Index is a quad tree of spherical triangles. The tree is built in the following way: Start out with 8 triangles on the sphere using the 3 main circles to determine them. Then, every triangle can be decomposed into 4 new triangles by drawing main circles between midpoints of its edges:
. . /\ . / \ . /____\ . /\ /\ . / \ / \ . /____\/____\ .This is how the quad tree is built up to a certain level by decomposing every triangle again and again. For a complete descrption, please go to the HTM index website
This implementation builds the index up to a specified level (maxlevel) You can specify that it should keep the first few levels in memory with the second constructor argument (buildlevel). The default buildlevel is 5.
Current Version =============== ID: $Id: HTMindexImp.java,v 1.2 2003/02/19 15:46:11 womullan Exp $ Revision: $Revision: 1.2 $ Date/time: $Date: 2003/02/19 15:46:11 $
Field Summary | |
int |
addlevel_
|
int |
buildlevel_
|
protected int |
index_
|
protected int |
lastSavedLeafIndex_
|
protected java.util.List |
layers_
|
protected int |
leaves_
|
int |
maxlevel_
|
protected int |
nNodes_
|
protected java.util.List |
nodes_
|
protected int |
nVertices_
|
protected int |
storedleaves_
|
protected java.util.List |
vertices_
|
Constructor Summary | |
HTMindexImp()
Constructor: depth 20 - keeping 5 levels in memory by default |
|
HTMindexImp(double degResolution)
COnstructor for index - pass your desired resolution in degrees this will contruct a HTM of level such that the triabgle widht is just less than the desired resolution. |
|
HTMindexImp(int maxlevel)
Constructor: give only the level to build - keeping 5 levels in memory by default |
|
HTMindexImp(int maxlevel,
int buildlevel)
Constructor : give the level of the index and optionally the level to build - i.e. |
Method Summary | |
double |
area(java.lang.String htmName)
The area in steradians for a given index ID |
double |
area(Vector3d n0,
Vector3d n1,
Vector3d n2)
area: routine to precompute the area of a node using AREA = 4*arctan sqrt(tan(s/2)tan((s-a)/2)tan((s-b)/2)tan((s-c)/2)) with s = (a+b+c)/2 (with many thanks to Eduard Masana @ University of Barcelona) |
Domain |
compliment(Domain d)
not implemented yet |
boolean |
contains(Domain d,
Vector3d p)
does the domain coaintain thie given point |
double |
distance(long htmId1,
long htmId2)
calls HTMfunc |
double |
distance(java.lang.String htmName1,
java.lang.String htmName2)
calls HTMfunc |
int |
idByLeafNumber(int n)
return leaf id for a certain bitlist index. |
java.lang.String |
idToName(long id)
calls HTMfunc |
Vector3d |
idToPoint(long htmId)
for the given id return the vector at the center of the triangle calls HTMfunc |
Vector3d |
idToPoint(java.lang.String htmName)
for the given id return the vector at the center of the triangle calls HTMfunc |
protected void |
init(int maxlevel,
int buildlevel)
|
HTMrange |
intersect(Domain d)
performs the intersection by calling domain.intersect |
Domain |
intersection(Domain d1,
Domain d2)
not implemented yet |
int |
leafCount()
leafCount: return number of leaf nodes |
int |
leafNumberById(long id)
return leaf number in bitlist for a certain ID. |
java.lang.String |
lookup(double ra,
double dec)
find a node by giving a ra,dec in degrees. |
java.lang.String |
lookup(Vector3d v)
find a node by giving a vector. |
long |
lookupId(double ra,
double dec)
find a node by giving a ra,dec in degrees. |
long |
lookupId(Vector3d v)
find a node by giving a vector. |
java.lang.String |
nameByLeafNumber(int n)
return name for a certain leaf index This function is simply shorthand for nameById(n + leafCount()). |
long |
nameToId(java.lang.String name)
This calls HTMfunc . |
int |
newNode(int v1,
int v2,
int v3,
long id,
int parent)
Make a new Node: insert a new node_[] into the list. |
Vector3d[] |
nodeVertex(int leaf)
nodeVertex: return the vectors of the vertices, based on a bitlist leaf index |
int[] |
nodeVertexIds(int idx)
nodeVertex: return index of vertices for a node |
int |
nVertices()
nVertices: return number of vertices |
void |
showVertices(java.io.PrintStream out)
showVertices: print every vertex to the output stream |
Domain |
simplify(Domain d)
return a HTM id number for a given position |
Domain |
smooth(Domain d)
not implemented yet |
Domain |
union(Domain d1,
Domain d2)
creates a new domain which contains all convexces of d1 and d2 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public int maxlevel_
public int buildlevel_
public int addlevel_
protected int leaves_
protected int storedleaves_
protected java.util.List nodes_
protected java.util.List layers_
protected java.util.List vertices_
protected int index_
protected int nNodes_
protected int nVertices_
protected int lastSavedLeafIndex_
Constructor Detail |
public HTMindexImp(double degResolution) throws HTMException
public HTMindexImp()
public HTMindexImp(int maxlevel)
public HTMindexImp(int maxlevel, int buildlevel)
Method Detail |
protected void init(int maxlevel, int buildlevel)
public void showVertices(java.io.PrintStream out)
public int[] nodeVertexIds(int idx)
public Vector3d[] nodeVertex(int leaf)
public int newNode(int v1, int v2, int v3, long id, int parent)
public double area(java.lang.String htmName)
area
in interface HTMindex
public double area(Vector3d n0, Vector3d n1, Vector3d n2)
public long nameToId(java.lang.String name) throws HTMException
nameToId
in interface HTMindex
HTMException
public java.lang.String idToName(long id) throws HTMException
idToName
in interface HTMindex
HTMException
public long lookupId(Vector3d v) throws HTMException
lookupId
in interface HTMindex
HTMException
public java.lang.String lookup(Vector3d v) throws HTMException
lookup
in interface HTMindex
HTMException
public int leafCount()
public int nVertices()
public int leafNumberById(long id)
public int idByLeafNumber(int n)
public java.lang.String nameByLeafNumber(int n)
public java.lang.String lookup(double ra, double dec) throws HTMException
lookup
in interface HTMindex
HTMException
public long lookupId(double ra, double dec) throws HTMException
lookupId
in interface HTMindex
HTMException
public Vector3d idToPoint(long htmId) throws HTMException
idToPoint
in interface HTMindex
HTMException
public Vector3d idToPoint(java.lang.String htmName) throws HTMException
idToPoint
in interface HTMindex
HTMException
public Domain simplify(Domain d)
HTMindex
simplify
in interface HTMindex
public boolean contains(Domain d, Vector3d p)
HTMindex
contains
in interface HTMindex
public double distance(long htmId1, long htmId2) throws HTMException
distance
in interface HTMindex
HTMException
public double distance(java.lang.String htmName1, java.lang.String htmName2) throws HTMException
distance
in interface HTMindex
HTMException
public HTMrange intersect(Domain d)
intersect
in interface HTMindex
public Domain intersection(Domain d1, Domain d2)
intersection
in interface HTMindex
public Domain union(Domain d1, Domain d2)
union
in interface HTMindex
public Domain compliment(Domain d)
compliment
in interface HTMindex
public Domain smooth(Domain d)
smooth
in interface HTMindex
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |