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

Implementation of a segment. More...

#include <Segment.hpp>

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

Public Types

using numeric_type = T
 

Public Member Functions

constexpr Segment (Vec2D< T > p, Vec2D< T > q)
 
template<fishnet::math::Number U, typename = std::enable_if_t<!std::is_same_v<U,T> && std::is_same_v<T,fishnet::math::DEFAULT_NUMERIC>>>
constexpr Segment (Vec2D< T > p, Vec2D< U > q)
 
template<fishnet::math::Number U, typename = std::enable_if_t<!std::is_same_v<U,T> && std::is_same_v<T,fishnet::math::DEFAULT_NUMERIC>>>
constexpr Segment (Vec2D< U > p, Vec2D< T > q)
 
constexpr const Vec2D< T > & p () const noexcept
 
constexpr const Vec2D< T > & q () const noexcept
 
constexpr Segment< T > flip () const noexcept
 
constexpr Vec2D< T > direction () const noexcept
 
constexpr const Vec2D< T > & upperEndpoint () const noexcept
 
constexpr const Vec2D< T > & lowerEndpoint () const noexcept
 
constexpr const Vec2D< T > & leftEndpoint () const noexcept
 
constexpr const Vec2D< T > & rightEndpoint () const noexcept
 
constexpr bool isEndpoint (IPoint auto const &point) const noexcept
 
constexpr fishnet::math::DEFAULT_FLOATING_POINT length () const noexcept
 
constexpr bool isValid () const noexcept
 
constexpr Line< T > toLine () const noexcept
 
constexpr bool isParallel (LinearGeometry auto const &other) const noexcept
 
constexpr bool intersects (LinearGeometry auto const &other) const noexcept
 
constexpr bool overlaps (ISegment auto const &other) const noexcept
 Two Segments have an Overlay if the are contained on the same line: -> the Segments must be parallel and at least share on point.
 
constexpr bool contains (ISegment auto const &other) const noexcept
 
constexpr bool touches (ISegment auto const &other) const noexcept
 Two Segments touch each other when one endpoint is equal and neither Segment is fully contained in the other one.
 
template<fishnet::math::Number U>
constexpr bool operator== (const Segment< U > &other) const noexcept
 
constexpr bool contains (IPoint auto const &point) const noexcept
 
constexpr fishnet::math::DEFAULT_FLOATING_POINT distance (IPoint auto const &point) const noexcept
 
constexpr fishnet::math::DEFAULT_FLOATING_POINT distance (ISegment auto const &other) const noexcept
 
constexpr fishnet::Option< Vec2DReal > intersection (LinearGeometry auto const &other) const noexcept
 
constexpr size_t hash () const noexcept
 
constexpr std::string toString () const noexcept
 

Static Public Attributes

static constexpr GeometryType type = GeometryType::SEGMENT
 

Detailed Description

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
class fishnet::geometry::Segment< T >

Implementation of a segment.

Template Parameters
Tnumeric type used for computations

Member Typedef Documentation

◆ numeric_type

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

Constructor & Destructor Documentation

◆ Segment() [1/3]

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr fishnet::geometry::Segment< T >::Segment ( Vec2D< T >  p,
Vec2D< T >  q 
)
inlineconstexpr

◆ Segment() [2/3]

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
template<fishnet::math::Number U, typename = std::enable_if_t<!std::is_same_v<U,T> && std::is_same_v<T,fishnet::math::DEFAULT_NUMERIC>>>
constexpr fishnet::geometry::Segment< T >::Segment ( Vec2D< T >  p,
Vec2D< U >  q 
)
inlineconstexpr

◆ Segment() [3/3]

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
template<fishnet::math::Number U, typename = std::enable_if_t<!std::is_same_v<U,T> && std::is_same_v<T,fishnet::math::DEFAULT_NUMERIC>>>
constexpr fishnet::geometry::Segment< T >::Segment ( Vec2D< U >  p,
Vec2D< T >  q 
)
inlineconstexpr

Member Function Documentation

◆ contains() [1/2]

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

◆ contains() [2/2]

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr bool fishnet::geometry::Segment< T >::contains ( ISegment< T > auto const &  other) const
inlineconstexprnoexcept

◆ direction()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr Vec2D< T > fishnet::geometry::Segment< T >::direction ( ) const
inlineconstexprnoexcept

◆ distance() [1/2]

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr fishnet::math::DEFAULT_FLOATING_POINT fishnet::geometry::Segment< T >::distance ( IPoint auto const &  point) const
inlineconstexprnoexcept

◆ distance() [2/2]

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr fishnet::math::DEFAULT_FLOATING_POINT fishnet::geometry::Segment< T >::distance ( ISegment< T > auto const &  other) const
inlineconstexprnoexcept

◆ flip()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr Segment< T > fishnet::geometry::Segment< T >::flip ( ) const
inlineconstexprnoexcept

◆ hash()

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

◆ intersection()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr fishnet::Option< Vec2DReal > fishnet::geometry::Segment< T >::intersection ( LinearGeometry auto const &  other) const
inlineconstexprnoexcept

◆ intersects()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr bool fishnet::geometry::Segment< T >::intersects ( LinearGeometry auto const &  other) const
inlineconstexprnoexcept

◆ isEndpoint()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr bool fishnet::geometry::Segment< T >::isEndpoint ( IPoint auto const &  point) const
inlineconstexprnoexcept

◆ isParallel()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr bool fishnet::geometry::Segment< T >::isParallel ( LinearGeometry auto const &  other) const
inlineconstexprnoexcept

◆ isValid()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr bool fishnet::geometry::Segment< T >::isValid ( ) const
inlineconstexprnoexcept

◆ leftEndpoint()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr const Vec2D< T > & fishnet::geometry::Segment< T >::leftEndpoint ( ) const
inlineconstexprnoexcept

◆ length()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr fishnet::math::DEFAULT_FLOATING_POINT fishnet::geometry::Segment< T >::length ( ) const
inlineconstexprnoexcept

◆ lowerEndpoint()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr const Vec2D< T > & fishnet::geometry::Segment< T >::lowerEndpoint ( ) const
inlineconstexprnoexcept

◆ operator==()

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

◆ overlaps()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr bool fishnet::geometry::Segment< T >::overlaps ( ISegment< T > auto const &  other) const
inlineconstexprnoexcept

Two Segments have an Overlay if the are contained on the same line: -> the Segments must be parallel and at least share on point.

Template Parameters
U
Parameters
other
Returns
true
false

◆ p()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr const Vec2D< T > & fishnet::geometry::Segment< T >::p ( ) const
inlineconstexprnoexcept

◆ q()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr const Vec2D< T > & fishnet::geometry::Segment< T >::q ( ) const
inlineconstexprnoexcept

◆ rightEndpoint()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr const Vec2D< T > & fishnet::geometry::Segment< T >::rightEndpoint ( ) const
inlineconstexprnoexcept

◆ toLine()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr Line< T > fishnet::geometry::Segment< T >::toLine ( ) const
inlineconstexprnoexcept

◆ toString()

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

◆ touches()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr bool fishnet::geometry::Segment< T >::touches ( ISegment< T > auto const &  other) const
inlineconstexprnoexcept

Two Segments touch each other when one endpoint is equal and neither Segment is fully contained in the other one.

Template Parameters
U
Parameters
other
Returns
true
false

◆ upperEndpoint()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr const Vec2D< T > & fishnet::geometry::Segment< T >::upperEndpoint ( ) const
inlineconstexprnoexcept

Member Data Documentation

◆ type

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr GeometryType fishnet::geometry::Segment< T >::type = GeometryType::SEGMENT
staticconstexpr

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