lsst.sphgeom gb956055f9b+164b02c8d4
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
lsst::sphgeom::Mq3cPixelization Class Reference

#include <Mq3cPixelization.h>

Inheritance diagram for lsst::sphgeom::Mq3cPixelization:
lsst::sphgeom::Pixelization

Public Member Functions

 Mq3cPixelization (int level)
 
int getLevel () const
 getLevel returns the subdivision level of this pixelization.
 
RangeSet universe () const override
 universe returns the set of all pixel indexes for this pixelization. More...
 
std::unique_ptr< Regionpixel (uint64_t i) const override
 
uint64_t index (UnitVector3d const &v) const override
 index computes the index of the pixel for v. More...
 
std::string toString (uint64_t i) const override
 toString converts the given pixel index to a human-readable string. More...
 
- Public Member Functions inherited from lsst::sphgeom::Pixelization
RangeSet envelope (Region const &r, size_t maxRanges=0) const
 
RangeSet interior (Region const &r, size_t maxRanges=0) const
 

Static Public Member Functions

static int level (uint64_t i)
 
static ConvexPolygon quad (uint64_t i)
 
static std::vector< uint64_t > neighborhood (uint64_t i)
 
static std::string asString (uint64_t i)
 

Static Public Attributes

static constexpr int MAX_LEVEL = 30
 The maximum supported cube-face grid resolution is 2^30 by 2^30.
 

Detailed Description

Mq3cPixelization provides modified Q3C indexing of points and regions.

Instances of this class are immutable and very cheap to copy.

Warning
Setting the maxRanges argument for envelope() or interior() to a non-zero value below 4 can result in very poor region pixelizations regardless of region size. For instance, if maxRanges is 1, a non-empty circle centered on an axis will be approximated by the indexes for an entire cube face, even as the circle radius tends to 0.

Constructor & Destructor Documentation

◆ Mq3cPixelization()

lsst::sphgeom::Mq3cPixelization::Mq3cPixelization ( int  level)
explicit

This constructor creates a modified Q3C pixelization of the sphere with the given subdivision level. If level ∉ [0, MAX_LEVEL], a std::invalid_argument is thrown.

Member Function Documentation

◆ asString()

std::string lsst::sphgeom::Mq3cPixelization::asString ( uint64_t  i)
static

toString converts the given modified-Q3C index to a human readable string.

The first two characters in the return value are always '+X', '+Y', '+Z', '-X', '-Y', or '-Z'. They give the normal vector of the cube face F containing i. Each subsequent character is a digit in [0-3] corresponding to a child pixel index, so that reading the string from left to right corresponds to descent of the quad-tree overlaid on F.

If i is not a valid modified-Q3C index, a std::invalid_argument is thrown.

◆ index()

uint64_t lsst::sphgeom::Mq3cPixelization::index ( UnitVector3d const &  v) const
overridevirtual

index computes the index of the pixel for v.

Implements lsst::sphgeom::Pixelization.

◆ level()

int lsst::sphgeom::Mq3cPixelization::level ( uint64_t  i)
static

level returns the subdivision level of the given modified Q3C index.

If i is not a valid modified Q3C index, -1 is returned.

◆ neighborhood()

std::vector< uint64_t > lsst::sphgeom::Mq3cPixelization::neighborhood ( uint64_t  i)
static

neighborhood returns the indexes of all pixels that share a vertex with pixel i (including i itself). A Q3C pixel has 8 - k adjacent pixels, where k is the number of vertices that are also root pixel vertices (0, 1, or 4).

If i is not a valid modified Q3C index, a std::invalid_argument is thrown.

◆ pixel()

std::unique_ptr< Region > lsst::sphgeom::Mq3cPixelization::pixel ( uint64_t  i) const
overridevirtual

pixel returns the spherical region corresponding to the pixel with index i.

This region will contain all unit vectors v with index(v) == i. But it may also contain points with index not equal to i. To see why, consider a point that lies on the edge of a polygonal pixel - it is inside the polygons for both pixels sharing the edge, but must be assigned to exactly one pixel by the pixelization.

If i is not a valid pixel index, a std::invalid_argument is thrown.

Implements lsst::sphgeom::Pixelization.

◆ quad()

ConvexPolygon lsst::sphgeom::Mq3cPixelization::quad ( uint64_t  i)
static

quad returns the quadrilateral corresponding to the modified Q3C pixel with index i.

If i is not a valid modified Q3C index, a std::invalid_argument is thrown.

◆ toString()

std::string lsst::sphgeom::Mq3cPixelization::toString ( uint64_t  i) const
inlineoverridevirtual

toString converts the given pixel index to a human-readable string.

Implements lsst::sphgeom::Pixelization.

◆ universe()

RangeSet lsst::sphgeom::Mq3cPixelization::universe ( ) const
inlineoverridevirtual

universe returns the set of all pixel indexes for this pixelization.

Implements lsst::sphgeom::Pixelization.


The documentation for this class was generated from the following files: