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).
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
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.
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

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