HTM SpatialIndex Class Reference

class htmInterface

htmInterface class

Public Methods

htmInterface (size_t depth = 5, size_t saveDepth = 2)
Constructor
~htmInterface ()
Destructor
const SpatialIndex& index () const
Access the index associated with the interface
uint64 lookupID (float64 ra, float64 dec) const
Lookup a node ID from ra,dec
uint64 lookupID (float64 x, float64 y, float64 z) const
Lookup a node ID from x,y,z
uint64 lookupID (char *) const
Lookup the ID from the Name string
uint64 lookupIDCmd (char *)
Lookup a node ID from a string command
const char* lookupName (float64 ra, float64 dec)
Lookup a node name from ra,dec Given a certain RA,DEC and index depth return its HTM NodeName
const char* lookupName (float64 x, float64 y, float64 z)
Lookup a node name from x,y,z
const char* lookupName (uint64 ID)
Lookup a node name from a node ID
const char* lookupNameCmd (char *)
Lookup a node name using a string command
const ValVec <htmRange> & circleRegion ( float64 ra, float64 dec, float64 rad )
Request all triangles in a circular region
const ValVec <htmRange> & circleRegion ( float64 x, float64 y, float64 z, float64 rad )
Request all triangles in a circular region
const ValVec <htmRange> & circleRegionCmd ( char *str )
Request all triangles in a circular region
const ValVec <htmRange> & convexHull ( ValVec ra, ValVec dec )
Request all triangles in the convex hull of a given set of points
const ValVec <htmRange> & convexHull ( ValVec x, ValVec y, ValVec z )
Request all triangles in the convex hull of a given set of points
const ValVec <htmRange> & convexHullCmd ( char *str )
Request all triangles in the convex hull of a given set of points
const ValVec <htmRange> & domain ( SpatialDomain & )
Give the ranges for an intersection with a proper domain
const ValVec <htmRange> & domainCmd ( char *str )
String interface for domain intersection
void changeDepth (size_t depth, size_t saveDepth = 2)
Change the current index depth
static bool isInteger (const VarStr &)
Check whether a varstring is an integer
static bool isFloat (const VarStr &)
Check whether a varstring is a float
static bool inRange ( const ValVec<htmRange> &, int64 )
Check whether a range contains a certain id
static void printRange ( const ValVec<htmRange> & )
Print the ranges to cout

Documentation

htmInterface class. The SpatialInterface class contains all methods to interface the HTM index with external applications.
htmInterface(size_t depth = 5, size_t saveDepth = 2)
Constructor. The depth is optional, defaulting to level 5. It can be changed with the changeDepth() memberfunction or it can be specified with one of the string command interfaces. The saveDepth parameter can be specified to keep the given amount of levels in memory. This can also be altered by changeDepth.

~htmInterface()
Destructor

const SpatialIndex& index() const
Access the index associated with the interface

uint64 lookupID(float64 ra, float64 dec) const
Lookup a node ID from ra,dec. Given a certain RA,DEC and index depth return its HTM ID.

uint64 lookupID(float64 x, float64 y, float64 z) const
Lookup a node ID from x,y,z. Given a certain cartesian vector x,y,z and index depth return its HTM ID.

uint64 lookupID(char *) const
Lookup the ID from the Name string

uint64 lookupIDCmd(char *)
Lookup a node ID from a string command. The string in the input may have one of the following forms:
  • "J2000 depth ra dec"
  • "CARTESIAN depth x y z"
  • "NAME name"
The string will be evaluated depending on how many items it has. SpatialInterfaceError is thrown if the string is unexpected.

const char* lookupName(float64 ra, float64 dec)
Lookup a node name from ra,dec Given a certain RA,DEC and index depth return its HTM NodeName

const char* lookupName(float64 x, float64 y, float64 z)
Lookup a node name from x,y,z. Given a certain cartesian vector x,y,z and index depth return its HTM NodeName.

const char* lookupName(uint64 ID)
Lookup a node name from a node ID

const char* lookupNameCmd(char *)
Lookup a node name using a string command. The string in the input may have one of the following forms:
  • "J2000 depth ra dec"
  • "CARTESIAN depth x y z"
  • "ID id"
The string will be evaluated depending on how many items it has. SpatialInterfaceError is thrown if the string is unexpected.

const ValVec <htmRange> & circleRegion( float64 ra, float64 dec, float64 rad )
Request all triangles in a circular region. Given are the center coordinate and radius in arcminutes.

const ValVec <htmRange> & circleRegion( float64 x, float64 y, float64 z, float64 rad )
Request all triangles in a circular region. Given are the center coordinate and radius in arcminutes.

const ValVec <htmRange> & circleRegionCmd( char *str )
Request all triangles in a circular region. Given are the center coordinate and radius in arcminutes. Same as previous two functions but from a string.

const ValVec <htmRange> & convexHull( ValVec ra, ValVec dec )
Request all triangles in the convex hull of a given set of points

const ValVec <htmRange> & convexHull( ValVec x, ValVec y, ValVec z )
Request all triangles in the convex hull of a given set of points

const ValVec <htmRange> & convexHullCmd( char *str )
Request all triangles in the convex hull of a given set of points. The points are given in the string in the following form:
" J2000 depth ra dec ra dec ra dec "  
or
" CARTESIAN depth x y z x y z x y z "
There may be as many points ra, dec or x,y,z as you want.

const ValVec <htmRange> & domain( SpatialDomain & )
Give the ranges for an intersection with a proper domain

const ValVec <htmRange> & domainCmd( char *str )
String interface for domain intersection. The domain should be given in the following form:
DOMAIN depth
nConvexes
nConstraints in convex 1
x y z d
x y z d
.
.
x y z d
nConstraints in convex 2
x y z d
x y z d
.
.
x y z d
.
.
.
nConstrinats in convex n
x y z d
x y z d
.
.
x y z d

The numbers need to be separated by whitespace (newlines are allowed). Throws SpatialInterfaceError on syntax errors.

void changeDepth(size_t depth, size_t saveDepth = 2)
Change the current index depth

static bool isInteger(const VarStr &)
Check whether a varstring is an integer

static bool isFloat(const VarStr &)
Check whether a varstring is a float

static bool inRange( const ValVec<htmRange> &, int64 )
Check whether a range contains a certain id

static void printRange( const ValVec<htmRange> & )
Print the ranges to cout


This class has no child classes.

alphabetic index hierarchy of classes


© Copyright The Johns Hopkins University 1999, All Rights Reserved.
Peter Z. Kunszt,

generated by doc++