30#ifndef LSST_SPHGEOM_PIXELFINDER_H_
31#define LSST_SPHGEOM_PIXELFINDER_H_
78 RegionType
const & region,
85 _maxRanges{maxRanges == 0 ? maxRanges - 1 : maxRanges}
99 Relationship r = detail::relate(pixel, pixel + NumVertices, *_region);
100 if ((r & DISJOINT) != 0) {
104 if ((r & WITHIN) != 0) {
107 _insert(index, level);
109 }
else if (level == _level) {
112 _insert(index, level);
116 static_cast<Derived *
>(
this)->subdivide(pixel, index, level);
121 RegionType
const * _region;
123 int const _desiredLevel;
124 size_t const _maxRanges;
126 void _insert(uint64_t index,
int level) {
127 int shift = 2 * (_desiredLevel - level);
128 _ranges->
insert(index << shift, (index + 1) << shift);
129 while (_ranges->
size() > _maxRanges) {
154 template <
typename,
bool>
class Finder,
157RangeSet findPixels(
Region const & r,
size_t maxRanges,
int level) {
159 Circle const * c =
nullptr;
161 Box const * b =
nullptr;
162 if ((c =
dynamic_cast<Circle const *
>(&r))) {
163 Finder<Circle, InteriorOnly> find(s, *c, level, maxRanges);
165 }
else if ((e =
dynamic_cast<Ellipse const *
>(&r))) {
166 Finder<Circle, InteriorOnly> find(
169 }
else if ((b =
dynamic_cast<Box
const *
>(&r))) {
170 Finder<Box, InteriorOnly> find(s, *b, level, maxRanges);
173 Finder<ConvexPolygon, InteriorOnly> find(
174 s,
dynamic_cast<ConvexPolygon
const &
>(r), level, maxRanges);
This file contains the meat of the ConvexPolygon implementation.
This file provides a type for representing integer sets.
Circle getBoundingCircle() const override
getBoundingCircle returns a bounding-circle for this region.
Definition Ellipse.cc:248
Definition RangeSet.h:106
void insert(uint64_t u)
Definition RangeSet.h:292
RangeSet & complement()
Definition RangeSet.h:335
size_t size() const
size returns the number of ranges in this set.
Definition RangeSet.h:546
RangeSet & simplify(uint32_t n)
Definition RangeSet.cc:315
Definition UnitVector3d.h:62
Definition PixelFinder.h:75
std::bitset< 3 > Relationship
Relationship describes how two sets are related.
Definition Relationship.h:42