Recti 1.2.4
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
recti::ManhattanArc< T1, T2 > Class Template Reference

Merging Object (for deferred-merge embedding (DME) algorithm) More...

#include <manhattan_arc.hpp>

Collaboration diagram for recti::ManhattanArc< T1, T2 >:
Collaboration graph
[legend]

Public Member Functions

constexpr ManhattanArc ()
 Default constructor.
 
constexpr ManhattanArc (T1 xcoord, T2 ycoord)
 Construct a new ManhattanArc object.
 

Static Public Member Functions

static constexpr auto from_point (const Point< T1, T2 > &pt)
 Construct a ManhattanArc from a Point.
 
static constexpr auto construct (const T1 &xcoord, const T2 &ycoord) -> ManhattanArc
 Construct a new ManhattanArc object from the given x and y coordinates.
 

Public Attributes

Point< T1, T2 > impl
 

Comparison operators

definie ==, !=, <, >, <=, >=.

template<typename U1 , typename U2 >
constexpr auto operator== (const ManhattanArc< U1, U2 > &rhs) const -> bool
 Compares two ManhattanArc objects for equality.
 
template<typename U1 , typename U2 >
constexpr auto operator!= (const ManhattanArc< U1, U2 > &rhs) const -> bool
 Not equal to.
 
template<typename U1 , typename U2 >
constexpr auto overlaps (const ManhattanArc< U1, U2 > &other) const -> bool
 Check if two ManhattanArc objects overlap.
 
template<typename U1 , typename U2 >
constexpr auto intersect_with (const ManhattanArc< U1, U2 > &other) const
 Compute the intersection of two ManhattanArc objects.
 
template<typename U1 , typename U2 >
constexpr auto min_dist_with (const ManhattanArc< U1, U2 > &other) const
 Compute the minimum distance between the x and y coordinates of two ManhattanArc objects.
 
template<typename R >
constexpr auto enlarge_with (const R &alpha) const
 Enlarge the ManhattanArc object by a given scale factor.
 
constexpr auto get_center () const
 Calculate the center of the ManhattanArc.
 
constexpr auto get_lower_corner () const
 Calculate the lower corner of the ManhattanArc.
 
constexpr auto get_upper_corner () const
 Calculate the upper corner of the ManhattanArc.
 
template<typename U1 , typename U2 >
constexpr auto nearest_point_to (const Point< U1, U2 > &other) const
 Find the nearest point to a given Point.
 
template<typename U1 , typename U2 >
constexpr auto merge_with (const ManhattanArc< U1, U2 > &other, int alpha) const
 Merge with another ManhattanArc using a given alpha.
 
template<class Stream >
auto operator<< (Stream &out, const ManhattanArc &manhattan_arc) -> Stream &
 Overload the stream insertion operator << to output a ManhattanArc object.
 

Detailed Description

template<typename T1, typename T2 = T1>
class recti::ManhattanArc< T1, T2 >

Merging Object (for deferred-merge embedding (DME) algorithm)

The code is defining a class template called ManhattanArc that represents a merging segment. The merging segment can include a single point, segment, or region. The template has two type parameters T1 and T2, which default to int if not specified. The class inherits from the Point class, which represents a point in a 2D coordinate system. The ManhattanArc class provides various operations and functions for manipulating and comparing merging segments, such as adding and subtracting vectors, checking for overlap and intersection with other merging segments, calculating the minimum distance between merging segments, and merging two merging segments. The class also provides comparison operators and a stream insertion operator for convenient usage. The purpose of the ManhattanArc class is to support the deferred-merge embedding (DME) algorithm, as referenced in the code comments.

Reference:

Template Parameters
T1int or Interval
T2int or Interval

Constructor & Destructor Documentation

◆ ManhattanArc() [1/2]

template<typename T1 , typename T2 = T1>
constexpr recti::ManhattanArc< T1, T2 >::ManhattanArc ( )
inlineconstexpr

Default constructor.

◆ ManhattanArc() [2/2]

template<typename T1 , typename T2 = T1>
constexpr recti::ManhattanArc< T1, T2 >::ManhattanArc ( T1  xcoord,
T2  ycoord 
)
inlineconstexpr

Construct a new ManhattanArc object.

This code defines a constructor for the ManhattanArc class template. The constructor takes two parameters xcoord and ycoord, which are of type T1 and T2 respectively. The constructor is marked as constexpr and noexcept, indicating that it can be evaluated at compile-time and it does not throw any exceptions.

Parameters
[in]xcoordThe x coordinate value.
[in]ycoordThe y coordinate value.

Member Function Documentation

◆ construct()

template<typename T1 , typename T2 = T1>
static constexpr auto recti::ManhattanArc< T1, T2 >::construct ( const T1 &  xcoord,
const T2 &  ycoord 
) -> ManhattanArc
inlinestaticconstexpr

Construct a new ManhattanArc object from the given x and y coordinates.

This static member function constructs a new ManhattanArc object by combining the given xcoord and ycoord parameters in a specific way. The resulting ManhattanArc object represents a merging segment that can include a single point, segment, or region.

Parameters
[in]xcoordThe x coordinate value.
[in]ycoordThe y coordinate value.
Returns
A new ManhattanArc object constructed from the given coordinates.

◆ enlarge_with()

template<typename T1 , typename T2 = T1>
template<typename R >
constexpr auto recti::ManhattanArc< T1, T2 >::enlarge_with ( const R &  alpha) const
inlineconstexpr

Enlarge the ManhattanArc object by a given scale factor.

This function creates a new ManhattanArc object by enlarging the x and y coordinates of the current ManhattanArc object by the given scale factor alpha. The resulting ManhattanArc object will have larger x and y coordinate ranges.

Template Parameters
RThe type of the scale factor alpha.
Parameters
[in]alphaThe scale factor to enlarge the ManhattanArc object by.
Returns
A new ManhattanArc object with enlarged x and y coordinates.

◆ from_point()

template<typename T1 , typename T2 = T1>
static constexpr auto recti::ManhattanArc< T1, T2 >::from_point ( const Point< T1, T2 > &  pt)
inlinestaticconstexpr

Construct a ManhattanArc from a Point.

Parameters
[in]ptThe input point.
Returns
A new ManhattanArc.

◆ get_center()

template<typename T1 , typename T2 = T1>
constexpr auto recti::ManhattanArc< T1, T2 >::get_center ( ) const
inlineconstexpr

Calculate the center of the ManhattanArc.

Returns
The center as a Point.

◆ get_lower_corner()

template<typename T1 , typename T2 = T1>
constexpr auto recti::ManhattanArc< T1, T2 >::get_lower_corner ( ) const
inlineconstexpr

Calculate the lower corner of the ManhattanArc.

Returns
The lower corner as a Point.

◆ get_upper_corner()

template<typename T1 , typename T2 = T1>
constexpr auto recti::ManhattanArc< T1, T2 >::get_upper_corner ( ) const
inlineconstexpr

Calculate the upper corner of the ManhattanArc.

Returns
The upper corner as a Point.

◆ intersect_with()

template<typename T1 , typename T2 = T1>
template<typename U1 , typename U2 >
constexpr auto recti::ManhattanArc< T1, T2 >::intersect_with ( const ManhattanArc< U1, U2 > &  other) const
inlineconstexpr

Compute the intersection of two ManhattanArc objects.

This function computes the intersection of the current ManhattanArc object with the provided ManhattanArc object other. The intersection is calculated by finding the intersection of the x and y coordinate ranges of the two ManhattanArc objects. The resulting ManhattanArc object represents the overlapping region between the two input ManhattanArc objects.

Template Parameters
U1The type of the x and y coordinates of the current ManhattanArc object.
U2The type of the x and y coordinates of the ManhattanArc object other.
Parameters
[in]otherThe ManhattanArc object to intersect with the current ManhattanArc object.
Returns
A new ManhattanArc object representing the intersection of the two input ManhattanArc objects.

◆ merge_with()

template<typename T1 , typename T2 = T1>
template<typename U1 , typename U2 >
constexpr auto recti::ManhattanArc< T1, T2 >::merge_with ( const ManhattanArc< U1, U2 > &  other,
int  alpha 
) const
inlineconstexpr

Merge with another ManhattanArc using a given alpha.

Parameters
[in]otherThe other ManhattanArc.
[in]alphaThe enlargement factor.
Returns
The merged ManhattanArc.

◆ min_dist_with()

template<typename T1 , typename T2 = T1>
template<typename U1 , typename U2 >
constexpr auto recti::ManhattanArc< T1, T2 >::min_dist_with ( const ManhattanArc< U1, U2 > &  other) const
inlineconstexpr

Compute the minimum distance between the x and y coordinates of two ManhattanArc objects.

This function calculates the maximum distance between the x and y coordinates of the current ManhattanArc object and the provided ManhattanArc object other. The distance is computed by taking the maximum of the distances between the x coordinates and the distances between the y coordinates of the two ManhattanArc objects.

Template Parameters
U1The type of the x and y coordinates of the current ManhattanArc object.
U2The type of the x and y coordinates of the ManhattanArc object other.
Parameters
[in]otherThe ManhattanArc object to compute the maximum distance with.
Returns
The maximum distance between the two ManhattanArc objects.

◆ nearest_point_to()

template<typename T1 , typename T2 = T1>
template<typename U1 , typename U2 >
constexpr auto recti::ManhattanArc< T1, T2 >::nearest_point_to ( const Point< U1, U2 > &  other) const
inlineconstexpr

Find the nearest point to a given Point.

Parameters
[in]otherThe reference Point.
Returns
The nearest Point on this ManhattanArc.

◆ operator!=()

template<typename T1 , typename T2 = T1>
template<typename U1 , typename U2 >
constexpr auto recti::ManhattanArc< T1, T2 >::operator!= ( const ManhattanArc< U1, U2 > &  rhs) const -> bool
inlineconstexpr

Not equal to.

Compares two ManhattanArc objects for inequality.

This operator overload compares two ManhattanArc objects for inequality. It returns true if the underlying Point<T1, T2> objects are not equal, and false otherwise.

Template Parameters
U1The type of the x-coordinate of the right-hand side ManhattanArc.
U2The type of the y-coordinate of the right-hand side ManhattanArc.
Parameters
[in]rhsThe ManhattanArc object to compare against.
Returns
true if the two ManhattanArc objects are not equal, false otherwise.

◆ operator==()

template<typename T1 , typename T2 = T1>
template<typename U1 , typename U2 >
constexpr auto recti::ManhattanArc< T1, T2 >::operator== ( const ManhattanArc< U1, U2 > &  rhs) const -> bool
inlineconstexpr

Compares two ManhattanArc objects for equality.

This operator overload compares two ManhattanArc objects for equality. It returns true if the underlying Point<T1, T2> objects are equal, and false otherwise.

Template Parameters
U1The type of the x-coordinate of the right-hand side ManhattanArc.
U2The type of the y-coordinate of the right-hand side ManhattanArc.
Parameters
[in]rhsThe ManhattanArc object to compare against.
Returns
true if the two ManhattanArc objects are equal, false otherwise.

◆ overlaps()

template<typename T1 , typename T2 = T1>
template<typename U1 , typename U2 >
constexpr auto recti::ManhattanArc< T1, T2 >::overlaps ( const ManhattanArc< U1, U2 > &  other) const -> bool
inlineconstexpr

Check if two ManhattanArc objects overlap.

This function checks if the x and y coordinates of the current ManhattanArc object overlap with the x and y coordinates of the provided ManhattanArc object other. The overlap is determined by checking if the ranges of the x and y coordinates intersect.

Template Parameters
U1The type of the x and y coordinates of the current ManhattanArc object.
U2The type of the x and y coordinates of the ManhattanArc object other.
Parameters
otherThe ManhattanArc object to check for overlap.
Returns
true if the two ManhattanArc objects overlap, false otherwise.

Friends And Related Symbol Documentation

◆ operator<<

template<typename T1 , typename T2 = T1>
template<class Stream >
auto operator<< ( Stream &  out,
const ManhattanArc< T1, T2 > &  manhattan_arc 
) -> Stream&
friend

Overload the stream insertion operator << to output a ManhattanArc object.

This function overloads the stream insertion operator << to output a ManhattanArc object in the format "/{xcoord}, {ycoord}/", where {xcoord} and {ycoord} are the x and y coordinates of the ManhattanArc object, respectively.

Template Parameters
StreamThe type of the output stream.
Parameters
[out]outThe output stream to write the ManhattanArc object to.
[in]manhattan_arcThe ManhattanArc object to be written to the output stream.
Returns
The modified output stream.

Member Data Documentation

◆ impl

template<typename T1 , typename T2 = T1>
Point<T1, T2> recti::ManhattanArc< T1, T2 >::impl

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