#include <CompoundRegion.h>
Public Member Functions | |
| CompoundRegion (std::vector< std::unique_ptr< Region > > operands) noexcept | |
| Construct by taking ownership of operands. | |
| CompoundRegion (CompoundRegion const &) | |
| CompoundRegion (CompoundRegion &&) noexcept=default | |
| CompoundRegion & | operator= (CompoundRegion const &)=delete |
| CompoundRegion & | operator= (CompoundRegion &&)=delete |
| size_t | nOperands () const |
| 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< Region > | clone () const =0 |
clone returns a deep copy of this region. | |
| virtual Box | getBoundingBox () const =0 |
getBoundingBox returns a bounding-box for this region. | |
| virtual Box3d | getBoundingBox3d () const =0 |
getBoundingBox3d returns a 3-dimensional bounding-box for this region. | |
| virtual Circle | getBoundingCircle () const =0 |
getBoundingCircle returns a bounding-circle for this region. | |
| virtual bool | isEmpty () const =0 |
isEmpty returns true when a region does not contain any points. | |
| virtual bool | contains (UnitVector3d const &) const =0 |
contains tests whether the given unit vector is inside this region. | |
| bool | contains (double x, double y, double z) const |
| bool | contains (double lon, double lat) const |
| virtual std::vector< std::uint8_t > | encode () const =0 |
| virtual TriState | overlaps (Region const &other) const =0 |
| virtual TriState | overlaps (Box const &) const =0 |
| virtual TriState | overlaps (Circle const &) const =0 |
| virtual TriState | overlaps (ConvexPolygon const &) const =0 |
| virtual TriState | overlaps (Ellipse const &) const =0 |
Static Public Member Functions | |
| static std::unique_ptr< CompoundRegion > | decode (std::vector< std::uint8_t > const &s) |
| static std::unique_ptr< CompoundRegion > | decode (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 ®ion) |
getRegions returns a vector of Region. | |
| static std::unique_ptr< Region > | decode (std::vector< std::uint8_t > const &s) |
| static std::unique_ptr< Region > | decode (std::uint8_t const *buffer, size_t n) |
| static std::unique_ptr< Region > | decodeBase64 (std::string const &s) |
| static std::unique_ptr< Region > | decodeBase64 (std::string_view const &s) |
| static TriState | decodeOverlapsBase64 (std::string const &s) |
| static TriState | decodeOverlapsBase64 (std::string_view const &s) |
Protected Member Functions | |
| 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 | |
| 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) |
CompoundRegion is an intermediate base class for spherical regions that are comprised of a point-set operation on other nested regions.
|
inlinestatic |
decode deserializes a CompoundRegion from a byte string produced by encode.
|
overridevirtual |
Implements lsst::sphgeom::Region.
|
overridevirtual |
Implements lsst::sphgeom::Region.
|
overridevirtual |
Implements lsst::sphgeom::Region.
|
overridevirtual |
Implements lsst::sphgeom::Region.
|
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:
S & DISJOINT is set only if A and B do not have any points in common.S & CONTAINS is set only if A contains all points in B.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::IntersectionRegion, and lsst::sphgeom::UnionRegion.