Recti 1.2.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
recti::HSegment< T > Struct Template Reference

Horizontal Line Segment. More...

#include <recti.hpp>

Inheritance diagram for recti::HSegment< T >:
Inheritance graph
[legend]
Collaboration diagram for recti::HSegment< T >:
Collaboration graph
[legend]

Public Member Functions

constexpr HSegment (Interval< T > xcoord, T ycoord) noexcept
 Construct a new HSegment object.
 
constexpr HSegment (Point< Interval< T >, T > base) noexcept
 Construct a new HSegment object from the.
 
- Public Member Functions inherited from recti::Point< Interval< T >, T >
constexpr Point ()
 Default constructor.
 
constexpr Point (Interval< T > xcoord, T ycoord) noexcept
 Construct a new Point object.
 
constexpr auto xcoord () const -> const Interval< T > &
 Gets the x coordinate of this Point.
 
constexpr auto ycoord () const -> const T &
 Gets the y coordinate of this Point.
 
constexpr auto operator== (const Point< U1, U2 > &rhs) const -> bool
 Compares this Point object with another Point object for equality.
 
constexpr auto operator< (const Point< U1, U2 > &rhs) const -> bool
 Compares this Point object with another Point object to check if it is less than.
 
constexpr auto operator!= (const Point< U1, U2 > &rhs) const -> bool
 Compares this Point object with another Point object for inequality.
 
CONSTEXPR14 auto operator+= (const Vector2< U1, U2 > &right_point) -> Self &
 Adds a vector (translation) to this Point.
 
CONSTEXPR14 auto operator-= (const Vector2< U1, U2 > &right_point) -> Self &
 Subtracts a vector (translation) from this Point.
 
constexpr auto operator- (const Self &other_point) const
 Calculates the displacement vector between this point and another point.
 
constexpr auto measure () const
 measure (area, volume etc.)
 
constexpr auto flip_xy () const -> Point< T, Interval< T > >
 flip_xy according to xcoord-ycoord diagonal line
 
constexpr auto flip_y () const -> Point< Interval< T >, T >
 flip according to ycoord-axis
 
constexpr auto overlaps (const Point< U1, U2 > &other_point) const -> bool
 
constexpr auto intersect_with (const Point< U1, U2 > &other_point) const
 
constexpr auto hull_with (const Point< U1, U2 > &other_point) const
 
constexpr auto contains (const Point< U1, U2 > &other_point) const -> bool
 
constexpr auto blocks (const Point< U1, U2 > &other_point) const -> bool
 
constexpr auto min_dist_with (const Point< U1, U2 > &other_point) const
 minimum distance between this point and another point
 
constexpr auto min_dist_change_with (Point< U1, U2 > &other_point)
 minimum distance between this point and another point
 
constexpr auto enlarge_with (const T &value) const
 Enlarge the point by value
 
constexpr auto nearest_to (const Point< U1, U2 > &other_point) const
 
constexpr auto rotates () const -> Point< Interval< T >, T >
 Rotate the point by 45 degrees (used for ManhattanArc).
 
constexpr auto inv_rotates () const -> Point< Interval< T >, T >
 Inverse rotate the point (used for ManhattanArc).
 
constexpr auto get_center () const
 Calculate the center of the point.
 
constexpr auto lower_corner () const
 Calculate the lower corner of the point.
 
constexpr auto upper_corner () const
 Calculate the upper corner of the point.
 

Additional Inherited Members

- Public Types inherited from recti::Point< Interval< T >, T >
using value_type = Interval< T >
 
- Protected Member Functions inherited from recti::Point< Interval< T >, T >
CONSTEXPR14 auto get_xcoord () -> Interval< T > &
 Returns a mutable reference to the x-coordinate of the point.
 
constexpr auto get_xcoord () const -> const Interval< T > &
 Returns a const reference to the x-coordinate of the point.
 
CONSTEXPR14 auto get_ycoord () -> T &
 Returns a mutable reference to the y-coordinate of the point.
 
constexpr auto get_ycoord () const -> const T &
 Returns a const reference to the y-coordinate of the point.
 

Detailed Description

template<typename T>
struct recti::HSegment< T >

Horizontal Line Segment.

The struct HSegment is defining a horizontal line segment in a rectilinear coordinate system. It is inheriting from the Point<Interval<T>, T> class, which means that it will have all the member variables and member functions of Point<Interval<T>, T>. The Interval<T> template parameter is used to define the type of the x-coordinate of the line segment, and the T template parameter is used to define the type of the y-coordinate of the line segment.

Template Parameters
T

Constructor & Destructor Documentation

◆ HSegment() [1/2]

template<typename T >
constexpr recti::HSegment< T >::HSegment ( Interval< T >  xcoord,
ycoord 
)
inlineconstexprnoexcept

Construct a new HSegment object.

Parameters
[in]xcoord
[in]ycoord

◆ HSegment() [2/2]

template<typename T >
constexpr recti::HSegment< T >::HSegment ( Point< Interval< T >, T >  base)
inlineconstexprnoexcept

Construct a new HSegment object from the.

Parameters
[in]base

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