template <typename T>
interval_type get(const T& rectangle, orientation_2d) |
Expects a model of rectangle.
Returns the x interval or y interval of the rectangle, depending on the
orientation_2d value.
|
template <typename T, typename
coordinate_type>
void set(T& rectangle, orientation_2d, coordinate_type) |
Expects a model of rectangle.
Sets the x interval or y interval of the rectangle to the
coordinate, depending on the orientation_2d value. |
template <typename T>
interval_type get(const T& rectangle, orientation_2d,
direction_1d) |
Expects a model of rectangle.
Returns the coordinate specificed by the direction_1d value of the x interval or y interval of the rectangle, depending on the
orientation_2d value.
|
template <typename T, typename
coordinate_type>
void set(T& rectangle, orientation_2d, direction_1d, coordinate_type) |
Expects a model of rectangle.
Sets the coordinate specified by the direction_1d value of the x interval or y interval of the rectangle to the
coordinate, depending on the orientation_2d value. |
template <typename T, typename
T2>
T construct(const T2& h, const T2& v) |
Construct an object that is a model of rectangle given x interval
and y intervals. |
template <typename T, typename
T2>
T construct(coordinate_type xl, coordinate_type yl, coordinate_type
xh, coordinate_type yh) |
Construct an object that is a model of rectangle given four coordinate values. |
template <typename T1, typename
T2>
T1& assign(T1& left, const T2& right) |
Copies data from right object that models rectangle into left object
that models rectangle. |
template <typename T, typename
T2>
bool equivalence(const T& rectangle1,
const T2& rectangle2) |
Given two objects that model rectangle, compares and returns true if
their x and y intervals are respectively equivalent. |
template <typename T,
typename point_type>
bool contains(const T&, const point_type& point,
bool consider_touch=true) |
Given an object that models rectangle and an object that models
point, returns true
if the rectangle contains the point. If the consider_touch
flag is true will return true if the point lies along the boundary of
the rectangle. |
template <typename T1, typename
T2>
bool contains(const T1& a, const T2& b,
bool consider_touch = true) |
Returns true if model of rectangle a contains both intervals of
model of rectangle b. If the consider_touch flag is true will
consider rectangle b contained even if it touches the boundary of a. |
template <typename T>
interval_type horizontal(const T& rectangle) |
Returns the x interval of an object that models rectangle. |
template <typename T>
interval_type vertical(const T& rectangle) |
Returns the y interval of an object that models rectangle. |
template <typename T>
coordinate_type xl(const T& rectangle) |
Returns the west coordinate of an object that models rectangle. |
template <typename T>
coordinate_type xh(const T& rectangle) |
Returns the east coordinate of an object that models rectangle. |
template <typename T>
coordinate_type yl(const T& rectangle) |
Returns the south coordinate of an object that models rectangle. |
template <typename T>
coordinate_type yh(const T& rectangle) |
Returns the north coordinate of an object that models rectangle. |
template <typename T>
point_type ll(const T& rectangle) |
Returns the lower left corner point of an object that models rectangle. |
template <typename T>
point_type lr(const T& rectangle) |
Returns the lower right corner point of an object that models rectangle. |
template <typename T>
point_type ul(const T& rectangle) |
Returns the upper left corner point of an object that models rectangle. |
template <typename T>
point_type ur(const T& rectangle) |
Returns the upper right corner point of an object that models rectangle. |
// get the center coordinate
template <typename T, typename point_type>
void center(point_type& p, const T& rectangle) |
Sets object that models point to the center point of an object that models rectangle. |
template <typename T,
typename interval_type>
void horizontal(T& rectangle, const interval_type& i) |
Sets the x interval of the object that models rectangle to be equal
to the value of an object that models interval. |
template <typename T,
typename interval_type>
void vertical(T& rectangle, const interval_type& i ) |
Sets the y interval of the object that models rectangle to be equal
to the value of an object that models interval. |
template <typename
rectangle_type>
void xl(rectangle_type& rectangle, coordinate_type ) |
Sets the west coordinate of the object that models rectangle to be equal
to the coordinate value. |
template <typename
rectangle_type>
void xh(rectangle_type& rectangle, coordinate_type ) |
Sets the east coordinate of the object that models rectangle to be equal
to the coordinate value. |
template <typename
rectangle_type>
void yl(rectangle_type& rectangle, coordinate_type ) |
Sets the south coordinate of the object that models rectangle to be equal
to the coordinate value. |
template <typename
rectangle_type>
void yh(rectangle_type& rectangle, coordinate_type ) |
Sets the north coordinate of the object that models rectangle to be equal
to the coordinate value. |
template <typename T,
typename T1, typename T2>
T& set_points(T& rectangle, const T1& p1, const T2& p2) |
Sets the rectangle to the rectangle fully described by the points p1
and p2. |
template <typename T>
coordinate_difference delta(const T& rectangle,
orientation_2d) |
Returns the delta of the interval specified by orientation_2d of an object
that models rectangle. |
template <typename T>
manhattan_area_type area(const T& rectangle) |
Returns the area of an object
that models rectangle. |
template <typename T>
coordinate_difference half_perimeter(const T& rectangle) |
Returns the length plus width of an object
that models rectangle. |
template <typename T>
coordinate_difference perimeter(const T& rectangle) |
Returns the perimeter length of an object
that models rectangle. |
template <typename T>
orientation_2d quess_orientation(const T& rectangle) |
Returns the orientation in which the rectangle has a longer delta.
Returns HORIZONTAL if the rectangle is a square. |
template <typename
rectangle_type>
rectangle_type& transform(rectangle_type& rectangle,
coordinate_type axis = 0) |
Applies transform() on the two points that fully describe the
rectangle and sets the rectangle to that described by the result of
transforming those points. |
template <typename
rectangle_type>
rectangle_type& scale_up(rectangle_type& rectangle,
unsigned_area_type factor) |
Scales up x interval and y interval of an object that models
rectangle by unsigned factor. |
template <typename
rectangle_type>
rectangle_type& scale_down(rectangle_type& rectangle,
unsigned_area_type factor) |
Scales down x interval and y interval of an object that models
rectangle by unsigned factor. |
template <typename
rectangle_type, scaling_type>
rectangle_type& scale(rectangle_type& rectangle,
const scaling_type& scaling) |
Applies scale() on the two points that fully describe the rectangle
and sets the rectangle to that described by the result of transforming
those points. |
template <typename T>
T& move(T& rectangle, orientation_2d,
coordinate_difference displacement) |
Adds displacement value to interval indicated by orientation_2d of an
object that models rectangle. |
template <typename
rectangle_type, typename point_type>
rectangle_type& convolve(rectangle_type& rectangle,
const point_type& point) |
Convolves coordinate values of point with x interval and y interval of an
object that models rectangle. |
template <typename
rectangle_type, typename point_type>
rectangle_type& deconvolve(rectangle_type& rectangle,
const point_type& point) |
Deconvolves coordinate values of point withx interval and y interval of
an object that models rectangle. |
template <typename T1, typename
T2>
T1& convolve(T1& a, const T2& b) |
Convolves x interval of b with x interval of a and
convolves y
interval of b with y interval of a. |
template <typename T1, typename
T2>
T1& deconvolve(T1& a, const T2& b) |
Deconvolves x interval of b with x interval of a and
deconvolves y interval of b with y interval of a. |
template <typename T1, typename
T2>
T1& reflected_convolve(T1& a, const T2& b) |
Reflected convolves y interval of b with x interval of a and
reflected convolves x
interval of b with y interval of a. |
template <typename T1, typename
T2>
T1& reflected_deconvolve(T1& a, const T2& b) |
Reflected deconvolves y interval of b with x interval of a and
reflected deconvolves x interval of b with y interval of a. |
template <typename T,
typename point_type>
coordinate_difference euclidean_distance(const T&,
const point_type& point,
orienation_2d) |
Returns the distance from an object that models rectangle to an
object that models point along the given orientation. Returns zero
if the point is contained within the rectangle along that orientation. |
template <typename T1,
typename T2>
coordinate_difference euclidean_distance(const T1& a,
const T2& b, orienation_2d) |
Returns the distance from an object that models rectangle to an
object that models rectangle along the given orientation. Returns
zero if the intervals of the rectangles overlap along that orientation. |
template <typename T,
typename point_type>
coordinate_difference square_euclidean_distance(const T&,
const point_type& point) |
Returns the square of the Euclidean distance between a point and a
rectangle. Returns zero if the point is contained within the
rectangle. |
template <typename T1,
typename T2>
coordinate_difference square_euclidean_distance
(const T1& a, const T2& b) |
Returns the square of the Euclidean distance between rectangles a
and b. Returns zero if the rectangles intersect. |
template <typename T,
typename point_type>
coordinate_difference manhattan_distance(const T&,
const point_type& point) |
Returns the Manhattan distance between a point and a rectangle.
Returns zero if the point is contained within the rectangle. |
template <typename T1,
typename T2>
coordinate_difference manhattan_distance(const T1& a,
const T2& b) |
Returns the Manhattan distance between rectangles a and b.
Returns zero if the rectangles intersect. |
template <typename T,
typename point_type>
coordinate_distance euclidean_distance(const T&,
const point_type& point) |
Returns the Euclidean distance between a point and a rectangle.
Returns zero if the point is contained within the rectangle. |
template <typename T1,
typename T2>
coordinate_distance euclidean_distance(const T1& a,
const T2& b) |
Returns the Euclidean distance between rectangles a and b.
Returns zero if the rectangles intersect. |
template <typename T1, typename
T2>
bool intersects(const T1& a, const T2& b,
bool consider_touch = true) |
Returns true if two objects that model rectangle overlap. If
the consider_touch flag is true touching at the sides or corners is
considered overlap. |
template <typename T1, typename
T2>
bool boundaries_intersect(const T1& a, const T2& b,
bool consider_touch = true) |
Returns true is two objects that model rectangle partially overlap
such that one there is an intersection between the edges of the two
rectangles If the consider_touch flag is true a coordinate is
considered contained even if the two rectangles touch only along a side
or corner. |
template <typename T1, typename
T2>
bool abuts(const T1& a, const T2& b,
direction_2d dir)
|
Returns true if rectangle b abuts but down not overlap rectangle a
on the side of rectangle a specified by dir. |
template <typename T1, typename
T2>
bool abuts(const T1& a, const T2& b,
orientation_2d)
|
Returns true if rectangle b abuts but down not overlap rectangle a
on either side of rectangle a specified by the orientation_2d. |
template <typename T1, typename
T2>
bool abuts(const T1& a, const T2& b) |
Returns true if rectangle b abuts but down not overlap rectangle a
on any side. |
template <typename T1, typename
T2>
bool intersect(T1& a, const T2& b, orientation_2d
bool consider_touch = true) |
Sets rectangle a to the intersection of rectangle a and interval b
along the orientation_2d
and returns true. If the does not intersect the interval, the
rectangle is unchanged and the function returns false. If the flag consider_touch is true
intervals that abut are considered to intersect. |
template <typename T1, typename
T2>
bool intersect(T1& a, const T2& b,
bool consider_touch = true) |
Sets rectangle a to the intersection of rectangle a and rectangle b
and return true. If the two rectangles do not intersect rectangle
a is unchanged and the function returns false. If the flag
consider_touch is true rectangles that abut are considered to intersect. |
template <typename T1, typename
T2>
T& generalized_intersect(T1& a, const T2& b) |
Same as intersect, but if they do not intersect set a to the
rectangle between a and b by applying generalized_intersect() on the
intervals of the rectangles. |
template <typename T>
T& bloat(T& rectangle, coordinate_type) |
Bloats x and y intervals of rectangle by coordinate value. |
template <typename T>
T& bloat(T& rectangle, direction_2d, coordinate_type) |
Bloats side of rectangle specified by direction_2d by coordinate
value. |
template <typename T>
T& bloat(T& rectangle, orientation_2d, coordinate_type) |
Bloats interval of rectangle specified by orientation_2d by
coordinate value. |
template <typename T>
T& shrink(T& rectangle, coordinate_type) |
Shrinks x and y intervals of rectangle by coordinate value. |
template <typename T>
T& shrink(T& rectangle, direction_2d, coordinate_type) |
Shrinks side of rectangle specified by direction_2d by coordinate
value. |
template <typename T>
T& shrink(T& rectangle, orientation_2d, coordinate_type) |
Shrinks interval of rectangle specified by orientation_2d by
coordinate value. |
template <typename T1, typename
T2>
bool encompass(T1& a, const T2& b) |
The x and y intervals of a are set to encompass the x and y
intervals of b respectively. |
template <typename T, typename
point_type>
bool encompass(T& rectangle, const point_type& point) |
The x and y intervals of rectangle are set to encompass the x and y
coordinates of point respectively. |
template <typename T, typename
interval_type>
bool encompass(T& rectangle, const interval_type& i,
orientation_2d) |
The interval of rectangle specified by orientation_2d is set to encompass the
interval i. |
template <typename T, typename
point_type>
bool get_corner(point_type& point, const T& rectangle,
direction_2d, direction_1d) |
Sets point to the corner of the rectangle you reach if you look at
its side specified by direction_2d from within the rectangle and turn in
the direction_1d direction (low == left, high = right). Always
returns true. |
This data type is used internally when a rectangle is needed and is available
to the library user who finds it convenient to use a library rectangle data type
instead of providing their own. The data type is implemented to be
convenient to use with the library traits.