HTM Index 1.0




jhu.htmIndex
Class SpatialConvex

java.lang.Object
  |
  +--jhu.htmIndex.SpatialSign
        |
        +--jhu.htmIndex.SpatialConvex

public class SpatialConvex
extends SpatialSign

The SpatialConvex class encapsulates all the code for intersection and lookup. It represents a convex on the unit sphere (see SpatialDomain).


Fields inherited from class jhu.htmIndex.SpatialSign
mIXED, nEG, pOS, sign_, zERO
 
Constructor Summary
SpatialConvex()
          Default Constructor
SpatialConvex(SpatialVector v1, SpatialVector v2, SpatialVector v3)
          Constructor from a triangle Initialize domain from a triangle.
SpatialConvex(SpatialVector v1, SpatialVector v2, SpatialVector v3, SpatialVector v4)
          Constructor from a rectangle Initialize convex from a rectangle.
 
Method Summary
 void add(SpatialConstraint c)
          Add a constraint
 SpatialConstraint getConstraint(int c)
           
 SpatialVector getCorner(int c)
           
 int getNumberOfConstraints()
           
 void intersect(SpatialIndex idx, SpatialMarkup markup, java.util.BitSet partial, java.util.BitSet full)
          Intersect with index.
 void intersect(SpatialIndex idx, SpatialMarkup markup, java.util.List partial, java.util.List full)
          Same intersection, but the result is given in a list of nodes.
 void read(java.io.Reader in)
           
 void readRaDec(java.io.Reader in)
           
 java.lang.String toString()
           
 
Methods inherited from class jhu.htmIndex.SpatialSign
printSign
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpatialConvex

public SpatialConvex()
Default Constructor

SpatialConvex

public SpatialConvex(SpatialVector v1,
                     SpatialVector v2,
                     SpatialVector v3)
Constructor from a triangle Initialize domain from a triangle. The corners of these vectors form a triangle, so we just add three ZERO convexes to the domain where the direction is given by the cross product of the corners. Of course, the sign has to be determined (on which side of the triangle are we?) If the three points lie on one line, no convexes are added.

SpatialConvex

public SpatialConvex(SpatialVector v1,
                     SpatialVector v2,
                     SpatialVector v3,
                     SpatialVector v4)
Constructor from a rectangle Initialize convex from a rectangle. The vectors that form a rectangle may be in any order, the code finds the edges by itself. If one of the vectors lies within the triangle formed by the other three vectors, the previous constructor is used.
Method Detail

add

public void add(SpatialConstraint c)
Add a constraint

intersect

public void intersect(SpatialIndex idx,
                      SpatialMarkup markup,
                      java.util.BitSet partial,
                      java.util.BitSet full)
Intersect with index. The partial and full bitlists for the result have to be given. The markup accelerates the intersection for the index that is in memory, but is not used for the dynamically built triangles. If the conves occupies a large percent of the area of the sphere, bitlists are the preferred result method.

intersect

public void intersect(SpatialIndex idx,
                      SpatialMarkup markup,
                      java.util.List partial,
                      java.util.List full)
Same intersection, but the result is given in a list of nodes. If the conves is very small, this is the preferred result method.

getConstraint

public SpatialConstraint getConstraint(int c)

getNumberOfConstraints

public int getNumberOfConstraints()

getCorner

public SpatialVector getCorner(int c)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

read

public void read(java.io.Reader in)
          throws java.io.IOException

readRaDec

public void readRaDec(java.io.Reader in)
               throws java.io.IOException

HTM Index 1.0





©Copyright The Johns Hopkins University 1999, All Rights Reserved.
See the HTM Homepage for details.
Last Build: Oct 26, 1999 Peter Z. Kunszt