Apollo 10.0
自动驾驶开放平台
|
Implements a class of (undirected) axes-aligned bounding boxes in 2-D. 更多...
#include <aabox2d.h>
Public 成员函数 | |
AABox2d ()=default | |
Default constructor. | |
AABox2d (const Vec2d ¢er, const double length, const double width) | |
Parameterized constructor. | |
AABox2d (const Vec2d &one_corner, const Vec2d &opposite_corner) | |
Parameterized constructor. | |
AABox2d (const std::vector< Vec2d > &points) | |
Parameterized constructor. | |
const Vec2d & | center () const |
Getter of center_ | |
double | center_x () const |
Getter of x-component of center_ | |
double | center_y () const |
Getter of y-component of center_ | |
double | length () const |
Getter of length_ | |
double | width () const |
Getter of width_ | |
double | half_length () const |
Getter of half_length_ | |
double | half_width () const |
Getter of half_width_ | |
double | area () const |
Getter of length_*width_ | |
double | min_x () const |
Returns the minimum x-coordinate of the box | |
double | max_x () const |
Returns the maximum x-coordinate of the box | |
double | min_y () const |
Returns the minimum y-coordinate of the box | |
double | max_y () const |
Returns the maximum y-coordinate of the box | |
void | GetAllCorners (std::vector< Vec2d > *const corners) const |
Gets all corners in counter clockwise order. | |
bool | IsPointIn (const Vec2d &point) const |
Determines whether a given point is in the box. | |
bool | IsPointOnBoundary (const Vec2d &point) const |
Determines whether a given point is on the boundary of the box. | |
double | DistanceTo (const Vec2d &point) const |
Determines the distance between a point and the box. | |
double | DistanceTo (const AABox2d &box) const |
Determines the distance between two boxes. | |
bool | HasOverlap (const AABox2d &box) const |
Determines whether two boxes overlap. | |
void | Shift (const Vec2d &shift_vec) |
Shift the center of AABox by the input vector. | |
void | MergeFrom (const AABox2d &other_box) |
Changes box to include another given box, as well as the current one. | |
void | MergeFrom (const Vec2d &other_point) |
Changes box to include a given point, as well as the current box. | |
std::string | DebugString () const |
Gets a human-readable debug string | |
Implements a class of (undirected) axes-aligned bounding boxes in 2-D.
This class is referential-agnostic.
|
default |
Default constructor.
Creates an axes-aligned box with zero length and width at the origin.
apollo::common::math::AABox2d::AABox2d | ( | const Vec2d & | center, |
const double | length, | ||
const double | width | ||
) |
Parameterized constructor.
Creates an axes-aligned box with given center, length, and width.
center | The center of the box |
length | The size of the box along the x-axis |
width | The size of the box along the y-axis |
在文件 aabox2d.cc 第 31 行定义.
Parameterized constructor.
Creates an axes-aligned box from two opposite corners.
one_corner | One corner of the box |
opposite_corner | The opposite corner to the first one |
在文件 aabox2d.cc 第 41 行定义.
|
explicit |
Parameterized constructor.
Creates an axes-aligned box containing all points in a given vector.
points | Vector of points to be included inside the box. |
在文件 aabox2d.cc 第 46 行定义.
|
inline |
|
inline |
|
inline |
Getter of x-component of center_
|
inline |
Getter of y-component of center_
std::string apollo::common::math::AABox2d::DebugString | ( | ) | const |
Gets a human-readable debug string
在文件 aabox2d.cc 第 148 行定义.
double apollo::common::math::AABox2d::DistanceTo | ( | const AABox2d & | box | ) | const |
Determines the distance between two boxes.
box | Another box. |
在文件 aabox2d.cc 第 101 行定义.
double apollo::common::math::AABox2d::DistanceTo | ( | const Vec2d & | point | ) | const |
Determines the distance between a point and the box.
point | The point whose distance to the box we wish to determine. |
在文件 aabox2d.cc 第 89 行定义.
void apollo::common::math::AABox2d::GetAllCorners | ( | std::vector< Vec2d > *const | corners | ) | const |
Gets all corners in counter clockwise order.
corners | Output where the corners are written |
在文件 aabox2d.cc 第 66 行定义.
|
inline |
|
inline |
bool apollo::common::math::AABox2d::HasOverlap | ( | const AABox2d & | box | ) | const |
bool apollo::common::math::AABox2d::IsPointIn | ( | const Vec2d & | point | ) | const |
Determines whether a given point is in the box.
point | The point we wish to test for containment in the box |
在文件 aabox2d.cc 第 75 行定义.
bool apollo::common::math::AABox2d::IsPointOnBoundary | ( | const Vec2d & | point | ) | const |
Determines whether a given point is on the boundary of the box.
point | The point we wish to test for boundary membership |
在文件 aabox2d.cc 第 80 行定义.
|
inline |
|
inline |
|
inline |
void apollo::common::math::AABox2d::MergeFrom | ( | const AABox2d & | other_box | ) |
Changes box to include another given box, as well as the current one.
other_box | Another box |
在文件 aabox2d.cc 第 124 行定义.
void apollo::common::math::AABox2d::MergeFrom | ( | const Vec2d & | other_point | ) |
Changes box to include a given point, as well as the current box.
other_point | Another point |
在文件 aabox2d.cc 第 136 行定义.
|
inline |
|
inline |
void apollo::common::math::AABox2d::Shift | ( | const Vec2d & | shift_vec | ) |
Shift the center of AABox by the input vector.
shift_vec | The vector by which we wish to shift the box |
在文件 aabox2d.cc 第 122 行定义.
|
inline |