Fishnet 2.0.1
Framework for Graph-Based Analysis of GIS Vector Data
Loading...
Searching...
No Matches
fishnet::geometry::Rectangle< T > Class Template Reference

Implementation of a rectangle Stores top,right,bottom and left point of the rectangle. More...

#include <Rectangle.hpp>

Inheritance diagram for fishnet::geometry::Rectangle< T >:
Collaboration diagram for fishnet::geometry::Rectangle< T >:

Public Member Functions

 Rectangle (Shape auto const &ring)
 
 Rectangle (T left, T top, T right, T bottom)
 
 Rectangle (Vec2D< T > const &corner, Vec2D< T > const &oppositeCorner)
 Construct the rectangle spanned by two opposite corners.
 
T left () const noexcept
 
T right () const noexcept
 
T top () const noexcept
 
T bottom () const noexcept
 
const Rectangle< T > & aaBB () const noexcept
 
Rectangle< T > scale (T factor) const noexcept
 
template<fishnet::math::Number U>
bool overlap (const Rectangle< U > &other) const noexcept
 
- Public Member Functions inherited from fishnet::geometry::Ring< T >
 Ring (util::random_access_range_of< Vec2D< T > > auto const &points, bool checked=false)
 
 Ring (util::random_access_range_of< Segment< T > > auto &&segments, bool checked=false)
 
 Ring (std::initializer_list< Vec2D< T > > &&points)
 
template<fishnet::math::Number U>
constexpr operator Ring< U > () const noexcept
 
constexpr const Ring< T > & getBoundary () const noexcept
 
constexpr auto getHoles () const noexcept
 
constexpr util::view_of< Segment< T > > auto getSegments () const noexcept
 
constexpr util::view_of< Vec2D< T > > auto getPoints () const noexcept
 
constexpr fishnet::math::DEFAULT_FLOATING_POINT area () const noexcept
 Calculate the area of the ring Uses Shoelace formula: https://en.wikipedia.org/wiki/Shoelace_formula.
 
constexpr Vec2DReal centroid () const noexcept
 Calculate centroid point of the ring https://en.wikipedia.org/wiki/Centroid.
 
constexpr Rectangle< T > aaBB () const noexcept
 Computes the axis-aligned bounding box of the ring Calculated be computing the extreme points in every direction and forming a rectangle.
 
constexpr bool contains (IPoint auto const &point) const noexcept
 
constexpr bool isInside (IPoint auto const &point) const noexcept
 
constexpr bool isOnBoundary (IPoint auto const &point) const noexcept
 
constexpr bool isOutside (IPoint auto const &point) const noexcept
 
template<LinearGeometry L>
constexpr bool intersects (const L &linearFeature) const noexcept
 test whether a linear feature intersects the ring
 
constexpr std::unordered_set< Vec2DReal > intersections (LinearGeometry auto const &linearFeature) const noexcept
 
constexpr bool contains (ISegment auto const &segment) const noexcept
 Test whether a segment is fully contained inside the boundary of the ring Collect all intersections of the segment with the boundary segments, test if all middle points in-between the intersection points on the segment are contained in the ring.
 
template<fishnet::math::Number U>
constexpr bool operator== (const Ring< U > &other) const noexcept
 
constexpr bool crosses (IRing auto const &other) const noexcept
 
constexpr bool contains (IRing auto const &other) const noexcept
 
constexpr bool touches (IRing auto const &other) const noexcept
 
constexpr fishnet::math::DEFAULT_FLOATING_POINT distance (IRing auto const &other) const noexcept
 Distance between the two rings.
 
constexpr size_t hash () const noexcept
 
constexpr std::string toString () const noexcept
 

Additional Inherited Members

- Public Types inherited from fishnet::geometry::Ring< T >
using numeric_type = T
 
- Static Public Attributes inherited from fishnet::geometry::Ring< T >
static constexpr GeometryType type = GeometryType::RING
 
- Protected Member Functions inherited from fishnet::geometry::Ring< T >
constexpr PointLocation getPointLocation (IPoint auto const &point) const noexcept
 Get the location of a point with regard to the ring (INSIDE | OUTSIDE | BOUNDARY) Uses the Ray-Casting algorithm: https://en.wikipedia.org/wiki/Point_in_polygon.
 

Detailed Description

template<fishnet::math::Number T>
class fishnet::geometry::Rectangle< T >

Implementation of a rectangle Stores top,right,bottom and left point of the rectangle.

Template Parameters
Tnumeric type used for computations

Constructor & Destructor Documentation

◆ Rectangle() [1/3]

template<fishnet::math::Number T>
fishnet::geometry::Rectangle< T >::Rectangle ( Shape auto const &  ring)
inline

◆ Rectangle() [2/3]

template<fishnet::math::Number T>
fishnet::geometry::Rectangle< T >::Rectangle ( T  left,
T  top,
T  right,
T  bottom 
)
inline

◆ Rectangle() [3/3]

template<fishnet::math::Number T>
fishnet::geometry::Rectangle< T >::Rectangle ( Vec2D< T > const &  corner,
Vec2D< T > const &  oppositeCorner 
)
inline

Construct the rectangle spanned by two opposite corners.

Note
the corners may be given in any order, they are sorted into left/top/right/bottom

Member Function Documentation

◆ aaBB()

template<fishnet::math::Number T>
const Rectangle< T > & fishnet::geometry::Rectangle< T >::aaBB ( ) const
inlinenoexcept

◆ bottom()

template<fishnet::math::Number T>
T fishnet::geometry::Rectangle< T >::bottom ( ) const
inlinenoexcept

◆ left()

template<fishnet::math::Number T>
T fishnet::geometry::Rectangle< T >::left ( ) const
inlinenoexcept

◆ overlap()

template<fishnet::math::Number T>
template<fishnet::math::Number U>
bool fishnet::geometry::Rectangle< T >::overlap ( const Rectangle< U > &  other) const
inlinenoexcept

◆ right()

template<fishnet::math::Number T>
T fishnet::geometry::Rectangle< T >::right ( ) const
inlinenoexcept

◆ scale()

template<fishnet::math::Number T>
Rectangle< T > fishnet::geometry::Rectangle< T >::scale ( T  factor) const
inlinenoexcept

◆ top()

template<fishnet::math::Number T>
T fishnet::geometry::Rectangle< T >::top ( ) const
inlinenoexcept

The documentation for this class was generated from the following file: