25 #if !defined(LSST_AFW_GEOM_POLYGON_POLYGON_H)
26 #define LSST_AFW_GEOM_POLYGON_POLYGON_H
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);
Point calculateCenter() const
Polygon(Box const &box)
Constructors.
A coordinate class intended to represent absolute positions.
std::vector< boost::shared_ptr< Polygon > > operator|(Polygon const &rhs) const
Operators for syntactic sugar.
virtual void write(OutputArchiveHandle &handle) const
Whether Polygon is persistable which is always true.
size_t getNumEdges() const
Return number of edges.
Include files required for standard LSST Exception handling.
bool operator!=(Polygon const &other) const
std::vector< boost::shared_ptr< Polygon > > union_(Polygon const &other) const
Returns the union of two polygons.
io::OutputArchiveHandle OutputArchiveHandle
std::vector< boost::shared_ptr< Polygon > > operator|(Box const &rhs) const
Operators for syntactic sugar.
std::vector< std::pair< Point, Point > > getEdges() const
Get vector of edges.
boost::shared_ptr< Polygon > simplify(double const distance) const
Return a simplified polygon.
boost::shared_ptr< Impl > _impl
Whether Polygon is persistable which is always true.
void swap(Mask< PixelT > &a, Mask< PixelT > &b)
virtual bool isPersistable() const
Whether Polygon is persistable which is always true.
An integer coordinate rectangle.
double calculateArea() const
std::vector< boost::shared_ptr< Polygon > > operator&(Box const &rhs) const
Operators for syntactic sugar.
boost::shared_ptr< Polygon > convexHull() const
Produce a polygon from the convex hull.
table::Key< table::Array< Kernel::Pixel > > image
A base class for objects that can be persisted via afw::table::io Archive classes.
std::vector< Point >::const_iterator end() const
Iterator for vertices.
boost::shared_ptr< Polygon > unionSingle(Polygon const &other) const
Returns the union of two polygons.
std::ostream & operator<<(std::ostream &os, Polygon const &poly)
Stream polygon.
boost::shared_ptr< Polygon > intersectionSingle(Polygon const &other) const
Returns the intersection of two polygons.
std::vector< Point >::const_iterator begin() const
Iterator for vertices.
bool overlaps(Polygon const &other) const
Returns whether the polygons overlap each other.
Box getBBox() const
Return bounding box.
std::vector< boost::shared_ptr< Polygon > > intersection(Polygon const &other) const
Returns the intersection of two polygons.
LSST_EXCEPTION_TYPE(SinglePolygonException, lsst::pex::exceptions::RuntimeError, lsst::afw::geom::polygon::SinglePolygonException)
An exception that indicates the single-polygon assumption has been violated.
boost::shared_ptr< afw::image::Image< float > > createImage(Box2I const &bbox) const
Create image of polygon.
boost::shared_ptr< Polygon > transform(boost::shared_ptr< XYTransform const > const &transform) const
Transform the polygon.
std::vector< boost::shared_ptr< Polygon > > operator^(Polygon const &rhs) const
Operators for syntactic sugar.
Implementation of the Class MaskedImage.
bool contains(Point const &point) const
Returns whether the polygon contains the point.
double calculatePerimeter() const
A floating-point coordinate rectangle geometry.
#define CONST_PTR(...)
A shared pointer to a const object.
A CRTP facade class for subclasses of Persistable.
void swap(Polygon &other)
Swap two polygons.
virtual std::string getPersistenceName() const
Whether Polygon is persistable which is always true.
bool operator==(Polygon const &other) const
boost::shared_ptr< Polygon > subSample(size_t num) const
Sub-sample each edge.
std::vector< boost::shared_ptr< Polygon > > symDifference(Polygon const &other) const
Return the symmetric difference of two polygons.
std::vector< Point > getVertices() const
Get vector of vertices.
std::vector< boost::shared_ptr< Polygon > > operator^(Box const &rhs) const
Operators for syntactic sugar.