PCL
|
A generic point in the two-dimensional space. More...
#include <Point.h>
Public Types | |
using | component = T |
Public Member Functions | |
constexpr | GenericPoint () |
constexpr | GenericPoint (component d) |
template<typename T1 > | |
GenericPoint (const GenericPoint< T1 > &p) | |
template<typename T1 > | |
GenericPoint (std::initializer_list< T1 > l) | |
template<typename T1 , typename T2 > | |
constexpr | GenericPoint (T1 xPos, T2 yPos) |
GenericPoint | Deg () const noexcept |
template<typename T1 > | |
double | DistanceTo (const GenericPoint< T1 > &p) const noexcept |
double | DistanceToOrigin () const noexcept |
template<typename T1 > | |
double | Dot (const GenericPoint< T1 > &p) const noexcept |
template<typename T1 , typename T2 > | |
double | Dot (T1 px, T2 py) const noexcept |
template<typename T1 > | |
double | ManhattanDistanceTo (const GenericPoint< T1 > &p) const noexcept |
double | ManhattanDistanceToOrigin () const noexcept |
template<typename T1 > | |
void | MoveBy (const GenericPoint< T1 > &d) noexcept |
template<typename T1 , typename T2 > | |
void | MoveBy (T1 dx, T2 dy) noexcept |
template<typename T1 > | |
void | MoveBy (T1 dxy) noexcept |
template<typename T1 > | |
GenericPoint | MovedBy (const GenericPoint< T1 > &d) const noexcept |
template<typename T1 , typename T2 > | |
GenericPoint | MovedBy (T1 dx, T2 dy) const noexcept |
template<typename T1 > | |
GenericPoint | MovedTo (const GenericPoint< T1 > &p) const noexcept |
template<typename T1 , typename T2 > | |
GenericPoint | MovedTo (T1 xPos, T2 yPos) const noexcept |
template<typename T1 > | |
void | MoveTo (const GenericPoint< T1 > &p) noexcept |
template<typename T1 , typename T2 > | |
void | MoveTo (T1 xPos, T2 yPos) noexcept |
GenericPoint & | operator*= (component d) noexcept |
template<typename T1 > | |
GenericPoint & | operator*= (const GenericPoint< T1 > &p) noexcept |
GenericPoint | operator+ () const noexcept |
GenericPoint & | operator+= (component d) noexcept |
template<typename T1 > | |
GenericPoint & | operator+= (const GenericPoint< T1 > &p) noexcept |
GenericPoint | operator- () const noexcept |
GenericPoint & | operator-= (component d) noexcept |
template<typename T1 > | |
GenericPoint & | operator-= (const GenericPoint< T1 > &p) noexcept |
GenericPoint & | operator/= (component d) noexcept |
template<typename T1 > | |
GenericPoint & | operator/= (const GenericPoint< T1 > &p) noexcept |
GenericPoint & | operator= (component v) noexcept |
template<typename T1 > | |
GenericPoint & | operator= (const GenericPoint< T1 > &p) noexcept |
component | operator[] (int i) const noexcept |
component & | operator[] (int i) noexcept |
void | Reflect () noexcept |
GenericPoint | Reflected () const noexcept |
GenericPoint | ReflectedX () const noexcept |
GenericPoint | ReflectedY () const noexcept |
void | ReflectX () noexcept |
void | ReflectY () noexcept |
template<typename T1 , typename T2 > | |
void | Rotate (T1 angle, const GenericPoint< T2 > ¢er) noexcept |
template<typename T1 , typename T2 > | |
void | Rotate (T1 angle, T2 xc, T2 yc) noexcept |
template<typename T1 , typename T2 > | |
void | Rotate (T1 sa, T1 ca, const GenericPoint< T2 > ¢er) noexcept |
template<typename T1 , typename T2 > | |
void | Rotate (T1 sa, T1 ca, T2 xc, T2 yc) noexcept |
template<typename T1 , typename T2 > | |
GenericPoint | Rotated (T1 angle, const GenericPoint< T2 > ¢er) const noexcept |
template<typename T1 , typename T2 > | |
GenericPoint | Rotated (T1 angle, T2 xc, T2 yc) const noexcept |
template<typename T1 , typename T2 > | |
GenericPoint | Rotated (T1 sa, T1 ca, const GenericPoint< T2 > ¢er) const noexcept |
template<typename T1 , typename T2 > | |
GenericPoint | Rotated (T1 sa, T1 ca, T2 xc, T2 yc) const noexcept |
void | Round () noexcept |
void | Round (int n) noexcept |
GenericPoint | Rounded () const noexcept |
GenericPoint | Rounded (int n) const noexcept |
GenericPoint< int > | RoundedToInt () const noexcept |
template<typename T1 > | |
double | SquaredDistanceTo (const GenericPoint< T1 > &p) const noexcept |
double | SquaredDistanceToOrigin () const noexcept |
GenericPoint & | ToDeg () noexcept |
GenericPoint & | ToRad () noexcept |
void | Truncate () noexcept |
GenericPoint | Truncated () const noexcept |
GenericPoint< int > | TruncatedToInt () const noexcept |
Public Attributes | |
component | x |
Abscissa (horizontal, or X-axis coordinate). | |
component | y |
Ordinate (vertical, or Y-axis coordinate). | |
GenericPoint implements a point in the plane, specified by its x and y coordinates. The type T represents scalar point coordinates and can be any real or integer numerical type.
The coordinates of GenericPoint are accessed directly by its x and y data members. Given a GenericPoint instance p, you can use p.x and p.y directly to get or set coordinate values.
using pcl::GenericPoint< T >::component = T |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
Constructs a GenericPoint instance from coordinates taken from the specified initializer list l.
This constructor will copy 2, 1 or zero point coordinates, depending on the number of values in the initializer list. Coordinates that cannot be initialized from list values will be set to zero. For example, the following code:
is functionally equivalent to:
The type T1
must be convertible to the component type T
.
|
inline |
|
inlinenoexcept |
Returns a point whose coordinates are the coordinates of this point converted to degrees, assuming that this point has coordinates expressed in radians.
Definition at line 963 of file Point.h.
References pcl::Deg().
|
inlinenoexcept |
Returns the Euclidian distance between this point and another point p in the plane.
The Euclidian distance between two points p and q is the length of the straight line between both points: Sqrt( (p.x - q.x)^2 + (p.y - q.y)^2 ).
The type T1
must be convertible to double
.
Definition at line 250 of file Point.h.
References pcl::Sqrt().
|
inlinenoexcept |
Returns the Euclidian distance between this point and the origin of coordinates in the plane. In other words, this function returns the length of the two-dimensional vector represented by this point object.
This function is equivalent to:
but potentially faster, depending mainly on compiler optimizations.
Definition at line 287 of file Point.h.
References pcl::Sqrt().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns the Manhattan distance between this point and another point p in the plane.
The Manhattan distance between two points p and q is the sum of distances measured along axes at right angles: |p.x - q.x| + |p.y - q.y|.
The type T1
must be convertible to double
.
Definition at line 304 of file Point.h.
References pcl::Abs().
|
inlinenoexcept |
Returns the Manhattan distance between this point and the origin of coordinates in the plane. In other words, this function returns the sum of the absolute values of this point's x and y coordinates.
This function is equivalent to:
but potentially faster, depending mainly on compiler optimizations.
Definition at line 322 of file Point.h.
References pcl::Abs().
|
inlinenoexcept |
|
inlinenoexcept |
Moves this point by increments dx and dy in the X and Y directions, respectively, relative to its current position.
For example, given the declaration:
These two expressions are equivalent:
The types T1
and T2
must be convertible to the component type T
.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Multiplies both coordinates of this point by a scalar d. Returns a reference to this point.
|
inlinenoexcept |
Multiplies each coordinate of this point by its homonym coordinate of a given point p. Returns a reference to this point.
The type T1
must be convertible to the component type T
.
|
inlinenoexcept |
|
inlinenoexcept |
Adds a scalar d to both coordinates of this point. Returns a reference to this point.
|
inlinenoexcept |
Adds each coordinate of a given point p to its homonym coordinate in this point. Returns a reference to this point.
The type T1
must be convertible to the component type T
.
|
inlinenoexcept |
|
inlinenoexcept |
Subtracts a scalar d from both coordinates of this point. Returns a reference to this point.
|
inlinenoexcept |
Subtracts each coordinate of a given point p from its homonym coordinate in this point. Returns a reference to this point.
The type T1
must be convertible to the component type T
.
|
inlinenoexcept |
Divides both coordinates of this point by a scalar d. Returns a reference to this point.
|
inlinenoexcept |
Divides each coordinate of this point by its homonym coordinate of a given point p. Returns a reference to this point.
The type T1
must be convertible to the component type T
.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Rotates this point in the plane by the specified angle in radians, with respect to the specified center of rotation.
The types T1
and T2
must be convertible to double
.
Definition at line 493 of file Point.h.
References pcl::Rotate().
|
inlinenoexcept |
Rotates this point in the plane by the specified angle in radians, with respect to a center of rotation given by its coordinates xc and yc.
The types T1
and T2
must be convertible to double
.
Definition at line 481 of file Point.h.
References pcl::Rotate().
Referenced by pcl::GenericPoint< T >::Rotated().
|
inlinenoexcept |
Rotates this point in the plane by the specified angle, given by its sine and cosine, sa and ca respectively, with respect to the specified center of rotation.
The types T1
and T2
must be convertible to double
.
Definition at line 519 of file Point.h.
References pcl::Rotate().
|
inlinenoexcept |
Rotates this point in the plane by the specified angle, given by its sine and cosine, sa and ca respectively, with respect to a center of rotation given by its coordinates xc and yc.
The types T1
and T2
must be convertible to double
.
Definition at line 506 of file Point.h.
References pcl::Rotate().
|
inlinenoexcept |
Returns a point whose coordinates are the coordinates of this point rotated in the plane by the specified angle in radians, with respect to the specified center of rotation.
The types T1
and T2
must be convertible to double
.
Definition at line 547 of file Point.h.
References pcl::GenericPoint< T >::Rotate().
|
inlinenoexcept |
Returns a point whose coordinates are the coordinates of this point rotated in the plane by the specified angle in radians, with respect to a center of rotation given by its coordinates xc and yc.
The types T1
and T2
must be convertible to double
.
Definition at line 532 of file Point.h.
References pcl::GenericPoint< T >::Rotate().
|
inlinenoexcept |
Returns a point whose coordinates are the coordinates of this point rotated in the plane by the specified angle given by its sine and cosine, sa and ca respectively, with respect to the specified center of rotation.
The types T1
and T2
must be convertible to double
.
Definition at line 579 of file Point.h.
References pcl::GenericPoint< T >::Rotate().
|
inlinenoexcept |
Returns a point whose coordinates are the coordinates of this point rotated in the plane by the specified angle given by its sine and cosine, sa and ca respectively, with respect to a center of rotation given by its coordinates xc and yc.
The types T1
and T2
must be convertible to double
.
Definition at line 563 of file Point.h.
References pcl::GenericPoint< T >::Rotate().
|
inlinenoexcept |
Rounds the coordinates of this point to their corresponding nearest integer coordinates.
Definition at line 592 of file Point.h.
References pcl::Round().
|
inlinenoexcept |
Rounds the coordinates of this point to n fractional digits (n >= 0).
Definition at line 603 of file Point.h.
References pcl::Round().
|
inlinenoexcept |
Returns a point whose coordinates are the coordinates of this point rounded to their nearest integers.
Definition at line 616 of file Point.h.
References pcl::Round().
|
inlinenoexcept |
Returns a point whose coordinates are the coordinates of this point rounded to n fractional digits (n >= 0).
Definition at line 627 of file Point.h.
References pcl::Round().
|
inlinenoexcept |
Returns a point of integer template type whose coordinates are the coordinates of this point rounded to their nearest integers.
Definition at line 639 of file Point.h.
References pcl::RoundInt().
|
inlinenoexcept |
Returns the square of the Euclidian distance between this point and another point p in the plane.
The Euclidian distance between two points p and q is the length of the straight line between both points: Sqrt( (p.x - q.x)^2 + (p.y - q.y)^2 ).
This function returns just the radicand (p.x - q.x)^2 + (p.y - q.y)^2. This is useful because saves calculation of a square root, which is unnecessary in some practical cases. One of them is ordering of distances: Sqrt(A) < Sqrt(B) implies A < B.
The type T1
must be convertible to double
.
|
inlinenoexcept |
Returns the square of the Euclidian distance between this point and the origin of coordinates in the plane. In other words, this function returns the squared length of the two-dimensional vector represented by this point object.
This function is equivalent to:
but potentially faster, depending mainly on compiler optimizations.
|
inlinenoexcept |
Converts the coordinates of this point to degrees, assuming that they are expressed in radians before calling this function. Returns a reference to this object.
Definition at line 985 of file Point.h.
References pcl::Deg().
|
inlinenoexcept |
Converts the coordinates of this point to radians, assuming that they are expressed in degrees before calling this function. Returns a reference to this object.
Definition at line 973 of file Point.h.
References pcl::Rad().
|
inlinenoexcept |
Integer truncation of coordinates. Sets the coordinates x, y of this point to the corresponding nearest integer coordinates i, j, such that i <= x and j <= y.
Definition at line 651 of file Point.h.
References pcl::Trunc().
|
inlinenoexcept |
Integer truncation of coordinates. Returns a point whose coordinates are the coordinates x, y of this point truncated to their corresponding nearest integer coordinates i, j, such that i <= x and j <= y.
Definition at line 664 of file Point.h.
References pcl::Trunc().
|
inlinenoexcept |
Integer truncation of coordinates. Returns a point of integer template type whose coordinates are the coordinates x, y of this point truncated to the nearest integer coordinates i, j, such that i <= x and j <= y.
Definition at line 676 of file Point.h.
References pcl::TruncInt().