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

Implementation of a ring. More...

#include <Ring.hpp>

Inheritance diagram for fishnet::geometry::Ring< T >:

Public Types

using numeric_type = T
 

Public Member Functions

 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
 

Static Public Attributes

static constexpr GeometryType type = GeometryType::RING
 

Protected Member Functions

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::Ring< T >

Implementation of a ring.

Template Parameters
Tnumeric type used for computations

Member Typedef Documentation

◆ numeric_type

template<fishnet::math::Number T>
using fishnet::geometry::Ring< T >::numeric_type = T

Constructor & Destructor Documentation

◆ Ring() [1/3]

template<fishnet::math::Number T>
fishnet::geometry::Ring< T >::Ring ( util::random_access_range_of< Vec2D< T > > auto const &  points,
bool  checked = false 
)
inline

◆ Ring() [2/3]

template<fishnet::math::Number T>
fishnet::geometry::Ring< T >::Ring ( util::random_access_range_of< Segment< T > > auto &&  segments,
bool  checked = false 
)
inline

◆ Ring() [3/3]

template<fishnet::math::Number T>
fishnet::geometry::Ring< T >::Ring ( std::initializer_list< Vec2D< T > > &&  points)
inline

Member Function Documentation

◆ aaBB()

template<fishnet::math::Number T>
constexpr Rectangle< T > fishnet::geometry::Ring< T >::aaBB ( ) const
inlineconstexprnoexcept

Computes the axis-aligned bounding box of the ring Calculated be computing the extreme points in every direction and forming a rectangle.

Returns
Rectangle representing the aaBB

◆ area()

template<fishnet::math::Number T>
constexpr fishnet::math::DEFAULT_FLOATING_POINT fishnet::geometry::Ring< T >::area ( ) const
inlineconstexprnoexcept

Calculate the area of the ring Uses Shoelace formula: https://en.wikipedia.org/wiki/Shoelace_formula.

Returns
area of the ring in the same units as the segments/points

◆ centroid()

template<fishnet::math::Number T>
constexpr Vec2DReal fishnet::geometry::Ring< T >::centroid ( ) const
inlineconstexprnoexcept

Calculate centroid point of the ring https://en.wikipedia.org/wiki/Centroid.

Returns
constexpr Vec2DReal

◆ contains() [1/3]

template<fishnet::math::Number T>
constexpr bool fishnet::geometry::Ring< T >::contains ( IPoint auto const &  point) const
inlineconstexprnoexcept

◆ contains() [2/3]

template<fishnet::math::Number T>
constexpr bool fishnet::geometry::Ring< T >::contains ( IRing< T > auto const &  other) const
inlineconstexprnoexcept

◆ contains() [3/3]

template<fishnet::math::Number T>
constexpr bool fishnet::geometry::Ring< T >::contains ( ISegment auto const &  segment) const
inlineconstexprnoexcept

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.

Parameters
segment
Returns
true
false

◆ crosses()

template<fishnet::math::Number T>
constexpr bool fishnet::geometry::Ring< T >::crosses ( IRing< T > auto const &  other) const
inlineconstexprnoexcept

◆ distance()

template<fishnet::math::Number T>
constexpr fishnet::math::DEFAULT_FLOATING_POINT fishnet::geometry::Ring< T >::distance ( IRing< T > auto const &  other) const
inlineconstexprnoexcept

Distance between the two rings.

Returns
0 if the rings overlap in any way, i.e. if one contains the other or they cross, otherwise the distance between their boundaries

◆ getBoundary()

template<fishnet::math::Number T>
constexpr const Ring< T > & fishnet::geometry::Ring< T >::getBoundary ( ) const
inlineconstexprnoexcept

◆ getHoles()

template<fishnet::math::Number T>
constexpr auto fishnet::geometry::Ring< T >::getHoles ( ) const
inlineconstexprnoexcept

◆ getPointLocation()

template<fishnet::math::Number T>
constexpr PointLocation fishnet::geometry::Ring< T >::getPointLocation ( IPoint auto const &  point) const
inlineconstexprprotectednoexcept

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.

Parameters
point
Returns
constexpr PointLocation

◆ getPoints()

template<fishnet::math::Number T>
constexpr util::view_of< Vec2D< T > > auto fishnet::geometry::Ring< T >::getPoints ( ) const
inlineconstexprnoexcept

◆ getSegments()

template<fishnet::math::Number T>
constexpr util::view_of< Segment< T > > auto fishnet::geometry::Ring< T >::getSegments ( ) const
inlineconstexprnoexcept

◆ hash()

template<fishnet::math::Number T>
constexpr size_t fishnet::geometry::Ring< T >::hash ( ) const
inlineconstexprnoexcept

◆ intersections()

template<fishnet::math::Number T>
constexpr std::unordered_set< Vec2DReal > fishnet::geometry::Ring< T >::intersections ( LinearGeometry auto const &  linearFeature) const
inlineconstexprnoexcept

◆ intersects()

template<fishnet::math::Number T>
template<LinearGeometry L>
constexpr bool fishnet::geometry::Ring< T >::intersects ( const L &  linearFeature) const
inlineconstexprnoexcept

test whether a linear feature intersects the ring

See also
ringIntersects, which is shared by all IRing implementations
Template Parameters
Llinear feature type
Parameters
linearFeature
Returns
true
false

◆ isInside()

template<fishnet::math::Number T>
constexpr bool fishnet::geometry::Ring< T >::isInside ( IPoint auto const &  point) const
inlineconstexprnoexcept

◆ isOnBoundary()

template<fishnet::math::Number T>
constexpr bool fishnet::geometry::Ring< T >::isOnBoundary ( IPoint auto const &  point) const
inlineconstexprnoexcept

◆ isOutside()

template<fishnet::math::Number T>
constexpr bool fishnet::geometry::Ring< T >::isOutside ( IPoint auto const &  point) const
inlineconstexprnoexcept

◆ operator Ring< U >()

template<fishnet::math::Number T>
template<fishnet::math::Number U>
constexpr fishnet::geometry::Ring< T >::operator Ring< U > ( ) const
inlineconstexprnoexcept

◆ operator==()

template<fishnet::math::Number T>
template<fishnet::math::Number U>
constexpr bool fishnet::geometry::Ring< T >::operator== ( const Ring< U > &  other) const
inlineconstexprnoexcept

◆ toString()

template<fishnet::math::Number T>
constexpr std::string fishnet::geometry::Ring< T >::toString ( ) const
inlineconstexprnoexcept

◆ touches()

template<fishnet::math::Number T>
constexpr bool fishnet::geometry::Ring< T >::touches ( IRing< T > auto const &  other) const
inlineconstexprnoexcept

Member Data Documentation

◆ type

template<fishnet::math::Number T>
constexpr GeometryType fishnet::geometry::Ring< T >::type = GeometryType::RING
staticconstexpr

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