lsst.sphgeom g04536d8304+afb4790f61
 
Loading...
Searching...
No Matches
lsst::sphgeom::IntersectionRegion Class Reference

#include <CompoundRegion.h>

Inheritance diagram for lsst::sphgeom::IntersectionRegion:
lsst::sphgeom::CompoundRegion lsst::sphgeom::Region

Public Member Functions

 IntersectionRegion (std::vector< std::unique_ptr< Region > > operands)
 Construct by taking ownership of operands.
 
std::unique_ptr< Regionclone () const override
 clone returns a deep copy of this region.
 
bool isEmpty () const override
 isEmpty returns true when a region does not contain any points.
 
Box getBoundingBox () const override
 getBoundingBox returns a bounding-box for this region.
 
Box3d getBoundingBox3d () const override
 getBoundingBox3d returns a 3-dimensional bounding-box for this region.
 
Circle getBoundingCircle () const override
 getBoundingCircle returns a bounding-circle for this region.
 
bool contains (UnitVector3d const &v) const override
 contains tests whether the given unit vector is inside this region.
 
Relationship relate (Region const &r) const override
 
TriState overlaps (Region const &other) const override
 
TriState overlaps (Box const &) const override
 
TriState overlaps (Circle const &) const override
 
TriState overlaps (ConvexPolygon const &) const override
 
TriState overlaps (Ellipse const &) const override
 
std::vector< std::uint8_t > encode () const override
 
bool contains (double x, double y, double z) const
 
bool contains (double lon, double lat) const
 
- Public Member Functions inherited from lsst::sphgeom::CompoundRegion
 CompoundRegion (std::vector< std::unique_ptr< Region > > operands) noexcept
 Construct by taking ownership of operands.
 
 CompoundRegion (CompoundRegion const &)
 
 CompoundRegion (CompoundRegion &&) noexcept=default
 
CompoundRegionoperator= (CompoundRegion const &)=delete
 
CompoundRegionoperator= (CompoundRegion &&)=delete
 
size_t nOperands () const
 
Region const & getOperand (std::size_t n) const
 
Relationship relate (Box const &b) const override
 
Relationship relate (Circle const &c) const override
 
Relationship relate (ConvexPolygon const &p) const override
 
Relationship relate (Ellipse const &e) const override
 
- Public Member Functions inherited from lsst::sphgeom::Region
bool contains (double x, double y, double z) const
 
bool contains (double lon, double lat) const
 

Static Public Member Functions

static std::unique_ptr< IntersectionRegiondecode (std::vector< std::uint8_t > const &s)
 
static std::unique_ptr< IntersectionRegiondecode (std::uint8_t const *buffer, size_t n)
 
- Static Public Member Functions inherited from lsst::sphgeom::CompoundRegion
static std::unique_ptr< CompoundRegiondecode (std::vector< std::uint8_t > const &s)
 
static std::unique_ptr< CompoundRegiondecode (std::uint8_t const *buffer, size_t n)
 
- Static Public Member Functions inherited from lsst::sphgeom::Region
static std::vector< std::unique_ptr< Region > > getRegions (Region const &region)
 getRegions returns a vector of Region.
 
static std::unique_ptr< Regiondecode (std::vector< std::uint8_t > const &s)
 
static std::unique_ptr< Regiondecode (std::uint8_t const *buffer, size_t n)
 
static std::unique_ptr< RegiondecodeBase64 (std::string const &s)
 
static std::unique_ptr< RegiondecodeBase64 (std::string_view const &s)
 
static TriState decodeOverlapsBase64 (std::string const &s)
 
static TriState decodeOverlapsBase64 (std::string_view const &s)
 

Static Public Attributes

static constexpr std::uint8_t TYPE_CODE = 'i'
 

Additional Inherited Members

- Protected Member Functions inherited from lsst::sphgeom::CompoundRegion
std::vector< std::uint8_t > _encode (std::uint8_t tc) const
 
std::vector< std::unique_ptr< Region > > const & operands () const
 
template<typename Compound>
void flatten_operands ()
 
- Static Protected Member Functions inherited from lsst::sphgeom::CompoundRegion
static std::vector< std::unique_ptr< Region > > _decode (std::uint8_t tc, std::uint8_t const *buffer, std::size_t nBytes)
 
- Static Protected Member Functions inherited from lsst::sphgeom::Region
static TriState _relationship_to_overlaps (Relationship r)
 

Detailed Description

IntersectionRegion is a lazy point-set inersection of its operands.

All operations on a IntersectionRegion are implementing by delegating to its nested operand regions and combining the results.

Member Function Documentation

◆ clone()

std::unique_ptr< Region > lsst::sphgeom::IntersectionRegion::clone ( ) const
inlineoverridevirtual

clone returns a deep copy of this region.

Implements lsst::sphgeom::Region.

◆ contains() [1/3]

bool lsst::sphgeom::Region::contains ( double lon,
double lat ) const

contains tests whether the unit vector defined by the given longitude and latitude coordinates (in radians) is inside this region.

◆ contains() [2/3]

bool lsst::sphgeom::Region::contains ( double x,
double y,
double z ) const

contains tests whether the unit vector defined by the given (not necessarily normalized) coordinates is inside this region.

◆ contains() [3/3]

bool lsst::sphgeom::IntersectionRegion::contains ( UnitVector3d const & ) const
overridevirtual

contains tests whether the given unit vector is inside this region.

Implements lsst::sphgeom::Region.

◆ decode()

static std::unique_ptr< IntersectionRegion > lsst::sphgeom::IntersectionRegion::decode ( std::vector< std::uint8_t > const & s)
inlinestatic

decode deserializes a IntersetionRegion from a byte string produced by encode.

◆ encode()

std::vector< std::uint8_t > lsst::sphgeom::IntersectionRegion::encode ( ) const
inlineoverridevirtual

encode serializes this region into an opaque byte string. Byte strings emitted by encode can be deserialized with decode.

Implements lsst::sphgeom::Region.

◆ getBoundingBox()

Box lsst::sphgeom::IntersectionRegion::getBoundingBox ( ) const
overridevirtual

getBoundingBox returns a bounding-box for this region.

Implements lsst::sphgeom::Region.

◆ getBoundingBox3d()

Box3d lsst::sphgeom::IntersectionRegion::getBoundingBox3d ( ) const
overridevirtual

getBoundingBox3d returns a 3-dimensional bounding-box for this region.

Implements lsst::sphgeom::Region.

◆ getBoundingCircle()

Circle lsst::sphgeom::IntersectionRegion::getBoundingCircle ( ) const
overridevirtual

getBoundingCircle returns a bounding-circle for this region.

Implements lsst::sphgeom::Region.

◆ isEmpty()

bool lsst::sphgeom::IntersectionRegion::isEmpty ( ) const
overridevirtual

isEmpty returns true when a region does not contain any points.

Implements lsst::sphgeom::Region.

◆ overlaps() [1/5]

TriState lsst::sphgeom::IntersectionRegion::overlaps ( Box const & b) const
overridevirtual

Implements lsst::sphgeom::Region.

◆ overlaps() [2/5]

TriState lsst::sphgeom::IntersectionRegion::overlaps ( Circle const & c) const
overridevirtual

Implements lsst::sphgeom::Region.

◆ overlaps() [3/5]

TriState lsst::sphgeom::IntersectionRegion::overlaps ( ConvexPolygon const & p) const
overridevirtual

Implements lsst::sphgeom::Region.

◆ overlaps() [4/5]

TriState lsst::sphgeom::IntersectionRegion::overlaps ( Ellipse const & e) const
overridevirtual

Implements lsst::sphgeom::Region.

◆ overlaps() [5/5]

TriState lsst::sphgeom::IntersectionRegion::overlaps ( Region const & other) const
overridevirtual

overlaps tests whether two regions overlap. This method returns a TriState object, when the value is true it means that regions definitely overlap, false means they are definitely disjont, and unknown state means that they may or may not overlap.

Implements lsst::sphgeom::Region.

◆ relate()

Relationship lsst::sphgeom::IntersectionRegion::relate ( Region const & ) const
overridevirtual

relate computes the spatial relationships between this region A and another region B. The return value S is a bitset with the following properties:

  • Bit S & DISJOINT is set only if A and B do not have any points in common.
  • Bit S & CONTAINS is set only if A contains all points in B.
  • Bit S & WITHIN is set only if B contains all points in A.

Said another way: if the CONTAINS, WITHIN or DISJOINT bit is set, then the corresponding spatial relationship between the two regions holds conclusively. If it is not set, the relationship may or may not hold.

These semantics allow for conservative relationship computations. In particular, a Region may choose to implement relate by replacing itself and/or the argument with a simplified bounding region.

Implements lsst::sphgeom::CompoundRegion.


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