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);
void swap(Polygon &other)
Swap two polygons.
std::vector< boost::shared_ptr< Polygon > > operator|(Box const &rhs) const
Operators for syntactic sugar.
std::vector< boost::shared_ptr< Polygon > > operator^(Polygon const &rhs) const
Operators for syntactic sugar.
bool operator==(Polygon const &other) const
A coordinate class intended to represent absolute positions.
std::vector< boost::shared_ptr< Polygon > > operator&(Box const &rhs) const
Operators for syntactic sugar.
void swap(ImageBase< PixelT > &a, ImageBase< PixelT > &b)
std::vector< Point >::const_iterator begin() const
virtual bool isPersistable() const
Whether Polygon is persistable which is always true.
std::vector< std::pair< Point, Point > > getEdges() const
std::vector< boost::shared_ptr< Polygon > > symDifference(Polygon const &other) const
Return the symmetric difference of two polygons.
std::vector< boost::shared_ptr< Polygon > > union_(Polygon const &other) const
io::OutputArchiveHandle OutputArchiveHandle
std::vector< Point >::const_iterator end() const
boost::shared_ptr< Polygon > convexHull() const
Produce a polygon from the convex hull.
double calculateArea() const
Box getBBox() const
Return bounding box.
boost::shared_ptr< afw::image::Image< float > > createImage(Box2I const &bbox) const
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.
virtual void write(OutputArchiveHandle &handle) const
Whether Polygon is persistable which is always true.
std::ostream & operator<<(std::ostream &os, Polygon const &poly)
Stream polygon.
std::vector< boost::shared_ptr< Polygon > > operator^(Box const &rhs) const
Operators for syntactic sugar.
boost::shared_ptr< Polygon > transform(boost::shared_ptr< XYTransform const > const &transform) const
Polygon(Box const &box)
Constructors.
bool operator!=(Polygon const &other) const
double calculatePerimeter() const
boost::shared_ptr< Impl > _impl
Whether Polygon is persistable which is always true.
boost::shared_ptr< Polygon > simplify(double const distance) const
boost::shared_ptr< Polygon > unionSingle(Polygon const &other) const
size_t getNumEdges() const
std::vector< boost::shared_ptr< Polygon > > operator|(Polygon const &rhs) const
Operators for syntactic sugar.
bool contains(Point const &point) const
Returns whether the polygon contains the point.
Point calculateCenter() const
LSST_EXCEPTION_TYPE(SinglePolygonException, lsst::pex::exceptions::RuntimeError, lsst::afw::geom::polygon::SinglePolygonException)
bool overlaps(Polygon const &other) const
boost::shared_ptr< Polygon > intersectionSingle(Polygon const &other) const
Implementation of the Class MaskedImage.
A floating-point coordinate rectangle geometry.
std::vector< boost::shared_ptr< Polygon > > intersection(Polygon const &other) const
std::vector< Point > getVertices() const
A CRTP facade class for subclasses of Persistable.
boost::shared_ptr< Polygon > subSample(size_t num) const
virtual std::string getPersistenceName() const
Whether Polygon is persistable which is always true.
Include files required for standard LSST Exception handling.