PCL
Rectangle Operators and Functions

Functions

template<typename T1 , typename T2 >
GenericRectangle< T1 > pcl::operator* (const GenericRectangle< T1 > &r1, const GenericRectangle< T2 > &r2)
 
template<typename T1 , typename T2 >
GenericRectangle< T1 > pcl::operator* (const GenericRectangle< T1 > &r1, const GenericPoint< T2 > &p2)
 
template<typename T1 , typename T2 >
GenericRectangle< T2 > pcl::operator* (const GenericPoint< T1 > &p1, const GenericRectangle< T2 > &r2)
 
template<typename T >
GenericRectangle< T > pcl::operator* (const GenericRectangle< T > &r1, T d2)
 
template<typename T >
GenericRectangle< T > pcl::operator* (T d1, const GenericRectangle< T > &r2)
 
template<typename T1 , typename T2 >
GenericRectangle< T1 > pcl::operator+ (const GenericRectangle< T1 > &r1, const GenericRectangle< T2 > &r2)
 
template<typename T1 , typename T2 >
GenericRectangle< T1 > pcl::operator+ (const GenericRectangle< T1 > &r1, const GenericPoint< T2 > &p2)
 
template<typename T1 , typename T2 >
GenericRectangle< T2 > pcl::operator+ (const GenericPoint< T1 > &p1, const GenericRectangle< T2 > &r2)
 
template<typename T >
GenericRectangle< T > pcl::operator+ (const GenericRectangle< T > &r1, T d2)
 
template<typename T >
GenericRectangle< T > pcl::operator+ (T d1, const GenericRectangle< T > &r2)
 
template<typename T1 , typename T2 >
GenericRectangle< T1 > pcl::operator- (const GenericRectangle< T1 > &r1, const GenericRectangle< T2 > &r2)
 
template<typename T1 , typename T2 >
GenericRectangle< T1 > pcl::operator- (const GenericRectangle< T1 > &r1, const GenericPoint< T2 > &p2)
 
template<typename T1 , typename T2 >
GenericRectangle< T2 > pcl::operator- (const GenericPoint< T1 > &p1, const GenericRectangle< T2 > &r2)
 
template<typename T >
GenericRectangle< T > pcl::operator- (const GenericRectangle< T > &r1, T d2)
 
template<typename T >
GenericRectangle< T > pcl::operator- (T d1, const GenericRectangle< T > &r2)
 
template<typename T1 , typename T2 >
GenericRectangle< T1 > pcl::operator/ (const GenericRectangle< T1 > &r1, const GenericRectangle< T2 > &r2)
 
template<typename T1 , typename T2 >
GenericRectangle< T1 > pcl::operator/ (const GenericRectangle< T1 > &r1, const GenericPoint< T2 > &p2)
 
template<typename T1 , typename T2 >
GenericRectangle< T2 > pcl::operator/ (const GenericPoint< T1 > &p1, const GenericRectangle< T2 > &r2)
 
template<typename T >
GenericRectangle< T > pcl::operator/ (const GenericRectangle< T > &r1, T d2)
 
template<typename T >
GenericRectangle< T > pcl::operator/ (T d1, const GenericRectangle< T > &r2)
 
template<typename T1 , typename T2 >
bool pcl::operator< (const GenericRectangle< T1 > &r1, const GenericRectangle< T2 > &r2)
 
template<typename T1 , typename T2 >
bool pcl::operator== (const GenericRectangle< T1 > &r1, const GenericRectangle< T2 > &r2)
 
template<typename T >
bool pcl::operator== (const GenericRectangle< T > &r1, T d2)
 
template<typename T >
bool pcl::operator== (T d1, const GenericRectangle< T > &r2)
 
template<typename T , typename T1 , typename T2 >
void pcl::Rotate (GenericRectangle< T > &r, T1 a, T2 xc, T2 yc)
 
template<typename T , typename T1 , typename T2 >
void pcl::Rotate (GenericRectangle< T > &r, T1 a, const GenericPoint< T2 > &c)
 
template<typename T , typename T1 , typename T2 >
void pcl::Rotate (GenericRectangle< T > &r, T1 sa, T1 ca, T2 xc, T2 yc)
 
template<typename T , typename T1 , typename T2 >
void pcl::Rotate (GenericRectangle< T > &r, T1 sa, T1 ca, const GenericPoint< T2 > &c)
 
template<typename T >
void pcl::Swap (GenericRectangle< T > &r1, GenericRectangle< T > &r2)
 

Detailed Description

Function Documentation

◆ operator*() [1/5]

template<typename T1 , typename T2 >
GenericRectangle<T1> pcl::operator* ( const GenericRectangle< T1 > &  r1,
const GenericRectangle< T2 > &  r2 
)
inline

Multiplies two rectangles r1 and r2, and returns the resulting product rectangle.

Rectangle multiplication consists in multiplying homonym coordinates. Given two rectangles r1 and r2, the product rectangle P = r1 * r2 is given by:

P.x0 = r1.x0 * r2.x0
P.y0 = r1.y0 * r2.y0
P.x1 = r1.x1 * r2.x1
P.y1 = r1.y1 * r2.y1

Definition at line 2653 of file Rectangle.h.

References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ operator*() [2/5]

template<typename T1 , typename T2 >
GenericRectangle<T1> pcl::operator* ( const GenericRectangle< T1 > &  r1,
const GenericPoint< T2 > &  p2 
)
inline

Multiplies a rectangle r1 by a point p2, and returns the resulting product rectangle.

Given a rectangle r and a point p, the product rectangle P = r * p is given by:

P.x0 = r1.x0 * p.x
P.y0 = r1.y0 * p.y
P.x1 = r1.x1 * p.x
P.y1 = r1.y1 * p.y

Definition at line 2674 of file Rectangle.h.

References pcl::GenericPoint< T >::x, pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericPoint< T >::y, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ operator*() [3/5]

template<typename T1 , typename T2 >
GenericRectangle<T2> pcl::operator* ( const GenericPoint< T1 > &  p1,
const GenericRectangle< T2 > &  r2 
)
inline

Multiplies a point p1 by a rectangle r2, and returns the resulting product rectangle.

Rectangle multiplication is a commutative operation, thus see pcl::operator *( const GenericRectangle<T1>&, const GenericPoint<T2>& ).

Definition at line 2690 of file Rectangle.h.

References pcl::GenericPoint< T >::x, pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericPoint< T >::y, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ operator*() [4/5]

template<typename T >
GenericRectangle<T> pcl::operator* ( const GenericRectangle< T > &  r1,
d2 
)
inline

Multiplies a rectangle r1 by a scalar d2, and returns the resulting product rectangle.

Given a rectangle r and a scalar d, the product rectangle P = r * d is given by:

P.x0 = r1.x0 * d
P.y0 = r1.y0 * d
P.x1 = r1.x1 * d
P.y1 = r1.y1 * d

Definition at line 2711 of file Rectangle.h.

◆ operator*() [5/5]

template<typename T >
GenericRectangle<T> pcl::operator* ( d1,
const GenericRectangle< T > &  r2 
)
inline

Multiplies a scalar d1 by a rectangle r2, and returns the resulting product rectangle.

Rectangle multiplication is a commutative operation, thus see pcl::operator *( const GenericRectangle<T>&, T ).

Definition at line 2726 of file Rectangle.h.

◆ operator+() [1/5]

template<typename T1 , typename T2 >
GenericRectangle<T1> pcl::operator+ ( const GenericRectangle< T1 > &  r1,
const GenericRectangle< T2 > &  r2 
)
inline

Adds two rectangles r1 and r2, and returns the resulting sum rectangle.

Rectangle addition consists in adding homonym coordinates. Given two rectangles r1 and r2, the sum rectangle s = r1 + r2 is given by:

s.x0 = r1.x0 + r2.x0
s.y0 = r1.y0 + r2.y0
s.x1 = r1.x1 + r2.x1
s.y1 = r1.y1 + r2.y1

Definition at line 2455 of file Rectangle.h.

References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ operator+() [2/5]

template<typename T1 , typename T2 >
GenericRectangle<T1> pcl::operator+ ( const GenericRectangle< T1 > &  r1,
const GenericPoint< T2 > &  p2 
)
inline

Adds a rectangle r1 and a point p2, and returns the resulting sum rectangle.

Given a rectangle r and a point p, the sum rectangle s = r + p is given by:

s.x0 = r.x0 + p.x
s.y0 = r.y0 + p.y
s.x1 = r.x1 + p.x
s.y1 = r.y1 + p.y

Definition at line 2476 of file Rectangle.h.

References pcl::GenericPoint< T >::x, pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericPoint< T >::y, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ operator+() [3/5]

template<typename T1 , typename T2 >
GenericRectangle<T2> pcl::operator+ ( const GenericPoint< T1 > &  p1,
const GenericRectangle< T2 > &  r2 
)
inline

Adds a point p1 and a rectangle r2, and returns the resulting sum rectangle.

Rectangle addition is a commutative operation, thus see pcl::operator +( const GenericRectangle<T1>&, const GenericPoint<T2>& ).

Definition at line 2492 of file Rectangle.h.

References pcl::GenericPoint< T >::x, pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericPoint< T >::y, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ operator+() [4/5]

template<typename T >
GenericRectangle<T> pcl::operator+ ( const GenericRectangle< T > &  r1,
d2 
)
inline

Adds a rectangle r1 and a scalar d2, and returns the resulting sum rectangle.

Given a rectangle r and a scalar d, the sum rectangle s = r + d is given by:

s.x0 = r.x0 + d
s.y0 = r.y0 + d
s.x1 = r.x1 + d
s.y1 = r.y1 + d

Definition at line 2513 of file Rectangle.h.

◆ operator+() [5/5]

template<typename T >
GenericRectangle<T> pcl::operator+ ( d1,
const GenericRectangle< T > &  r2 
)
inline

Adds a scalar d1 and a rectangle r2, and returns the resulting sum rectangle.

Rectangle addition is a commutative operation, thus see pcl::operator +( const GenericRectangle<T>&, T ).

Definition at line 2528 of file Rectangle.h.

◆ operator-() [1/5]

template<typename T1 , typename T2 >
GenericRectangle<T1> pcl::operator- ( const GenericRectangle< T1 > &  r1,
const GenericRectangle< T2 > &  r2 
)
inline

Subtracts two rectangles r1 and r2, and returns the resulting difference rectangle.

Rectangle subtraction consists in subtracting homonym coordinates. Given two rectangles r1 and r2, the difference rectangle s = r1 - r2 is given by:

s.x0 = r1.x0 - r2.x0
s.y0 = r1.y0 - r2.y0
s.x1 = r1.x1 - r2.x1
s.y1 = r1.y1 - r2.y1

Definition at line 2549 of file Rectangle.h.

References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ operator-() [2/5]

template<typename T1 , typename T2 >
GenericRectangle<T1> pcl::operator- ( const GenericRectangle< T1 > &  r1,
const GenericPoint< T2 > &  p2 
)
inline

Subtracts a point p2 from a rectangle r1, and returns the resulting difference rectangle.

Given a rectangle r and a point p, the difference rectangle s = r - p is given by:

s.x0 = r.x0 - p.x
s.y0 = r.y0 - p.y
s.x1 = r.x1 - p.x
s.y1 = r.y1 - p.y

Definition at line 2570 of file Rectangle.h.

References pcl::GenericPoint< T >::x, pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericPoint< T >::y, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ operator-() [3/5]

template<typename T1 , typename T2 >
GenericRectangle<T2> pcl::operator- ( const GenericPoint< T1 > &  p1,
const GenericRectangle< T2 > &  r2 
)
inline

Subtracts a rectangle r2 from a point p1, and returns the resulting difference rectangle.

Given a rectangle r and a point p, the difference rectangle s = p - r is given by:

s.x0 = p.x - r.x0
s.y0 = p.y - r.y0
s.x1 = p.x - r.x1
s.y1 = p.y - r.y1

Definition at line 2591 of file Rectangle.h.

References pcl::GenericPoint< T >::x, pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericPoint< T >::y, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ operator-() [4/5]

template<typename T >
GenericRectangle<T> pcl::operator- ( const GenericRectangle< T > &  r1,
d2 
)
inline

Subtracts a scalar d2 from a rectangle r1, and returns the resulting difference rectangle.

Given a rectangle r and a scalar d, the difference rectangle s = r - d is given by:

s.x0 = r.x0 - d
s.y0 = r.y0 - d
s.x1 = r.x1 - d
s.y1 = r.y1 - d

Definition at line 2612 of file Rectangle.h.

◆ operator-() [5/5]

template<typename T >
GenericRectangle<T> pcl::operator- ( d1,
const GenericRectangle< T > &  r2 
)
inline

Subtracts a rectangle r2 from a scalar d1, and returns the resulting difference rectangle.

Given a rectangle r and a scalar d, the difference rectangle s = d - r is given by:

s.x0 = d - r.x0
s.y0 = d - r.y0
s.x1 = d - r.x1
s.y1 = d - r.y1

Definition at line 2632 of file Rectangle.h.

◆ operator/() [1/5]

template<typename T1 , typename T2 >
GenericRectangle<T1> pcl::operator/ ( const GenericRectangle< T1 > &  r1,
const GenericRectangle< T2 > &  r2 
)
inline

Divides two rectangles r1 and r2, and returns the resulting quotient rectangle.

Rectangle division consists in dividing homonym coordinates. Given two rectangles r1 and r2, the quotient rectangle Q = r1 / r2 is given by:

Q.x0 = r1.x0 / r2.x0
Q.y0 = r1.y0 / r2.y0
Q.x1 = r1.x1 / r2.x1
Q.y1 = r1.y1 / r2.y1

Definition at line 2747 of file Rectangle.h.

References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ operator/() [2/5]

template<typename T1 , typename T2 >
GenericRectangle<T1> pcl::operator/ ( const GenericRectangle< T1 > &  r1,
const GenericPoint< T2 > &  p2 
)
inline

Divides a rectangle r1 by a point p2, and returns the resulting quotient rectangle.

Given a rectangle r and a point p, the quotient rectangle Q = r / p is given by:

Q.x0 = r.x0 / p.x
Q.y0 = r.y0 / p.y
Q.x1 = r.x1 / p.x
Q.y1 = r.y1 / p.y

Definition at line 2770 of file Rectangle.h.

References pcl::GenericPoint< T >::x, pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericPoint< T >::y, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ operator/() [3/5]

template<typename T1 , typename T2 >
GenericRectangle<T2> pcl::operator/ ( const GenericPoint< T1 > &  p1,
const GenericRectangle< T2 > &  r2 
)
inline

Divides a point p1 by a rectangle r2, and returns the resulting quotient rectangle.

Given a rectangle r and a point p, the quotient rectangle Q = p / r is given by:

Q.x0 = p.x / r.x0
Q.y0 = p.y / r.y0
Q.x1 = p.x / r.x1
Q.y1 = p.y / r.y1

Definition at line 2792 of file Rectangle.h.

References pcl::GenericPoint< T >::x, pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericPoint< T >::y, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ operator/() [4/5]

template<typename T >
GenericRectangle<T> pcl::operator/ ( const GenericRectangle< T > &  r1,
d2 
)
inline

Divides a rectangle r1 by a scalar d2, and returns the resulting quotient rectangle.

Given a rectangle r and a scalar d, the quotient rectangle Q = r / d is given by:

Q.x0 = r.x0 / d
Q.y0 = r.y0 / d
Q.x1 = r.x1 / d
Q.y1 = r.y1 / d

Definition at line 2815 of file Rectangle.h.

◆ operator/() [5/5]

template<typename T >
GenericRectangle<T> pcl::operator/ ( d1,
const GenericRectangle< T > &  r2 
)
inline

Divides a scalar d1 by a rectangle r2, and returns the resulting quotient rectangle.

Given a rectangle r and a scalar d, the quotient rectangle Q = d / r is given by:

Q.x0 = d / r.x0
Q.y0 = d / r.y0
Q.x1 = d / r.x1
Q.y1 = d / r.y1

Definition at line 2836 of file Rectangle.h.

◆ operator<()

template<typename T1 , typename T2 >
bool pcl::operator< ( const GenericRectangle< T1 > &  r1,
const GenericRectangle< T2 > &  r2 
)
inline

Returns true iff a rectangle r1 is less than another rectangle r2. For rectangle comparisons, vertical coordinates have precedence over horizontal coordinates.

Definition at line 2424 of file Rectangle.h.

References pcl::Max(), and pcl::Min().

◆ operator==() [1/3]

template<typename T1 , typename T2 >
bool pcl::operator== ( const GenericRectangle< T1 > &  r1,
const GenericRectangle< T2 > &  r2 
)
inline

Returns true iff two rectangles r1 and r2 are equal. Two rectangles are equal if their homonym coordinates are equal.

Definition at line 2389 of file Rectangle.h.

References pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ operator==() [2/3]

template<typename T >
bool pcl::operator== ( const GenericRectangle< T > &  r1,
d2 
)
inline

Returns true iff a rectangle r1 is equal to a scalar d2. A rectangle is equal to a scalar d if the four coordinates of r are equal to d.

Definition at line 2400 of file Rectangle.h.

◆ operator==() [3/3]

template<typename T >
bool pcl::operator== ( d1,
const GenericRectangle< T > &  r2 
)
inline

Returns true iff a scalar d1 is equal to a rectangle r2. A scalar d is equal to a rectangle r if the four coordinates of r are equal to d.

Definition at line 2412 of file Rectangle.h.

◆ Rotate() [1/4]

template<typename T , typename T1 , typename T2 >
void pcl::Rotate ( GenericRectangle< T > &  r,
T1  a,
T2  xc,
T2  yc 
)
inline

Rotates a rectangle in the plane, given a rotation angle and the coordinates of a center of rotation.

Parameters
rReference to a rectangle that will be rotated.
aRotation angle in radians. Positive angles are measured counter-clockwise.
xcAbscissa (x coordinate) of the center of rotation.
ycOrdinate (y coordinate) of the center of rotation.

The coordinates r.x0, r.y0, r.x1 and r.y1 are replaced by their corresponding rotated values.

Definition at line 2859 of file Rectangle.h.

◆ Rotate() [2/4]

template<typename T , typename T1 , typename T2 >
void pcl::Rotate ( GenericRectangle< T > &  r,
T1  a,
const GenericPoint< T2 > &  c 
)
inline

Rotates a rectangle in the plane, given a rotation angle and a rotation center point.

Parameters
rReference to a rectangle that will be rotated.
aRotation angle in radians. Positive angles are measured counter-clockwise.
cReference to a point that will be taken as the center of rotation.

The coordinates r.x0, r.y0, r.x1 and r.y1 are replaced by their corresponding rotated values.

Definition at line 2882 of file Rectangle.h.

◆ Rotate() [3/4]

template<typename T , typename T1 , typename T2 >
void pcl::Rotate ( GenericRectangle< T > &  r,
T1  sa,
T1  ca,
T2  xc,
T2  yc 
)
inline

Rotates a rectangle in the plane, given a rotation angle by its sine and cosine, and the coordinates of a center of rotation.

Parameters
rReference to a rectangle that will be rotated.
saSine of the rotation angle.
caCosine of the rotation angle.
xcAbscissa (x coordinate) of the center of rotation.
ycOrdinate (y coordinate) of the center of rotation.

The coordinates r.x0, r.y0, r.x1 and r.y1 are replaced by their corresponding rotated values.

Definition at line 2903 of file Rectangle.h.

References pcl::Rotate(), pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.

◆ Rotate() [4/4]

template<typename T , typename T1 , typename T2 >
void pcl::Rotate ( GenericRectangle< T > &  r,
T1  sa,
T1  ca,
const GenericPoint< T2 > &  c 
)
inline

Rotates a rectangle in the plane, given a rotation angle by its sine and cosine, and a rotation center point.

Parameters
rReference to a rectangle that will be rotated.
saSine of the rotation angle.
caCosine of the rotation angle.
cReference to a point that will be taken as the center of rotation.

The coordinates r.x0, r.y0, r.x1 and r.y1 are replaced by their corresponding rotated values.

Definition at line 2925 of file Rectangle.h.

References pcl::Rotate(), pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.

◆ Swap()

template<typename T >
void pcl::Swap ( GenericRectangle< T > &  r1,
GenericRectangle< T > &  r2 
)
inline

Exchanges two rectangles r1 and r2. Calling this function is equivalent to:

pcl::Swap( r1.x0, r2.x0 ); pcl::Swap( r1.y0, r2.y0 );
pcl::Swap( r1.x1, r2.x1 ); pcl::Swap( r1.y1, r2.y1 );

Definition at line 2942 of file Rectangle.h.

References pcl::Swap(), pcl::GenericRectangle< T >::x0, pcl::GenericRectangle< T >::x1, pcl::GenericRectangle< T >::y0, and pcl::GenericRectangle< T >::y1.