lsst.sphgeom gb956055f9b+164b02c8d4
Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
lsst::sphgeom::CompoundRegion Class Referenceabstract

#include <CompoundRegion.h>

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

Public Member Functions

 CompoundRegion (Region const &first, Region const &second)
 Construct by copying or taking ownership of operands.
 
 CompoundRegion (std::array< std::unique_ptr< Region >, 2 > operands) noexcept
 
 CompoundRegion (CompoundRegion const &)
 
 CompoundRegion (CompoundRegion &&) noexcept=default
 
CompoundRegionoperator= (CompoundRegion const &)=delete
 
CompoundRegionoperator= (CompoundRegion &&)=delete
 
Region const & getOperand (std::size_t n) const
 
virtual Relationship relate (Region const &r) const =0
 
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
virtual std::unique_ptr< Regionclone () const =0
 clone returns a deep copy of this region. More...
 
virtual Box getBoundingBox () const =0
 getBoundingBox returns a bounding-box for this region. More...
 
virtual Box3d getBoundingBox3d () const =0
 getBoundingBox3d returns a 3-dimensional bounding-box for this region. More...
 
virtual Circle getBoundingCircle () const =0
 getBoundingCircle returns a bounding-circle for this region. More...
 
virtual bool contains (UnitVector3d const &) const =0
 contains tests whether the given unit vector is inside this region. More...
 
bool contains (double x, double y, double z) const
 
bool contains (double lon, double lat) const
 
virtual std::vector< uint8_t > encode () const =0
 

Static Public Member Functions

static std::unique_ptr< CompoundRegiondecode (std::vector< uint8_t > const &s)
 
static std::unique_ptr< CompoundRegiondecode (uint8_t const *buffer, size_t n)
 
- Static Public Member Functions inherited from lsst::sphgeom::Region
static std::unique_ptr< Regiondecode (std::vector< uint8_t > const &s)
 
static std::unique_ptr< Regiondecode (uint8_t const *buffer, size_t n)
 

Protected Member Functions

std::vector< std::uint8_t > _encode (std::uint8_t tc) const
 

Static Protected Member Functions

static std::array< std::unique_ptr< Region >, 2 > _decode (std::uint8_t tc, std::uint8_t const *buffer, std::size_t nBytes)
 

Detailed Description

CompoundRegion is an intermediate base class for spherical regions that are comprised of a point-set operation on other nested regions.

Member Function Documentation

◆ decode()

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

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

◆ relate() [1/5]

Relationship lsst::sphgeom::CompoundRegion::relate ( Box const &  b) const
overridevirtual

Implements lsst::sphgeom::Region.

◆ relate() [2/5]

Relationship lsst::sphgeom::CompoundRegion::relate ( Circle const &  c) const
overridevirtual

Implements lsst::sphgeom::Region.

◆ relate() [3/5]

Relationship lsst::sphgeom::CompoundRegion::relate ( ConvexPolygon const &  p) const
overridevirtual

Implements lsst::sphgeom::Region.

◆ relate() [4/5]

Relationship lsst::sphgeom::CompoundRegion::relate ( Ellipse const &  e) const
overridevirtual

Implements lsst::sphgeom::Region.

◆ relate() [5/5]

virtual Relationship lsst::sphgeom::CompoundRegion::relate ( Region const &  ) const
pure virtual

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::Region.

Implemented in lsst::sphgeom::UnionRegion, and lsst::sphgeom::IntersectionRegion.


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