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

Implementation of a line. More...

#include <Line.hpp>

Public Types

using numeric_type = T
 

Public Member Functions

constexpr Line (Vec2D< T > _p, Vec2D< T > _q)
 Constructor for a line formed by two points.
 
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 Line (Vec2D< T > _p, Vec2D< U > _q)
 Constructor for a line with heterogenous numeric types Construct new line by converting to the default numeric type.
 
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 Line (Vec2D< U > _p, Vec2D< T > _q)
 Constructor for a line with heterogenous numeric types Construct new line by converting to the default numeric type.
 
constexpr Line (T slope, T yIntercept)
 Constructor of line using slope and y intercept.
 
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 Line (T slope, U yIntercept)
 Constructor of line using slope and y intercept with heterogenous type.
 
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 Line (U slope, T yIntercept)
 Constructor of line using slope and y intercept with heterogenous type.
 
constexpr Vec2D< T > p () const noexcept
 
constexpr Vec2D< T > q () const noexcept
 
constexpr Line< T > toLine () const noexcept
 
constexpr Vec2D< T > direction () const noexcept
 
constexpr bool isVertical () const noexcept
 
constexpr bool isHorizontal () const noexcept
 
constexpr fishnet::Option< fishnet::math::DEFAULT_FLOATING_POINT > yIntercept () const noexcept
 
constexpr fishnet::math::DEFAULT_FLOATING_POINT slope () const noexcept
 
constexpr bool contains (IPoint auto const &point) const noexcept
 
constexpr bool isLeft (IPoint auto const &point) const noexcept
 
constexpr bool isRight (IPoint auto const &point) const noexcept
 
constexpr bool isParallel (LinearGeometry auto const &other) const noexcept
 
constexpr bool intersects (LinearGeometry auto const &other) const noexcept
 
template<fishnet::math::Number U>
constexpr bool operator== (const Line< U > &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
 

Static Public Member Functions

static constexpr Line< T > verticalLine (T x) noexcept
 Vertical line factory.
 
static constexpr Line< T > horizontalLine (T y) noexcept
 Horizontal line factory.
 

Static Public Attributes

static constexpr GeometryType type = GeometryType::LINE
 

Detailed Description

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

Implementation of a line.

Template Parameters
Tnumeric type used for computations

Member Typedef Documentation

◆ numeric_type

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

Constructor & Destructor Documentation

◆ Line() [1/6]

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr fishnet::geometry::Line< T >::Line ( Vec2D< T >  _p,
Vec2D< T >  _q 
)
inlineconstexpr

Constructor for a line formed by two points.

◆ Line() [2/6]

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::Line< T >::Line ( Vec2D< T >  _p,
Vec2D< U >  _q 
)
inlineconstexpr

Constructor for a line with heterogenous numeric types Construct new line by converting to the default numeric type.

Template Parameters
Unumeric type != T
typenameenable_if -> only allow this constructor if T is the numeric type:
std::is_same_v<T,fishnet::math::DEFAULT_NUMERIC>>

◆ Line() [3/6]

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::Line< T >::Line ( Vec2D< U >  _p,
Vec2D< T >  _q 
)
inlineconstexpr

Constructor for a line with heterogenous numeric types Construct new line by converting to the default numeric type.

Template Parameters
Unumeric type != T
typenameenable_if -> only allow this constructor if T is the numeric type:
std::is_same_v<T,fishnet::math::DEFAULT_NUMERIC>>

◆ Line() [4/6]

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr fishnet::geometry::Line< T >::Line ( T  slope,
T  yIntercept 
)
inlineconstexpr

Constructor of line using slope and y intercept.

◆ Line() [5/6]

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::Line< T >::Line ( T  slope,
U  yIntercept 
)
inlineconstexpr

Constructor of line using slope and y intercept with heterogenous type.

Template Parameters
Unumeric type != T
typenameenable_if -> only allow this constructor if T is the numeric type:
std::is_same_v<T,fishnet::math::DEFAULT_NUMERIC>>

◆ Line() [6/6]

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::Line< T >::Line ( U  slope,
T  yIntercept 
)
inlineconstexpr

Constructor of line using slope and y intercept with heterogenous type.

Template Parameters
Unumeric type != T
typenameenable_if -> only allow this constructor if T is the numeric type:
std::is_same_v<T,fishnet::math::DEFAULT_NUMERIC>>

Member Function Documentation

◆ contains()

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

◆ direction()

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

◆ hash()

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

◆ horizontalLine()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
static constexpr Line< T > fishnet::geometry::Line< T >::horizontalLine ( T  y)
inlinestaticconstexprnoexcept

Horizontal line factory.

Parameters
yy-axis intersection of the horizontal line
Returns
constexpr Line<T>

◆ intersection()

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

◆ intersects()

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

◆ isHorizontal()

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

◆ isLeft()

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

◆ isParallel()

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

◆ isRight()

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

◆ isVertical()

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

◆ operator==()

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

◆ p()

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

◆ q()

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

◆ slope()

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

◆ toLine()

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

◆ toString()

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

◆ verticalLine()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
static constexpr Line< T > fishnet::geometry::Line< T >::verticalLine ( T  x)
inlinestaticconstexprnoexcept

Vertical line factory.

Parameters
xx-axis intersection of the vertical line
Returns
constexpr Line<T>

◆ yIntercept()

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr fishnet::Option< fishnet::math::DEFAULT_FLOATING_POINT > fishnet::geometry::Line< T >::yIntercept ( ) const
inlineconstexprnoexcept

Member Data Documentation

◆ type

template<fishnet::math::Number T = fishnet::math::DEFAULT_NUMERIC>
constexpr GeometryType fishnet::geometry::Line< T >::type = GeometryType::LINE
staticconstexpr

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