lsst.sphgeom
gdcc65144bf+d801c9999e
Toggle main menu visibility
Loading...
Searching...
No Matches
HtmPixelization.h
Go to the documentation of this file.
1
/*
2
* This file is part of sphgeom.
3
*
4
* Developed for the LSST Data Management System.
5
* This product includes software developed by the LSST Project
6
* (http://www.lsst.org).
7
* See the COPYRIGHT file at the top-level directory of this distribution
8
* for details of code ownership.
9
*
10
* This software is dual licensed under the GNU General Public License and also
11
* under a 3-clause BSD license. Recipients may choose which of these licenses
12
* to use; please see the files gpl-3.0.txt and/or bsd_license.txt,
13
* respectively. If you choose the GPL option then the following text applies
14
* (but note that there is still no warranty even if you opt for BSD instead):
15
*
16
* This program is free software: you can redistribute it and/or modify
17
* it under the terms of the GNU General Public License as published by
18
* the Free Software Foundation, either version 3 of the License, or
19
* (at your option) any later version.
20
*
21
* This program is distributed in the hope that it will be useful,
22
* but WITHOUT ANY WARRANTY; without even the implied warranty of
23
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
* GNU General Public License for more details.
25
*
26
* You should have received a copy of the GNU General Public License
27
* along with this program. If not, see <http://www.gnu.org/licenses/>.
28
*/
29
30
#ifndef LSST_SPHGEOM_HTMPIXELIZATION_H_
31
#define LSST_SPHGEOM_HTMPIXELIZATION_H_
32
36
37
#include <cstdint>
38
#include <stdexcept>
39
40
#include "
ConvexPolygon.h
"
41
#include "
Pixelization.h
"
42
43
44
namespace
lsst {
45
namespace
sphgeom
{
46
57
class
HtmPixelization
:
public
Pixelization
{
58
public
:
60
static
constexpr
int
MAX_LEVEL
= 24;
61
65
static
int
level
(std::uint64_t i);
66
70
static
ConvexPolygon
triangle
(std::uint64_t i);
71
83
static
std::string
asString
(std::uint64_t i);
84
88
explicit
HtmPixelization
(
int
level
);
89
91
int
getLevel
()
const
{
return
_level; }
92
93
RangeSet
universe
()
const override
{
94
return
RangeSet
(
static_cast<
std::uint64_t
>
(8) << 2 * _level,
95
static_cast<
std::uint64_t
>
(16) << 2 * _level);
96
}
97
98
std::unique_ptr<Region>
pixel
(std::uint64_t i)
const override
{
99
return
std::unique_ptr<Region>(
new
ConvexPolygon
(
triangle
(i)));
100
}
101
102
std::uint64_t
index
(
UnitVector3d
const
&)
const override
;
103
104
std::string
toString
(std::uint64_t i)
const override
{
return
asString
(i); }
105
106
private
:
107
int
_level;
108
109
RangeSet
_envelope(
Region
const
&,
size_t
)
const override
;
110
RangeSet
_interior(
Region
const
&,
size_t
)
const override
;
111
};
112
113
}}
// namespace lsst::sphgeom
114
115
#endif
// LSST_SPHGEOM_HTMPIXELIZATION_H_
ConvexPolygon.h
This file declares a class for representing convex polygons with great circle edges on the unit spher...
Pixelization.h
This file defines an interface for pixelizations of the sphere.
lsst::sphgeom::ConvexPolygon
Definition
ConvexPolygon.h:65
lsst::sphgeom::HtmPixelization::getLevel
int getLevel() const
getLevel returns the subdivision level of this pixelization.
Definition
HtmPixelization.h:91
lsst::sphgeom::HtmPixelization::MAX_LEVEL
static constexpr int MAX_LEVEL
MAX_LEVEL is the maximum supported HTM subdivision level.
Definition
HtmPixelization.h:60
lsst::sphgeom::HtmPixelization::pixel
std::unique_ptr< Region > pixel(std::uint64_t i) const override
Definition
HtmPixelization.h:98
lsst::sphgeom::HtmPixelization::toString
std::string toString(std::uint64_t i) const override
toString converts the given pixel index to a human-readable string.
Definition
HtmPixelization.h:104
lsst::sphgeom::HtmPixelization::triangle
static ConvexPolygon triangle(std::uint64_t i)
Definition
HtmPixelization.cc:130
lsst::sphgeom::HtmPixelization::universe
RangeSet universe() const override
universe returns the set of all pixel indexes for this pixelization.
Definition
HtmPixelization.h:93
lsst::sphgeom::HtmPixelization::asString
static std::string asString(std::uint64_t i)
Definition
HtmPixelization.cc:155
lsst::sphgeom::HtmPixelization::level
static int level(std::uint64_t i)
Definition
HtmPixelization.cc:117
lsst::sphgeom::HtmPixelization::index
std::uint64_t index(UnitVector3d const &) const override
index computes the index of the pixel for v.
Definition
HtmPixelization.cc:177
lsst::sphgeom::HtmPixelization::HtmPixelization
HtmPixelization(int level)
Definition
HtmPixelization.cc:171
lsst::sphgeom::Pixelization
Definition
Pixelization.h:84
lsst::sphgeom::RangeSet
Definition
RangeSet.h:106
lsst::sphgeom::Region
Definition
Region.h:105
lsst::sphgeom::UnitVector3d
Definition
UnitVector3d.h:62
lsst::sphgeom
Definition
Angle.h:45
include
lsst
sphgeom
HtmPixelization.h
Generated by
1.17.0