34 :
origin(components[0], components[1]),
35 size(components[2], components[3]) {}
44 return TRect(left, top, right - left, bottom - top);
48 return TRect(x, y, width, height);
56 template <
typename Po
intIter>
58 const PointIter last) {
64 auto right = first->x;
65 auto bottom = first->y;
66 for (
auto it = first + 1; it < last; ++it) {
67 left = std::min(left, it->x);
68 top = std::min(top, it->y);
69 right = std::max(right, it->x);
70 bottom = std::max(bottom, it->y);
77 -std::numeric_limits<Type>::infinity(),
78 std::numeric_limits<Type>::infinity(),
79 std::numeric_limits<Type>::infinity());
139 return -std::numeric_limits<Type>::infinity();
146 return -std::numeric_limits<Type>::infinity();
153 return std::numeric_limits<Type>::infinity();
160 return std::numeric_limits<Type>::infinity();
182 return MakeLTRB(ltrb[0], ltrb[1], ltrb[2], ltrb[3]);
188 auto [left, top, right, bottom] =
GetLTRB();
194 const Matrix& transform)
const {
196 for (
size_t i = 0; i < points.size(); i++) {
197 points[i] = transform * points[i];
213 std::min(this_ltrb[1], other_ltrb[1]),
214 std::max(this_ltrb[2], other_ltrb[2]),
215 std::max(this_ltrb[3], other_ltrb[3])
224 std::max(this_ltrb[1], other_ltrb[1]),
225 std::min(this_ltrb[2], other_ltrb[2]),
226 std::min(this_ltrb[3], other_ltrb[3])
228 if (intersection.size.IsEmpty()) {
241 const auto& [a_left, a_top, a_right, a_bottom] =
GetLTRB();
242 const auto& [b_left, b_top, b_right, b_bottom] = o.
GetLTRB();
243 if (b_left <= a_left && b_right >= a_right) {
244 if (b_top <= a_top && b_bottom >= a_bottom) {
248 if (b_top <= a_top && b_bottom > a_top) {
252 if (b_bottom >= a_bottom && b_top < a_bottom) {
257 if (b_top <= a_top && b_bottom >= a_bottom) {
258 if (b_left <= a_left && b_right > a_left) {
262 if (b_right >= a_right && b_left < a_right) {
316 out <<
"(" << r.
origin <<
", " << r.
size <<
")";