52 #ifndef __PCL_Rectangle_h
53 #define __PCL_Rectangle_h
64 #ifdef __PCL_QT_INTERFACE
65 # include <QtCore/QRect>
66 # ifndef __PCL_QT_NO_RECT_DRAWING_HELPERS
67 # include <QtGui/QPainter>
68 # include <QtGui/QBrush>
125 template <
typename T>
inline
126 bool IsPoint( T x0, T y0, T x1, T y1 ) noexcept
128 return x0 == x1 && y0 == y1;
143 template <
typename T>
inline
144 bool IsLine( T x0, T y0, T x1, T y1 ) noexcept
146 return ((x0 == x1) ^ (y0 == y1)) != 0;
160 template <
typename T>
inline
163 return y0 == y1 && x0 != x1;
177 template <
typename T>
inline
180 return x0 == x1 && y0 != y1;
194 template <
typename T>
inline
197 return x0 == x1 || y0 == y1;
211 template <
typename T>
inline
212 bool IsRect( T x0, T y0, T x1, T y1 ) noexcept
214 return x0 != x1 && y0 != y1;
227 template <
typename T>
inline
230 return x0 < x1 && y0 < y1;
244 template <
typename T>
inline
247 return x0 <= x1 && y0 <= y1;
261 template <
typename T>
inline
280 #define PCL_ASSERT_RECT_SIZE() \
281 static_assert( sizeof( *this ) == 4*sizeof( T ), "Invalid sizeof( GenericRectangle<> )" )
314 template <
typename T>
345 PCL_ASSERT_RECT_SIZE();
358 template <
typename T1>
365 PCL_ASSERT_RECT_SIZE();
393 template <
typename T1>
396 PCL_ASSERT_RECT_SIZE();
426 template <
typename T1>
431 PCL_ASSERT_RECT_SIZE();
445 PCL_ASSERT_RECT_SIZE();
458 PCL_ASSERT_RECT_SIZE();
465 template <
typename T1>
470 PCL_ASSERT_RECT_SIZE();
473 #ifdef __PCL_QT_INTERFACE
476 component( r.right()+1 ), component( r.bottom()+1 ) )
478 PCL_ASSERT_RECT_SIZE();
481 GenericRectangle(
const QPoint& p0,
const QPoint& p1 )
482 : GenericRectangle( component( p0.x() ), component( p0.y() ),
483 component( p1.x() ), component( p1.y() ) )
485 PCL_ASSERT_RECT_SIZE();
590 return RightBottom();
598 return point( (x0 + x1)/2, (y0 + y1)/2 );
669 return Width() + Height();
678 return pcl::Abs( (x1 - x0)*(y1 - y0) );
687 return 0.5*(x0 + x1);
696 return 0.5*(y0 + y1);
707 double w = x1 - x0, h = y1 - y0;
813 template <
typename T1>
820 if ( x < x0 ) clip |= Clip::Left;
821 if ( x > x1 ) clip |= Clip::Right;
825 if ( x < x1 ) clip |= Clip::Left;
826 if ( x > x0 ) clip |= Clip::Right;
831 if ( y < y0 ) clip |= Clip::Top;
832 if ( y > y1 ) clip |= Clip::Bottom;
836 if ( y < y1 ) clip |= Clip::Top;
837 if ( y > y0 ) clip |= Clip::Bottom;
852 template <
typename T1>
855 return ClipCode( p.x, p.y );
872 template <
typename T1>
876 if ( x < x0 ) clip |= Clip::Left;
877 if ( x > x1 ) clip |= Clip::Right;
878 if ( y < y0 ) clip |= Clip::Top;
879 if ( y > y1 ) clip |= Clip::Bottom;
896 template <
typename T1>
899 return ClipCodeFast( p.x, p.y );
918 template <
typename T1>
919 bool ClipLine( T1& lx0, T1& ly0, T1& lx1, T1& ly1 )
const noexcept
929 if ( !(clip0 | clip1) )
935 ClipFlags clipOut = clip0 ? clip0 : clip1;
937 if ( clipOut & Clip::Left )
940 y = ly1 - (lx1 - x0_) * (ly1 - ly0)/(lx1 - lx0);
942 else if ( clipOut & Clip::Top )
944 x = lx0 - (ly0 - y0_) * (lx1 - lx0)/(ly1 - ly0);
947 else if ( clipOut & Clip::Right )
950 y = ly0 - (lx0 - x1_) * (ly1 - ly0)/(lx1 - lx0);
954 x = lx1 - (ly1 - y1_) * (lx1 - lx0)/(ly1 - ly0);
958 if ( clipOut == clip0 )
962 clip0 = ClipCode( lx0, ly0 );
968 clip1 = ClipCode( lx1, ly1 );
982 template <
typename T1>
985 return ClipLine( p0.x, p0.y, p1.x, p1.y );
1008 template <
typename T1>
1011 ClipFlags clip0 = ClipCodeFast( lx0, ly0 );
1012 ClipFlags clip1 = ClipCodeFast( lx1, ly1 );
1015 if ( !(clip0 | clip1) )
1017 if ( clip0 & clip1 )
1021 ClipFlags clipOut = clip0 ? clip0 : clip1;
1023 if ( clipOut & Clip::Left )
1026 y = ly1 - (lx1 - x0) * (ly1 - ly0)/(lx1 - lx0);
1028 else if ( clipOut & Clip::Top )
1030 x = lx0 - (ly0 - y0) * (lx1 - lx0)/(ly1 - ly0);
1033 else if ( clipOut & Clip::Right )
1036 y = ly0 - (lx0 - x1) * (ly1 - ly0)/(lx1 - lx0);
1040 x = lx1 - (ly1 - y1) * (lx1 - lx0)/(ly1 - ly0);
1044 if ( clipOut == clip0 )
1048 clip0 = ClipCodeFast( lx0, ly0 );
1054 clip1 = ClipCodeFast( lx1, ly1 );
1072 template <
typename T1>
1075 return ClipLineFast( p0.x, p0.y, p1.x, p1.y );
1082 template <
typename T1>
1085 return ((x0 < x1) ? (x >= x0 && x <= x1) : (x >= x1 && x <= x0)) &&
1086 ((y0 < y1) ? (y >= y0 && y <= y1) : (y >= y1 && y <= y0));
1092 template <
typename T1>
1095 return Includes( p.x, p.y );
1101 template <
typename T1>
1104 return Includes( r.x0, r.y0 ) && Includes( r.x1, r.y1 );
1107 #ifdef __PCL_QT_INTERFACE
1108 bool Includes(
const QPoint& p )
const noexcept
1110 return Includes( p.x(), p.y() );
1113 bool Includes(
const QRect& r )
const noexcept
1115 return Includes( r.left(), r.top() ) && Includes( r.right()+1, r.bottom()+1 );
1127 template <
typename T1>
1130 return x >= x0 && y >= y0 && x <= x1 && y <= y1;
1140 template <
typename T1>
1143 return IncludesFast( p.x, p.y );
1156 template <
typename T1>
1157 bool Intersects( T1 left, T1 top, T1 right, T1 bottom )
const noexcept
1160 return ((x0 < x1) ? (right >= x0 && left <= x1) : (right >= x1 && left <= x0)) &&
1161 ((y0 < y1) ? (bottom >= y0 && top <= y1) : (bottom >= y1 && top <= y0));
1167 template <
typename T1>
1170 return Intersects( r.x0, r.y0, r.x1, r.y1 );
1173 #ifdef __PCL_QT_INTERFACE
1174 bool Intersects(
const QRect& r )
const noexcept
1176 return Intersects( r.left(), r.top(), r.right()+1, r.bottom()+1 );
1199 template <
typename T1>
1202 return right >= x0 && left <= x1 && bottom >= y0 && top <= y1;
1211 template <
typename T1>
1214 return IntersectsFast( r.x0, r.y0, r.x1, r.y1 );
1221 template <
typename T1>
1224 Unite( r.x0, r.y0, r.x1, r.y1 );
1237 template <
typename T1>
1238 void Unite( T1 left, T1 top, T1 right, T1 bottom ) noexcept
1241 Swap( left, right );
1243 Swap( top, bottom );
1275 template <
typename T1>
1278 UniteFast( r.x0, r.y0, r.x1, r.y1 );
1300 template <
typename T1>
1301 void UniteFast( T1 left, T1 top, T1 right, T1 bottom ) noexcept
1312 template <
typename T1>
1326 template <
typename T1>
1338 template <
typename T1>
1345 #ifdef __PCL_QT_INTERFACE
1346 void Unite(
const QRect& r )
1348 Unite( r.left(), r.top(), r.right()+1, r.bottom()+1 );
1351 GenericRectangle Union(
const QRect& r )
const noexcept
1353 GenericRectangle r1 = *
this;
1358 GenericRectangle& operator |=(
const QRect& r ) noexcept
1373 template <
typename T1>
1376 return Intersect( r.x0, r.y0, r.x1, r.y1 );
1393 template <
typename T1>
1394 bool Intersect( T1 left, T1 top, T1 right, T1 bottom ) noexcept
1397 Swap( left, right );
1399 Swap( top, bottom );
1437 template <
typename T1>
1440 return IntersectFast( r.x0, r.y0, r.x1, r.y1 );
1466 template <
typename T1>
1480 template <
typename T1>
1495 template <
typename T1>
1507 template <
typename T1>
1514 #ifdef __PCL_QT_INTERFACE
1515 bool Intersect(
const QRect& r ) noexcept
1517 return Intersect( r.left(), r.top(), r.right()+1, r.bottom()+1 );
1520 GenericRectangle Intersection(
const QRect& r )
const noexcept
1522 GenericRectangle r1 = *
this;
1523 (void)r1.Intersect( r );
1527 GenericRectangle& operator &=(
const QRect& r ) noexcept
1540 template <
typename T1>
1541 void Set( T1 left, T1 top, T1 right, T1 bottom ) noexcept
1556 template <
typename T1>
1569 template <
typename T1>
1579 #ifdef __PCL_QT_INTERFACE
1580 void MoveTo(
const QPoint& p ) noexcept
1582 MoveTo( p.x(), p.y() );
1592 template <
typename T1>
1606 template <
typename T1>
1618 template <
typename T1>
1629 template <
typename T1>
1647 template <
typename T1>
1656 #ifdef __PCL_QT_INTERFACE
1657 void MoveBy(
const QPoint& p ) noexcept
1659 MoveBy( p.x(), p.y() );
1669 template <
typename T1>
1683 template <
typename T1>
1701 template <
typename T1>
1721 template <
typename T1>
1740 template <
typename T1>
1760 template <
typename T1>
1776 template <
typename T1>
1793 template <
typename T1>
1807 template <
typename T1>
1825 template <
typename T1>
1843 template <
typename T1>
1855 template <
typename T1>
1872 InflateBy( kx*Width()/2, ky*Height()/2 );
1883 InflateBy( k*Width()/2, k*Height()/2 );
1915 template <
typename T1>
1933 template <
typename T1>
1951 template <
typename T1>
1963 template <
typename T1>
1977 template <
typename T1>
1991 template <
typename T1>
2004 template <
typename T1,
typename T2>
2005 void Rotate( T1 angle, T2 xc, T2 yc ) noexcept
2016 template <
typename T1,
typename T2>
2019 Rotate( angle, center.x, center.y );
2027 template <
typename T1,
typename T2>
2028 void Rotate( T1 sa, T1 ca, T2 xc, T2 yc ) noexcept
2039 template <
typename T1,
typename T2>
2042 Rotate( sa, ca, center.x, center.y );
2050 template <
typename T1,
typename T2>
2054 r.
Rotate( angle, xc, yc );
2063 template <
typename T1,
typename T2>
2067 r.
Rotate( angle, center );
2077 template <
typename T1,
typename T2>
2081 r.
Rotate( sa, ca, xc, yc );
2091 template <
typename T1,
typename T2>
2095 r.
Rotate( sa, ca, center );
2117 PCL_PRECONDITION( n >= 0 )
2142 PCL_PRECONDITION( n >= 0 )
2198 template <
typename T1>
2215 template <
typename T1>
2231 x0 = y0 = x1 = y1 = d;
2235 #ifdef __PCL_QT_INTERFACE
2238 x0 = component( r.left() );
2239 y0 = component( r.top() );
2240 x1 = component( r.right()+1 );
2241 y1 = component( r.bottom()+1 );
2258 template <
typename T1>
2281 template <
typename T1>
2314 #ifdef __PCL_QT_INTERFACE
2317 component dx = component( p.x() ), dy = component( p.y() );
2338 template <
typename T1>
2361 template <
typename T1>
2394 #ifdef __PCL_QT_INTERFACE
2397 component dx = component( p.x() ), dy = component( p.y() );
2418 template <
typename T1>
2442 template <
typename T1>
2475 #ifdef __PCL_QT_INTERFACE
2478 component dx = component( p.x() ), dy = component( p.y() );
2479 x0 *= dx; y0 *= dy; x1 *= dx; y1 *= dy;
2496 template <
typename T1>
2522 template <
typename T1>
2550 x0 /= d; y0 /= d; x1 /= d; y1 /= d;
2554 #ifdef __PCL_QT_INTERFACE
2557 PCL_PRECONDITION( component( p.x() ) != component( 0 ) && component( p.y() ) != component( 0 ) )
2558 component dx = component( p.x() ), dy = component( p.y() );
2586 #ifdef __PCL_QT_INTERFACE
2587 operator QRect() const noexcept
2589 return QRect(
int( x0 ),
int( y0 ),
int( x1-x0 ),
int( y1-y0 ) );
2593 #ifdef __PCL_QT_INTERFACE
2594 # ifndef __PCL_QT_NO_RECT_DRAWING_HELPERS
2596 void Draw( QPainter& p,
const QBrush* b )
const
2598 int rx0, ry0, rx1, ry1;
2610 if ( rx1 - rx0 <= 1 )
2612 if ( ry1 - ry0 <= 1 )
2613 p.drawPoint( rx0, ry0 );
2615 p.drawLine( rx0, ry0, rx0, ry1-1 );
2617 else if ( ry1 - ry0 <= 1 )
2619 p.drawLine( rx0, ry0, rx1-1, ry0 );
2623 # if ( QT_VERSION >= 0x040000 )
2624 int w = rx1-rx0-1, h = ry1-ry0-1;
2626 int w = rx1-rx0, h = ry1-ry0;
2629 p.fillRect( rx0, ry0, w, h, *b );
2630 p.drawRect( rx0, ry0, w, h );
2634 void Draw( QPainter& p )
const
2639 void Draw( QPainter& p,
const QColor& c )
const
2650 #undef PCL_ASSERT_RECT_SIZE
2663 template <
typename T1,
typename T2>
inline
2666 return r1.x0 == r2.x0 && r1.y0 == r2.y0 && r1.x1 == r2.x1 && r1.y1 == r2.y1;
2674 template <
typename T>
inline
2677 return r1.x0 == d2 && r1.y0 == d2 && r1.x1 == d2 && r1.y1 == d2;
2686 template <
typename T>
inline
2689 return d1 == r2.x0 && d1 == r2.y0 && d1 == r2.x1 && d1 == r2.y1;
2698 template <
typename T1,
typename T2>
inline
2701 T1 x01 =
Min( r1.x0, r1.x1 ); T1 y01 =
Min( r1.y0, r1.y1 );
2702 T1 x11 =
Max( r1.x0, r1.x1 ); T1 y11 =
Max( r1.y0, r1.y1 );
2703 T2 x02 =
Min( r2.x0, r2.x1 ); T2 y02 =
Min( r2.y0, r2.y1 );
2704 T2 x12 =
Max( r2.x0, r2.x1 ); T2 y12 =
Max( r2.y0, r2.y1 );
2729 template <
typename T1,
typename T2>
inline
2733 T1( r1.x1 + r2.x1 ), T1( r1.y1 + r2.y1 ) );
2750 template <
typename T1,
typename T2>
inline
2754 T1( r1.x1 + p2.x ), T1( r1.y1 + p2.y ) );
2766 template <
typename T1,
typename T2>
inline
2770 T2( p1.x + r2.x1 ), T2( p1.y + r2.y1 ) );
2787 template <
typename T>
inline
2802 template <
typename T>
inline
2823 template <
typename T1,
typename T2>
inline
2827 T1( r1.x1 - r2.x1 ), T1( r1.y1 - r2.y1 ) );
2844 template <
typename T1,
typename T2>
inline
2848 T1( r1.x1 - p2.x ), T1( r1.y1 - p2.y ) );
2865 template <
typename T1,
typename T2>
inline
2869 T2( p1.x - r2.x1 ), T2( p1.y - r2.y1 ) );
2886 template <
typename T>
inline
2906 template <
typename T>
inline
2927 template <
typename T1,
typename T2>
inline
2931 T1( r1.x1 * r2.x1 ), T1( r1.y1 * r2.y1 ) );
2948 template <
typename T1,
typename T2>
inline
2952 T1( r1.x1 * p2.x ), T1( r1.y1 * p2.y ) );
2964 template <
typename T1,
typename T2>
inline
2968 T2( p1.x * r2.x1 ), T2( p1.y * r2.y1 ) );
2985 template <
typename T>
inline
3000 template <
typename T>
inline
3021 template <
typename T1,
typename T2>
inline
3024 PCL_PRECONDITION( r2.x0 != T2( 0 ) && r2.y0 != T2( 0 ) &&
3025 r2.x1 != T2( 0 ) && r2.y1 != T2( 0 ) )
3027 T1( r1.x1 / r2.x1 ), T1( r1.y1 / r2.y1 ) );
3044 template <
typename T1,
typename T2>
inline
3047 PCL_PRECONDITION( p2.x != T2( 0 ) && p2.y != T2( 0 ) )
3049 T1( r1.x1 / p2.x ), T1( r1.y1 / p2.y ) );
3066 template <
typename T1,
typename T2>
inline
3069 PCL_PRECONDITION( r2.x0 != T2( 0 ) && r2.y0 != T2( 0 ) &&
3070 r2.x1 != T2( 0 ) && r2.y1 != T2( 0 ) )
3072 T2( p1.x / r2.x1 ), T2( p1.y / r2.y1 ) );
3089 template <
typename T>
inline
3092 PCL_PRECONDITION( d2 != T( 0 ) )
3110 template <
typename T>
inline
3113 PCL_PRECONDITION( r2.x0 != T( 0 ) && r2.y0 != T( 0 ) &&
3114 r2.x1 != T( 0 ) && r2.y1 != T( 0 ) )
3133 template <
typename T,
typename T1,
typename T2>
inline
3156 template <
typename T,
typename T1,
typename T2>
inline
3177 template <
typename T,
typename T1,
typename T2>
inline
3199 template <
typename T,
typename T1,
typename T2>
inline
3216 template <
typename T>
inline
3225 #ifndef __PCL_NO_RECT_INSTANTIATE
3238 using I32Rect = GenericRectangle<int32>;
3257 using F32Rect = GenericRectangle<float>;
3276 using F64Rect = GenericRectangle<double>;
64-bit floating-point rectangle in the R^2 space.
32-bit floating-point rectangle in the R^2 space.
64-bit floating-point rectangle in the R^2 space.
32-bit floating-point rectangle in the R^2 space.
A type-safe collection of enumerated flags.
A generic point in the two-dimensional space.
A generic rectangle in the two-dimensional space.
point BottomRight() const noexcept
GenericRectangle Truncated() const noexcept
GenericRectangle(const pcl::GenericPoint< T1 > &leftTop, const pcl::GenericPoint< T1 > &rightBottom)
bool IsPointOrLine() const noexcept
component Left() const noexcept
constexpr GenericRectangle(component d)
void MoveBy(const pcl::GenericPoint< T1 > &d) noexcept
void SetWidth(T1 w) noexcept
GenericRectangle Rotated(T1 angle, const GenericPoint< T2 > ¢er) const noexcept
component Perimeter() const noexcept
double CenterY() const noexcept
constexpr GenericRectangle(T1 left, T1 top, T1 right, T1 bottom)
GenericRectangle IntersectionFast(const GenericRectangle< T1 > &r) const noexcept
bool IntersectsFast(const pcl::GenericRectangle< T1 > &r) const noexcept
ClipFlags ClipCodeFast(const pcl::GenericPoint< T1 > &p) const noexcept
void Round(int n) noexcept
point LeftTop() const noexcept
void UniteFast(T1 left, T1 top, T1 right, T1 bottom) noexcept
component x1
Horizontal coordinate of the lower right corner.
void Unite(T1 left, T1 top, T1 right, T1 bottom) noexcept
GenericRectangle Rounded(int n) const noexcept
void MoveTo(T1 x, T1 y) noexcept
GenericRectangle InflatedByFactors(double kx, double ky) noexcept
point RightTop() const noexcept
bool Intersect(T1 left, T1 top, T1 right, T1 bottom) noexcept
double CenterX() const noexcept
bool IsOrdered() const noexcept
component Area() const noexcept
void MoveBy(T1 dx, T1 dy) noexcept
GenericRectangle InflatedBy(T1 dx, T1 dy) const noexcept
component Bottom() const noexcept
GenericRectangle InflatedBy(T1 d) const noexcept
point CenterLeft() const noexcept
void InflateBy(T1 d) noexcept
constexpr GenericRectangle(component width, component height)
void DeflateBy(T1 d) noexcept
component y1
Vertical coordinate of the lower right corner.
point TopLeft() const noexcept
point Center() const noexcept
point LeftBottom() const noexcept
void InflateBy(T1 dx, T1 dy) noexcept
point CenterBottom() const noexcept
bool IsRect() const noexcept
GenericRectangle InflatedByFactor(double k) noexcept
bool IsVerticalLine() const noexcept
GenericRectangle Rotated(T1 sa, T1 ca, const GenericPoint< T2 > ¢er) const noexcept
void InflateByFactors(double kx, double ky) noexcept
bool IsHorizontalLine() const noexcept
GenericRectangle Rotated(T1 sa, T1 ca, T2 xc, T2 yc) const noexcept
GenericRectangle< int > RoundedToInt() const noexcept
GenericRectangle< int > TruncatedToInt() const noexcept
point RightBottom() const noexcept
bool ClipLineFast(pcl::GenericPoint< T1 > &p0, pcl::GenericPoint< T1 > &p1) const noexcept
void ResizeTo(T1 w, T1 h) noexcept
bool IsNormal() const noexcept
component y0
Vertical coordinate of the upper left corner.
bool IntersectsFast(T1 left, T1 top, T1 right, T1 bottom) const noexcept
bool Includes(T1 x, T1 y) const noexcept
component x0
Horizontal coordinate of the upper left corner.
ClipFlags ClipCodeFast(T1 x, T1 y) const noexcept
void Set(T1 left, T1 top, T1 right, T1 bottom) noexcept
GenericRectangle Rotated(T1 angle, T2 xc, T2 yc) const noexcept
GenericRectangle MovedTo(const pcl::GenericPoint< T1 > &p) const noexcept
void DeflateBy(T1 dx, T1 dy) noexcept
point CenterTop() const noexcept
GenericRectangle ResizedBy(T1 dw, T1 dh) const noexcept
void UniteFast(const GenericRectangle< T1 > &r) noexcept
void Rotate(T1 sa, T1 ca, T2 xc, T2 yc) noexcept
void InflateByFactor(double k) noexcept
GenericRectangle UnionFast(const GenericRectangle< T1 > &r) const noexcept
bool Intersects(const pcl::GenericRectangle< T1 > &r) const noexcept
ClipFlags ClipCode(T1 x, T1 y) const noexcept
GenericRectangle HeightSetTo(T1 h) const noexcept
bool ClipLine(pcl::GenericPoint< T1 > &p0, pcl::GenericPoint< T1 > &p1) const noexcept
component Right() const noexcept
GenericRectangle MovedBy(T1 dx, T1 dy) const noexcept
bool Includes(const GenericRectangle< T1 > &r) const noexcept
bool Includes(const pcl::GenericPoint< T1 > &p) const noexcept
point CenterRight() const noexcept
GenericRectangle ResizedTo(T1 w, T1 h) const noexcept
bool IntersectFast(const GenericRectangle< T1 > &r) noexcept
void Unite(const GenericRectangle< T1 > &r) noexcept
bool ClipLineFast(T1 &lx0, T1 &ly0, T1 &lx1, T1 &ly1) const noexcept
bool IncludesFast(const pcl::GenericPoint< T1 > &p) const noexcept
bool IntersectFast(T1 left, T1 top, T1 right, T1 bottom) noexcept
void Rotate(T1 angle, T2 xc, T2 yc) noexcept
void ResizeBy(T1 dw, T1 dh) noexcept
double Hypot() const noexcept
bool IsPoint() const noexcept
void Rotate(T1 angle, const GenericPoint< T2 > ¢er) noexcept
void MoveTo(const pcl::GenericPoint< T1 > &p) noexcept
GenericRectangle DeflatedBy(T1 d) const noexcept
bool Intersect(const GenericRectangle< T1 > &r) noexcept
GenericRectangle DeflatedBy(T1 dx, T1 dy) const noexcept
GenericRectangle(std::initializer_list< T1 > l)
point TopRight() const noexcept
point BottomLeft() const noexcept
ClipFlags ClipCode(const pcl::GenericPoint< T1 > &p) const noexcept
component ManhattanDistance() const noexcept
GenericRectangle(const GenericRectangle< T1 > &r)
constexpr GenericRectangle()
GenericRectangle Union(const GenericRectangle< T1 > &r) const noexcept
GenericRectangle Ordered() const noexcept
component Top() const noexcept
component Width() const noexcept
bool IncludesFast(T1 x, T1 y) const noexcept
GenericRectangle MovedBy(const pcl::GenericPoint< T1 > &d) const noexcept
GenericRectangle MovedTo(T1 x, T1 y) const noexcept
component Height() const noexcept
void MoveBy(T1 dxy) noexcept
void SetHeight(T1 h) noexcept
double Diagonal() const noexcept
GenericRectangle Intersection(const GenericRectangle< T1 > &r) const noexcept
GenericRectangle Rounded() const noexcept
bool ClipLine(T1 &lx0, T1 &ly0, T1 &lx1, T1 &ly1) const noexcept
GenericRectangle WidthSetTo(T1 w) const noexcept
void Rotate(T1 sa, T1 ca, const GenericPoint< T2 > ¢er) noexcept
bool IsLine() const noexcept
bool Intersects(T1 left, T1 top, T1 right, T1 bottom) const noexcept
32-bit integer rectangle on the plane.
32-bit integer rectangle on the plane.
bool operator==(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
bool operator<(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
Complex< T1 > operator-(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Complex< T1 > operator*(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Complex< T1 > operator+(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Complex< T1 > operator/(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
Complex< T > Sqrt(const Complex< T > &c) noexcept
T Abs(const Complex< T > &c) noexcept
Complex< T > Round(const Complex< T > &c) noexcept
void SinCos(T x, T &sx, T &cx) noexcept
void Rotate(T &x, T &y, T1 sa, T1 ca, T2 xc, T2 yc) noexcept
int RoundInt(T x) noexcept
int TruncInt(T x) noexcept
void Swap(GenericPoint< T > &p1, GenericPoint< T > &p2) noexcept
bool IsHorizontalLine(T x0, T y0, T x1, T y1) noexcept
bool IsNormalRect(T x0, T y0, T x1, T y1) noexcept
bool IsRect(T x0, T y0, T x1, T y1) noexcept
bool IsOrderedRect(T x0, T y0, T x1, T y1) noexcept
bool IsLine(T x0, T y0, T x1, T y1) noexcept
bool IsVerticalLine(T x0, T y0, T x1, T y1) noexcept
bool IsPointOrLine(T x0, T y0, T x1, T y1) noexcept
bool IsPoint(T x0, T y0, T x1, T y1) noexcept
void OrderRect(T &x0, T &y0, T &x1, T &y1) noexcept
constexpr const T & Min(const T &a, const T &b) noexcept
constexpr const T & Max(const T &a, const T &b) noexcept