25 #if !defined(LSST_AFW_GEOM_POLYGON_POLYGON_H)
26 #define LSST_AFW_GEOM_POLYGON_POLYGON_H
31 #include "boost/make_shared.hpp"
42 namespace lsst {
namespace afw {
namespace geom {
namespace polygon {
49 lsst::afw::geom::polygon::SinglePolygonException);
69 explicit Polygon(std::vector<Point>
const& vertices);
98 std::vector<Point>::const_iterator
begin()
const;
103 std::vector<Point>::const_iterator
end()
const;
109 std::vector<std::pair<Point, Point> >
getEdges()
const;
244 std::ostream&
operator<<(std::ostream& os, Polygon
const& poly);
double calculatePerimeter() const
boost::shared_ptr< afw::image::Image< float > > createImage(Box2I const &bbox) const
double calculateArea() const
A coordinate class intended to represent absolute positions.
boost::shared_ptr< Polygon > transform(boost::shared_ptr< XYTransform const > const &transform) const
std::vector< boost::shared_ptr< Polygon > > operator^(Polygon const &rhs) const
Operators for syntactic sugar.
size_t getNumEdges() const
void swap(ImageBase< PixelT > &a, ImageBase< PixelT > &b)
std::vector< std::pair< Point, Point > > getEdges() const
Include files required for standard LSST Exception handling.
bool operator!=(Polygon const &other) const
std::vector< Point > getVertices() const
Polygon(Box const &box)
Constructors.
std::vector< boost::shared_ptr< Polygon > > operator|(Polygon const &rhs) const
Operators for syntactic sugar.
std::vector< boost::shared_ptr< Polygon > > intersection(Polygon const &other) const
boost::shared_ptr< Polygon > unionSingle(Polygon const &other) const
Box getBBox() const
Return bounding box.
bool contains(Point const &point) const
Returns whether the polygon contains the point.
boost::shared_ptr< Polygon > convexHull() const
Produce a polygon from the convex hull.
An integer coordinate rectangle.
table::Key< table::Array< Kernel::Pixel > > image
A base class for objects that can be persisted via afw::table::io Archive classes.
std::vector< boost::shared_ptr< Polygon > > operator&(Box const &rhs) const
Operators for syntactic sugar.
boost::shared_ptr< Polygon > subSample(size_t num) const
boost::shared_ptr< Polygon > intersectionSingle(Polygon const &other) const
std::ostream & operator<<(std::ostream &os, Polygon const &poly)
Stream polygon.
boost::shared_ptr< Impl > _impl
Whether Polygon is persistable which is always true.
bool operator==(Polygon const &other) const
virtual void write(OutputArchiveHandle &handle) const
Whether Polygon is persistable which is always true.
virtual bool isPersistable() const
Whether Polygon is persistable which is always true.
std::vector< Point >::const_iterator begin() const
std::vector< Point >::const_iterator end() const
bool overlaps(Polygon const &other) const
LSST_EXCEPTION_TYPE(SinglePolygonException, lsst::pex::exceptions::RuntimeError, lsst::afw::geom::polygon::SinglePolygonException)
boost::shared_ptr< Polygon > simplify(double const distance) const
virtual std::string getPersistenceName() const
Whether Polygon is persistable which is always true.
std::vector< boost::shared_ptr< Polygon > > symDifference(Polygon const &other) const
Return the symmetric difference of two polygons.
io::OutputArchiveHandle OutputArchiveHandle
Implementation of the Class MaskedImage.
std::vector< boost::shared_ptr< Polygon > > operator|(Box const &rhs) const
Operators for syntactic sugar.
A floating-point coordinate rectangle geometry.
void swap(Polygon &other)
Swap two polygons.
A CRTP facade class for subclasses of Persistable.
std::vector< boost::shared_ptr< Polygon > > union_(Polygon const &other) const
Point calculateCenter() const
std::vector< boost::shared_ptr< Polygon > > operator^(Box const &rhs) const
Operators for syntactic sugar.