File Polygon.h¶
-
template<>
structhash
<lsst::afw::geom::polygon::Polygon>¶ Public Types
-
template<>
usingresult_type
= size_t¶
Public Functions
-
size_t
operator()
(argument_type const &obj) const
-
template<>
-
namespace
lsst
Class for a simple mapping implementing a generic AstrometryTransform.
Remove all non-astronomical counts from the Chunk Exposure’s pixels.
Forward declarations for lsst::utils::Cache
For details on the Cache class, see the Cache.h file.
It uses a template rather than a pointer so that the derived classes can use the specifics of the transform. The class simplePolyMapping overloads a few routines.
A base class for image defects
Numeric constants used by the Integrate.h integrator routines.
Compute Image Statistics
- Note
Gauss-Kronrod-Patterson quadrature coefficients for use in quadpack routine qng. These coefficients were calculated with 101 decimal digit arithmetic by L. W. Fullerton, Bell Labs, Nov 1981.
- Note
The Statistics class itself can only handle lsst::afw::image::MaskedImage() types. The philosophy has been to handle other types by making them look like lsst::afw::image::MaskedImage() and reusing that code. Users should have no need to instantiate a Statistics object directly, but should use the overloaded makeStatistics() factory functions.
-
namespace
afw
-
namespace
geom
-
namespace
polygon
¶ Functions
-
LSST_EXCEPTION_TYPE
(SinglePolygonException, lsst::pex::exceptions::RuntimeError, lsst::afw::geom::polygon::SinglePolygonException)¶ An exception that indicates the single-polygon assumption has been violated
The single-polygon assumption is used in Polygon::intersectionSingle and Polygon::unionSingle.
-
class
Polygon
: public lsst::afw::table::io::PersistableFacade<Polygon>, public Storable - #include <Polygon.h>
Cartesian polygons
Polygons are defined by a set of vertices
Unnamed Group
Unnamed Group
-
bool
overlaps
(Polygon const &other) const Returns whether the polygons overlap each other
Note that there may be no intersection if the polygons only share a boundary.
-
bool
overlaps
(Box const &box) const
Unnamed Group
-
std::shared_ptr<Polygon>
intersectionSingle
(Polygon const &other) const Returns the intersection of two polygons
Does not handle non-convex polygons (which might have multiple independent intersections), and is provided as a convenience for when the polygons are known to be convex (e.g., image borders) and overlapping.
Unnamed Group
Unnamed Group
Unnamed Group
Unnamed Group
Unnamed Group
Unnamed Group
-
std::shared_ptr<Polygon>
transform
(TransformPoint2ToPoint2 const &transform) const - Parameters
transform
: Transform from original to target frame
Transform the polygon
The transformation is only applied to the vertices. If the transformation is non-linear, the edges will not reflect that, but simply join the vertices. Greater fidelity might be achieved by using “subSample” before transforming.
Unnamed Group
Unnamed Group
-
std::shared_ptr<afw::image::Image<float>>
createImage
(lsst::geom::Box2I const &bbox) const Create image of polygon
Pixels entirely contained within the polygon receive value unity, pixels entirely outside the polygon receive value zero, and pixels on the border receive a value equal to the fraction of the pixel within the polygon.
Note that the center of the lower-left pixel is 0,0.
Public Functions
-
Polygon
(Polygon const&)
-
Polygon
(Polygon&&)
-
~Polygon
()
-
Polygon
(Box const &box, TransformPoint2ToPoint2 const &transform) Construct a 4-sided Polygon from a transformed box
The resulting polygon has 4 vertices: transform.applyForward(bbox.getCorners())
- Parameters
[in] box
: Initial box[in] transform
: Coordinate transform
-
Polygon
(Box const &box, lsst::geom::AffineTransform const &transform) Construct a 4-sided Polygon from a transformed box
The resulting polygon has 4 vertices: the corners of the box transformed by
transform
- Parameters
[in] box
: Initial box[in] transform
: Coordinate transform
-
void
swap
(Polygon &other) Swap two polygons.
-
size_t
getNumEdges
() const Return number of edges
Identical with the number of points
-
Box
getBBox
() const Return bounding box.
-
Point
calculateCenter
() const
-
double
calculateArea
() const
-
double
calculatePerimeter
() const
-
std::vector<Point>
getVertices
() const Get vector of vertices
Note that the “closed” polygon vertices are returned, so the first and last vertex are identical and there is one more vertex than otherwise expected.
-
std::vector<std::pair<Point, Point>>
getEdges
() const Get vector of edges
Returns edges, as pairs of vertices.
-
bool
operator==
(Polygon const &other) const
-
bool
operator!=
(Polygon const &other) const
-
std::size_t
hash_value
() const Return a hash of this object.
-
bool
contains
(Point const &point) const Returns whether the polygon contains the point.
-
std::shared_ptr<Polygon>
simplify
(double const distance) const Return a simplified polygon
Removes unnecessary points (using the Douglas-Peucker algorithm).
-
bool
isPersistable
() const Whether Polygon is persistable which is always true.
-
std::shared_ptr<typehandling::Storable>
cloneStorable
() const Create a new Polygon that is a copy of this one.
-
std::string
toString
() const Create a string representation of this object.
-
bool
equals
(typehandling::Storable const &other) const Compare this object to another Storable.
- Return
*this == other
ifother
is a Polygon; otherwisefalse
.
Protected Functions
-
std::string
getPersistenceName
() const
-
void
write
(OutputArchiveHandle &handle) const
-
bool
-
-
namespace
-
namespace