acme
Foundational cross-platform layer of the ca2 framework
Toggle main menu visibility
Loading...
Searching...
No Matches
aaa__rect_impl.h
1
#pragma once
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
62
//
63
//
64
//::i64 i64_rectangle::width() const noexcept
65
//{
66
// return right - left;
67
//}
68
//::i64 i64_rectangle::height() const noexcept
69
//{
70
// return bottom - top;
71
//}
72
//i64_size rect64SIZE_TYPE() const noexcept
73
//{
74
// return i64_size(right - left, bottom - top);
75
//}
76
//i64_point& i64_rectangle::top_left() noexcept
77
//{
78
// return *((i64_point*)this);
79
//}
80
//i64_point& i64_rectangle::bottom_right() noexcept
81
//{
82
// return *((i64_point*)this + 1);
83
//}
84
//const i64_point& i64_rectangle::top_left() const noexcept
85
//{
86
// return *((i64_point*)this);
87
//}
88
//const i64_point& i64_rectangle::bottom_right() const noexcept
89
//{
90
// return *((i64_point*)this + 1);
91
//}
92
//TEMPLATE void i64_rectangle::swap_left_right() noexcept
93
//{
94
// swap_left_right((::i64_rectangle*)(this));
95
//}
96
//void WINAPI i64_rectangle::swap_left_right(::i64_rectangle * RECT_TEMPLATE) noexcept
97
//
98
//{
99
// ::i64 temp = RECT_TEMPLATE.left; RECT_TEMPLATE.left = RECT_TEMPLATE.right; RECT_TEMPLATE.right = temp;
100
//}
101
//
102
//i64_rectangle::operator ::i64_rectangle* () noexcept
103
//{
104
// return this;
105
//}
106
//i64_rectangle::operator const ::i64_rectangle* () const noexcept
107
//{
108
// return this;
109
//}
110
//i64_rectangle::operator RECT_TEMPLATE() const
111
//{
112
// return ::rect_TEMPLATE((const ::i64_rectangle&)* this);
113
//}
114
//TEMPLATE bool i64_rectangle::contains(::i64_point i32_point) const noexcept
115
//{
116
// return ::contains(this, point);
117
//}
118
//TEMPLATE void i64_rectangle::set(::i64 x1, ::i64 y1, ::i64 x2, ::i64 y2) noexcept
119
//{
120
// ::set_rect(this, x1, y1, x2, y2);
121
//}
122
//TEMPLATE void i64_rectangle::set(::i64_point topLeft, ::i64_point bottomRight) noexcept
123
//{
124
// ::set_rect(this, topLeft.x, topLeft.y, bottomRight.x, bottomRight.y);
125
//}
126
//TEMPLATE void i64_rectangle::null() noexcept
127
//{
128
// ::null(this);
129
//}
130
//TEMPLATE void rect64copy(const ::i64_rectangle * pSrcRect) noexcept
131
//
132
//{
133
// ::copy(this, pSrcRect);
134
//}
135
//
136
//TEMPLATE bool i64_rectangle::is_equal(const ::i64_rectangle * RECT_TEMPLATE) const noexcept
137
//
138
//{
139
// return ::is_equal(this, RECT_TEMPLATE);
140
//}
141
//
142
//TEMPLATE void i64_rectangle::inflate(::i64 x, ::i64 y) noexcept
143
//{
144
// ::inflate(this, x, y);
145
//}
146
//TEMPLATE void i64_rectangle::inflate(::i64_size i64_size) noexcept
147
//{
148
// ::inflate(this, i64_size.cx, i64_size.cy);
149
//}
150
//TEMPLATE void i64_rectangle::deflate(::i64 x, ::i64 y) noexcept
151
//{
152
// ::inflate(this, -x, -y);
153
//}
154
//TEMPLATE void i64_rectangle::deflate(::i64_size i64_size) noexcept
155
//{
156
// ::inflate(this, -i64_size.cx, -i64_size.cy);
157
//}
158
//TEMPLATE void i64_rectangle::offset(::i64 x, ::i64 y) noexcept
159
//{
160
// ::offset(this, x, y);
161
//}
162
//TEMPLATE void i64_rectangle::offset(::i64_point i64_point) noexcept
163
//{
164
// ::offset(this, i64_point.x, i64_point.y);
165
//}
166
//TEMPLATE void i64_rectangle::set_size(::i64_size s) noexcept
167
//{
168
// this->set_size(s.cx, s.cy);
169
//}
170
//TEMPLATE void i64_rectangle::rsize(::i64_size s) noexcept
171
//{
172
// this->rsize(s.cx, s.cy);
173
//}
174
//TEMPLATE void i64_rectangle::set_size(::i64 cx, ::i64 cy) noexcept
175
//{
176
// ::resize(this, cx, cy);
177
//}
178
//TEMPLATE void i64_rectangle::rsize(::i64 cx, ::i64 cy) noexcept
179
//{
180
// ::reverse_size(this, cx, cy);
181
//}
182
//TEMPLATE void i64_rectangle::offset(::i64_size i64_size) noexcept
183
//{
184
// ::offset(this, i64_size.cx, i64_size.cy);
185
//}
186
//TEMPLATE void i64_rectangle::move_to_y(::i64 y) noexcept
187
//{
188
// bottom = height() + y; top = y;
189
//}
190
//TEMPLATE void i64_rectangle::move_to_x(::i64 x) noexcept
191
//{
192
// right = width() + x; left = x;
193
//}
194
//TEMPLATE void i64_rectangle::move_to(::i64 x, ::i64 y) noexcept
195
//{
196
// move_to_x(x); move_to_y(y);
197
//}
198
//TEMPLATE void i64_rectangle::move_to(::i64_point i32_point) noexcept
199
//{
200
// move_to_x(point.x); move_to_y(point.y);
201
//}
202
//TEMPLATE bool i64_rectangle::intersect(const ::i64_rectangle * rect1, const ::i64_rectangle * rect2) noexcept
203
//
204
//{
205
// return ::intersect(this, rect1, rect2);
206
//}
207
//
208
//TEMPLATE bool i64_rectangle::unite(const ::i64_rectangle * rect1, const ::i64_rectangle * rect2) noexcept
209
//
210
//{
211
// return ::unite(this, rect1, rect2);
212
//}
213
//
214
//TEMPLATE void i64_rectangle::operator=(const ::i64_rectangle & rectangleSource) noexcept
215
//{
216
// ::copy(this, &rectangleSource);
217
//}
218
//TEMPLATE bool i64_rectangle::operator==(const ::i64_rectangle & i64_rectangle) const noexcept
219
//{
220
// return ::is_equal(this, &i64_rectangle);
221
//}
222
//TEMPLATE bool i64_rectangle::operator!=(const ::i64_rectangle & i64_rectangle) const noexcept
223
//{
224
// return !::is_equal(this, &i64_rectangle);
225
//}
226
//TEMPLATE void i64_rectangle::operator +=(::i64_point i64_point) noexcept
227
//{
228
// ::offset(this, i64_point.x, i64_point.y);
229
//}
230
//TEMPLATE void i64_rectangle::operator +=(::i64_size i64_size) noexcept
231
//{
232
// ::offset(this, i64_size.cx, i64_size.cy);
233
//}
234
//TEMPLATE void i64_rectangle::operator +=(const ::i64_rectangle * RECT_TEMPLATE) noexcept
235
//
236
//{
237
// inflate(RECT_TEMPLATE);
238
//}
239
//
240
//TEMPLATE void i64_rectangle::operator-=(::i64_point i64_point) noexcept
241
//{
242
// ::offset(this, -i64_point.x, -i64_point.y);
243
//}
244
//TEMPLATE void i64_rectangle::operator-=(::i64_size i64_size) noexcept
245
//{
246
// ::offset(this, -i64_size.cx, -i64_size.cy);
247
//}
248
//TEMPLATE void i64_rectangle::operator-=(const ::i64_rectangle * RECT_TEMPLATE) noexcept
249
//
250
//{
251
// deflate(RECT_TEMPLATE);
252
//}
253
//
254
//TEMPLATE void i64_rectangle::operator&=(const ::i64_rectangle & i64_rectangle) noexcept
255
//{
256
// ::intersect(this, this, &i64_rectangle);
257
//}
258
//TEMPLATE void i64_rectangle::operator|=(const ::i64_rectangle & i64_rectangle) noexcept
259
//{
260
// ::unite(this, this, &i64_rectangle);
261
//}
262
//i64_rectangle i64_rectangle::operator +(::i64_point i32_point) const noexcept
263
//{
264
// i64_rectangle i64_rectangle(*this); ::offset(&i64_rectangle, point.x, point.y); return i64_rectangle;
265
//}
266
//i64_rectangle i64_rectangle::operator-(::i64_point i32_point) const noexcept
267
//{
268
// i64_rectangle i64_rectangle(*this); ::offset(&i64_rectangle, -point.x, -point.y); return i64_rectangle;
269
//}
270
//i64_rectangle i64_rectangle::operator +(::i64_size i64_size) const noexcept
271
//{
272
// i64_rectangle i64_rectangle(*this); ::offset(&i64_rectangle, i64_size.cx, i64_size.cy); return i64_rectangle;
273
//}
274
//i64_rectangle i64_rectangle::operator-(::i64_size i64_size) const noexcept
275
//{
276
// i64_rectangle i64_rectangle(*this); ::offset(&i64_rectangle, -i64_size.cx, -i64_size.cy); return i64_rectangle;
277
//}
278
//i64_rectangle i64_rectangle::operator +(const ::i64_rectangle * RECT_TEMPLATE) const noexcept
279
//
280
//{
281
// i64_rectangle i64_rectangle(this); i64_rectangle.inflate(RECT_TEMPLATE); return i64_rectangle;
282
//}
283
//
284
//i64_rectangle i64_rectangle::operator-(const ::i64_rectangle * RECT_TEMPLATE) const noexcept
285
//
286
//{
287
// i64_rectangle i64_rectangle(this); i64_rectangle.deflate(RECT_TEMPLATE); return i64_rectangle;
288
//}
289
//
290
//i64_rectangle i64_rectangle::operator&(const ::i64_rectangle & rect2) const noexcept
291
//{
292
// i64_rectangle i64_rectangle; ::intersect(&i64_rectangle, this, &rect2);
293
// return i64_rectangle;
294
//}
295
//i64_rectangle i64_rectangle::operator|(const ::i64_rectangle & rect2) const noexcept
296
//{
297
// i64_rectangle i64_rectangle; ::unite(&i64_rectangle, this, &rect2);
298
// return i64_rectangle;
299
//}
301
//
303
//
304
//
305
//TEMPLATE void i64_rectangle::normalize() noexcept
306
//{
307
// ::i64 nTemp;
308
// if (left > right)
309
// {
310
// nTemp = left;
311
// left = right;
312
// right = nTemp;
313
// }
314
// if (top > bottom)
315
// {
316
// nTemp = top;
317
// top = bottom;
318
// bottom = nTemp;
319
// }
320
//}
321
//
322
//TEMPLATE void i64_rectangle::inflate(const ::i64_rectangle * RECT_TEMPLATE) noexcept
323
//
324
//{
325
// left -= RECT_TEMPLATE.left; top -= RECT_TEMPLATE.top;
326
//
327
// right += RECT_TEMPLATE.right; bottom += RECT_TEMPLATE.bottom;
328
//
329
//}
330
//
331
//TEMPLATE void i64_rectangle::inflate(::i64 l, ::i64 t, ::i64 r, ::i64 b) noexcept
332
//{
333
// left -= l; top -= t;
334
// right += r; bottom += b;
335
//}
336
//
337
//TEMPLATE void i64_rectangle::deflate(const ::i64_rectangle * RECT_TEMPLATE) noexcept
338
//
339
//{
340
// left += RECT_TEMPLATE.left; top += RECT_TEMPLATE.top;
341
//
342
// right -= RECT_TEMPLATE.right; bottom -= RECT_TEMPLATE.bottom;
343
//
344
//}
345
//
346
//TEMPLATE void i64_rectangle::deflate(::i64 l, ::i64 t, ::i64 r, ::i64 b) noexcept
347
//{
348
// left += l; top += t;
349
// right -= r; bottom -= b;
350
//}
351
//
352
//i64_rectangle i64_rectangle::MulDiv(::i64 nMultiplier, ::i64 nDivisor) const noexcept
353
//{
354
// return i64_rectangle(
355
// ::MulDiv(left, nMultiplier, nDivisor),
356
// ::MulDiv(top, nMultiplier, nDivisor),
357
// ::MulDiv(right, nMultiplier, nDivisor),
358
// ::MulDiv(bottom, nMultiplier, nDivisor));
359
//}
360
//
361
//
362
//::i64 i64_rectangle::area() const
363
//{
364
//
365
// return size().area();
366
//
367
//}
368
//
369
//TEMPLATE ::f64 ::f64_rectangle::width() const noexcept { return right - left; }
370
//TEMPLATE ::f64 ::f64_rectangle::height() const noexcept { return bottom - top; }
371
//TEMPLATE class ::f64_size rectdSIZE_TYPE() const noexcept { return ::f64_size(width(), height()); }
372
//
373
//
374
//TEMPLATE void ::f64_rectangle::set_size(::f64 cx, ::f64 cy) noexcept { right = left + cx; bottom = top + cy; }
375
//TEMPLATE void ::f64_rectangle::set_size(const ::f64_size & size) noexcept { set_size(size.cx, size.cy); }
376
//TEMPLATE ::f64_point& ::f64_rectangle::top_left() noexcept { return *((::f64_point*)this); }
377
//TEMPLATE ::f64_point& ::f64_rectangle::bottom_right() noexcept { return *((::f64_point*)this + 1); }
378
//TEMPLATE const ::f64_point& ::f64_rectangle::top_left() const noexcept { return *((const ::f64_point*)this); }
379
//TEMPLATE const ::f64_point& ::f64_rectangle::bottom_right() const noexcept {
380
// return *((const ::f64_point*)this + 1);
381
// TEMPLATE void ::f64_rectangle::swap_left_right() noexcept { ::swap_left_right(this); }
382
//
383
// TEMPLATE ::f64_rectangle::operator ::f64_rectangle* () noexcept
384
// {
385
// return this;
386
// }
387
// TEMPLATE ::f64_rectangle::operator const ::f64_rectangle& () const noexcept
388
// {
389
// return (const ::f64_rectangle&)this;
390
// }
391
// TEMPLATE bool ::f64_rectangle::contains(::f64_point i32_point) const noexcept
392
// {
393
// return ::contains((const ::f64_rectangle&)this, i32_point) != false;
394
// }
395
// TEMPLATE void ::f64_rectangle::set(::f64 x1, ::f64 y1, ::f64 x2, ::f64 y2) noexcept
396
// {
397
// ::set_rect(this, x1, y1, x2, y2);
398
// }
399
// TEMPLATE void ::f64_rectangle::set(::f64_point topLeft, ::f64_point bottomRight) noexcept
400
// {
401
// ::set_rect(this, topLeft.x, topLeft.y, bottomRight.x, bottomRight.y);
402
// }
403
//
404
// TEMPLATE void ::f64_rectangle::null() noexcept
405
// {
406
//
407
// ::null(this);
408
//
409
// }
410
//
411
//
412
// TEMPLATE bool ::f64_rectangle::is_empty() const noexcept
413
// {
414
//
415
// return left == right && top == bottom;
416
//
417
// }
418
//
419
//
420
// TEMPLATE void rectdcopy(const ::f64_rectangle & pSrcRect) noexcept
421
//
422
// {
423
// ::copy(this, pSrcRect);
424
// }
425
//
426
// TEMPLATE bool ::f64_rectangle::is_equal(const ::f64_rectangle & RECT_TEMPLATE) const noexcept
427
//
428
// {
429
// return ::is_equal((const ::f64_rectangle&)this, RECT_TEMPLATE) != false;
430
// }
431
//
432
// TEMPLATE void ::f64_rectangle::inflate(::f64 x, ::f64 y) noexcept
433
// {
434
// ::inflate(this, x, y);
435
// }
436
// TEMPLATE void ::f64_rectangle::inflate(::f64_size i32_size) noexcept
437
// {
438
// ::inflate(this, size.cx, size.cy);
439
// }
440
// TEMPLATE void ::f64_rectangle::deflate(::f64 x, ::f64 y) noexcept
441
// {
442
// ::inflate(this, -x, -y);
443
// }
444
// TEMPLATE void ::f64_rectangle::deflate(::f64_size i32_size) noexcept
445
// {
446
// ::inflate(this, -size.cx, -size.cy);
447
// }
448
// TEMPLATE void ::f64_rectangle::offset(::f64 x, ::f64 y) noexcept
449
// {
450
// ::offset(this, x, y);
451
// }
452
// TEMPLATE void ::f64_rectangle::offset(::f64_point i32_point) noexcept
453
// {
454
// ::offset(this, point.x, point.y);
455
// }
456
// TEMPLATE void ::f64_rectangle::offset(::f64_size i32_size) noexcept
457
// {
458
// ::offset(this, size.cx, size.cy);
459
// }
460
// TEMPLATE void ::f64_rectangle::move_to_y(::f64 y) noexcept
461
// {
462
// bottom = height() + y; top = y;
463
// }
464
// TEMPLATE void ::f64_rectangle::move_to_x(::f64 x) noexcept
465
// {
466
// right = width() + x; left = x;
467
// }
468
// TEMPLATE void ::f64_rectangle::move_to(::f64 x, ::f64 y) noexcept
469
// {
470
// move_to_x(x); move_to_y(y);
471
// }
472
// TEMPLATE void ::f64_rectangle::move_to(::f64_point i32_point) noexcept
473
// {
474
// move_to_x(point.x); move_to_y(point.y);
475
// }
476
// //TEMPLATE bool ::f64_rectangle::intersect_x(const ::f64_rectangle & rect1, const ::f64_rectangle & rect2) noexcept
477
//
478
// //{
479
// // return ::x_intersect_rect(this, rect1, rect2) != false;
480
//
481
// //}
482
// //TEMPLATE bool ::f64_rectangle::intersect_y(const ::f64_rectangle & rect1, const ::f64_rectangle & rect2) noexcept
483
//
484
// //{
485
// // return ::y_intersect_rect(this, rect1, rect2) != false;
486
//
487
// //}
488
// TEMPLATE bool ::f64_rectangle::intersect(const ::f64_rectangle & rect1, const ::f64_rectangle & rect2) noexcept
489
//
490
// {
491
// return ::intersect(this, rect1, rect2) != false;
492
//
493
// }
494
// //::f64_rectangle ::f64_rectangle::intersect(const ::f64_rectangle & RECT_TEMPLATE) const noexcept
495
//
496
// //{
497
// // ::f64_rectangle RECT_TEMPLATE;
498
// // ::intersect(&RECT_TEMPLATE, this, RECT_TEMPLATE);
499
//
500
// // return RECT_TEMPLATE;
501
// //}
502
// TEMPLATE bool ::f64_rectangle::unite(const ::f64_rectangle & rect1, const ::f64_rectangle & rect2) noexcept
503
//
504
// {
505
// return ::unite(this, rect1, rect2) != false;
506
// }
507
//
508
// TEMPLATE void ::f64_rectangle::operator=(const ::f64_rectangle & rectectSrc) noexcept
509
// {
510
// ::copy(this, (const ::f64_rectangle&)& rectangleSource);
511
// }
512
// TEMPLATE bool ::f64_rectangle::operator==(const ::f64_rectangle & rectectd) const noexcept
513
// {
514
// return ::is_equal((const ::f64_rectangle&)this, (const ::f64_rectangle&)& ::f64_rectangle) != false;
515
// }
516
// TEMPLATE bool ::f64_rectangle::operator!=(const ::f64_rectangle & rectectd) const noexcept
517
// {
518
// return !::is_equal((const ::f64_rectangle&)this, (const ::f64_rectangle&)& ::f64_rectangle) != false;
519
// }
520
// TEMPLATE void ::f64_rectangle::operator +=(::f64_point i32_point) noexcept
521
// {
522
// ::offset(this, point.x, point.y);
523
// }
524
// TEMPLATE void ::f64_rectangle::operator +=(::f64_size i32_size) noexcept
525
// {
526
// ::offset(this, size.cx, size.cy);
527
// }
528
// TEMPLATE void ::f64_rectangle::operator +=(const ::f64_rectangle & RECT_TEMPLATE) noexcept
529
//
530
// {
531
// inflate(RECT_TEMPLATE);
532
// }
533
//
534
// TEMPLATE void ::f64_rectangle::operator-=(::f64_point i32_point) noexcept
535
// {
536
// ::offset(this, -point.x, -point.y);
537
// }
538
// TEMPLATE void ::f64_rectangle::operator-=(::f64_size i32_size) noexcept
539
// {
540
// ::offset(this, -size.cx, -size.cy);
541
// }
542
// TEMPLATE void ::f64_rectangle::operator-=(const ::f64_rectangle & RECT_TEMPLATE) noexcept
543
//
544
// {
545
// deflate(RECT_TEMPLATE);
546
// }
547
//
548
// TEMPLATE void ::f64_rectangle::operator&=(const ::f64_rectangle & rectectd) noexcept
549
// {
550
// ::intersect(this, this, (const ::f64_rectangle&)& ::f64_rectangle);
551
// }
552
// TEMPLATE void ::f64_rectangle::operator|=(const ::f64_rectangle & rectectd) noexcept
553
// {
554
// ::unite(this, this, (const ::f64_rectangle&)& ::f64_rectangle);
555
// }
556
// TEMPLATE ::f64_rectangle ::f64_rectangle::operator +(::f64_point i32_point) const noexcept
557
// {
558
// ::f64_rectangle ::f64_rectangle(*this); ::offset(&::f64_rectangle, point.x, point.y); return ::f64_rectangle;
559
// }
560
// TEMPLATE ::f64_rectangle ::f64_rectangle::operator-(::f64_point i32_point) const noexcept
561
// {
562
// ::f64_rectangle ::f64_rectangle(*this); ::offset(&::f64_rectangle, -point.x, -point.y); return ::f64_rectangle;
563
// }
564
// TEMPLATE ::f64_rectangle ::f64_rectangle::operator +(::f64_size i32_size) const noexcept
565
// {
566
// ::f64_rectangle ::f64_rectangle(*this); ::offset(&::f64_rectangle, size.cx, size.cy); return ::f64_rectangle;
567
// }
568
// TEMPLATE ::f64_rectangle ::f64_rectangle::operator-(::f64_size i32_size) const noexcept
569
// {
570
// ::f64_rectangle ::f64_rectangle(*this); ::offset(&::f64_rectangle, -size.cx, -size.cy); return ::f64_rectangle;
571
// }
572
// TEMPLATE ::f64_rectangle ::f64_rectangle::operator +(const ::f64_rectangle & RECT_TEMPLATE) const noexcept
573
//
574
// {
575
// ::f64_rectangle ::f64_rectangle((const ::f64_rectangle&)this); ::f64_rectangle.inflate(RECT_TEMPLATE); return ::f64_rectangle;
576
// }
577
//
578
// TEMPLATE ::f64_rectangle ::f64_rectangle::operator-(const ::f64_rectangle & RECT_TEMPLATE) const noexcept
579
//
580
// {
581
// ::f64_rectangle ::f64_rectangle((const ::f64_rectangle&)this); ::f64_rectangle.deflate(RECT_TEMPLATE); return ::f64_rectangle;
582
// }
583
//
584
// TEMPLATE ::f64_rectangle ::f64_rectangle::operator&(const ::f64_rectangle & rectect2) const noexcept
585
// {
586
// ::f64_rectangle ::f64_rectangle; ::intersect(&::f64_rectangle, (const ::f64_rectangle&)this, (const ::f64_rectangle&)& rect2);
587
// return ::f64_rectangle;
588
// }
589
// TEMPLATE ::f64_rectangle ::f64_rectangle::operator|(const ::f64_rectangle & rectect2) const noexcept
590
// {
591
// ::f64_rectangle ::f64_rectangle; ::unite(&::f64_rectangle, (const ::f64_rectangle&)this, (const ::f64_rectangle&)& rect2);
592
// return ::f64_rectangle;
593
// }
594
// //TEMPLATE bool ::f64_rectangle::subtract(const ::f64_rectangle & pRectSrc1, const ::f64_rectangle & lpRectSrc2) noexcept
595
//
596
// // { return ::subtract(this, pRectSrc1, lpRectSrc2) != false; }
597
//
598
//
599
// TEMPLATE void ::f64_rectangle::normalize() noexcept
600
// {
601
// ::f64 nTemp;
602
// if (left > right)
603
// {
604
// nTemp = left;
605
// left = right;
606
// right = nTemp;
607
// }
608
// if (top > bottom)
609
// {
610
// nTemp = top;
611
// top = bottom;
612
// bottom = nTemp;
613
// }
614
// }
615
//
616
// TEMPLATE void ::f64_rectangle::inflate(const ::f64_rectangle & RECT_TEMPLATE) noexcept
617
//
618
// {
619
// left -= RECT_TEMPLATE.left; top -= RECT_TEMPLATE.top;
620
//
621
// right += RECT_TEMPLATE.right; bottom += RECT_TEMPLATE.bottom;
622
//
623
// }
624
//
625
// TEMPLATE void ::f64_rectangle::inflate(::f64 l, ::f64 t, ::f64 r, ::f64 b) noexcept
626
// {
627
// left -= l; top -= t;
628
// right += r; bottom += b;
629
// }
630
//
631
// TEMPLATE void ::f64_rectangle::deflate(const ::f64_rectangle & RECT_TEMPLATE) noexcept
632
//
633
// {
634
// left += RECT_TEMPLATE.left; top += RECT_TEMPLATE.top;
635
//
636
// right -= RECT_TEMPLATE.right; bottom -= RECT_TEMPLATE.bottom;
637
//
638
// }
639
//
640
// TEMPLATE void ::f64_rectangle::deflate(::f64 l, ::f64 t, ::f64 r, ::f64 b) noexcept
641
// {
642
// left += l; top += t;
643
// right -= r; bottom -= b;
644
// }
645
//
646
// TEMPLATE ::f64_rectangle ::f64_rectangle::MulDiv(::f64 nMultiplier, ::f64 nDivisor) const noexcept
647
// {
648
// return ::f64_rectangle(left * nMultiplier / nDivisor,
649
// top * nMultiplier / nDivisor,
650
// right * nMultiplier / nDivisor,
651
// bottom * nMultiplier / nDivisor);
652
// }
653
//
654
// TEMPLATE ::f64 ::f64_rectangle::area()
655
// {
656
//
657
// return size().area();
658
//
659
// }
660
//
661
//
662
// TEMPLATE void ::f64_rectangle::get_bounding_box(const ::f64_point * ppoint, ::collection::count count)
663
//
664
// {
665
//
666
// f64_point_array::get_bounding_box(this, ppoint, count);
667
//
668
//
669
// }
670
//
671
// TEMPLATE void ::f64_rectangle::get_bounding_box(const f64_point_array & pointa)
672
// {
673
//
674
// pointa.get_bounding_box(this);
675
//
676
// }
677
//
678
// TEMPLATE void ::f64_rectangle::CenterOf(const ::f64_rectangle & RECT_TEMPLATE, ::f64_size i32_size)
679
//
680
// {
681
// ::f64 cx = size.cx;
682
// ::f64 cy = size.cy;
683
//
684
// ::f64 Δx = ::width(RECT_TEMPLATE);
685
//
686
// ::f64 Δy = ::height(RECT_TEMPLATE);
687
//
688
//
689
// left = RECT_TEMPLATE.left + (Δx - cx) / 2;
690
//
691
// top = RECT_TEMPLATE.top + (Δy - cy) / 2;
692
//
693
// right = left + cx;
694
// bottom = top + cy;
695
//
696
// }
697
//
698
// TEMPLATE void ::f64_rectangle::CenterOf(const ::f64_rectangle & RECT_TEMPLATE)
699
//
700
// {
701
//
702
// CenterOf(RECT_TEMPLATE, size());
703
//
704
//
705
// }
706
//
707
// TEMPLATE ::f64 ::f64_rectangle::minimum_signed_absolute_dimension(bool bNegativePreference) const noexcept
708
// {
709
//
710
// ::f64 w = width();
711
//
712
// ::f64 h = height();
713
//
714
// if (fabs(w) < fabs(h))
715
// {
716
//
717
// return w;
718
//
719
// }
720
// else if (fabs(h) < fabs(w))
721
// {
722
//
723
// return h;
724
//
725
// }
726
// else if (bNegativePreference) // absolutely equal, prefer negative ...
727
// {
728
//
729
// return minimum(w, h);
730
//
731
// }
732
// else // ... otherwise prefer positive
733
// {
734
//
735
// return maximum(w, h);
736
//
737
// }
738
//
739
//
740
// }
741
//
742
//
743
// ::f64 ::f64_rectangle::maximum_signed_absolute_dimension(bool bPositivePreference) const noexcept
744
// {
745
//
746
// ::f64 w = width();
747
//
748
// ::f64 h = height();
749
//
750
// if (fabs(w) > fabs(h))
751
// {
752
//
753
// return w;
754
//
755
// }
756
// else if (fabs(h) > fabs(w))
757
// {
758
//
759
// return h;
760
//
761
// }
762
// else if (bPositivePreference) // absolutely equal, prefer positive ...
763
// {
764
//
765
// return maximum(w, h);
766
//
767
// }
768
// else // ... otherwise prefer negative
769
// {
770
//
771
// return minimum(w, h);
772
//
773
// }
774
//
775
//
776
// }
777
//
778
//
779
//
780
// ::f64 ::f64_rectangle::minimum_absolute_dimension() const noexcept { return minimum(fabs(width()), fabs(height())); }
781
// ::f64 ::f64_rectangle::maximum_absolute_dimension() const noexcept { return minimum(fabs(width()), fabs(height())); }
782
// TEMPLATE bool ::f64_rectangle::contains_x(::f64 x) const noexcept
783
// {
784
// return left <= x && x <= right;
785
// }
786
// TEMPLATE bool ::f64_rectangle::contains_y(::f64 y) const noexcept
787
// {
788
// return top <= y && y <= bottom;
789
// }
790
//
791
//
792
// TEMPLATE ::f64_rectangle& ::f64_rectangle::intersect(const ::f64_rectangle & RECT_TEMPLATE) noexcept
793
//
794
// {
795
// ::intersect(this, this, RECT_TEMPLATE);
796
//
797
// return *this;
798
// }
799
//
800
//
801
// TEMPLATE ::f64_rectangle ::f64_rectangle::intersect(const ::f64_rectangle & RECT_TEMPLATE) const noexcept
802
//
803
// {
804
// ::f64_rectangle RECT_TEMPLATE;
805
// ::intersect(&RECT_TEMPLATE, this, RECT_TEMPLATE);
806
//
807
// return RECT_TEMPLATE;
808
// }
809
//
810
// TEMPLATE void ::f64_rectangle::set(::f64 d) noexcept
811
// {
812
//
813
// set(d, d, d, d);
814
//
815
// }
816
//
817
//
818
// TEMPLATE bool ::f64_rectangle::is_null() const noexcept
819
// {
820
//
821
// return left == 0.0 && right == 0.0 && top == 0.0 && bottom == 0.0;
822
//
823
// }
824
// TEMPLATE void ::f64_rectangle::offset_x(::f64 x) noexcept
825
// {
826
// left += x;
827
// right += x;
828
// }
829
//
830
//
831
// TEMPLATE void ::f64_rectangle::offset_y(::f64 y) noexcept
832
// {
833
// top += y;
834
// bottom += y;
835
// }
836
//
837
//
838
// TEMPLATE ::f64_point ::f64_rectangle::center() const noexcept
839
// {
840
//
841
// return ::f64_point((left + right) / 2.0, (top + bottom) / 2.0);
842
//
843
// }
844
//
845
//
846
// TEMPLATE ::f64_point ::f64_rectangle::top_right() const
847
// {
848
//
849
// return ::f64_point(right, top);
850
//
851
// }
852
//
853
// TEMPLATE ::f64_point ::f64_rectangle::bottom_left() const
854
// {
855
//
856
// return ::f64_point(left, bottom);
857
//
858
// }
859
//
860
//
861
// TEMPLATETEMPLATE void ::f64_rectangle::align_rate(::f64 x, ::f64 y, const ::f64_rectangle & RECT_TEMPLATE)
862
// {
863
//
864
// align_x(x, RECT_TEMPLATE);
865
//
866
// align_y(y, RECT_TEMPLATE);
867
//
868
// }
869
//
870
// TEMPLATETEMPLATE void ::f64_rectangle::align_x(::f64 dRate, const ::f64_rectangle & RECT_TEMPLATE)
871
// {
872
//
873
// UNIT_TYPE x;
874
//
875
// x = (UNIT_TYPE)(RECT_TEMPLATE.left + (RECT_TEMPLATE.right - RECT_TEMPLATE.left - width()) * ((dRate + 1.0) / 2.0));
876
//
877
// move_to_x(x);
878
//
879
// }
880
//
881
//
882
// TEMPLATETEMPLATE void ::f64_rectangle::align_y(::f64 dRate, const ::f64_rectangle & RECT_TEMPLATE)
883
// {
884
//
885
// UNIT_TYPE y;
886
//
887
// y = (UNIT_TYPE)(RECT_TEMPLATE.top + (RECT_TEMPLATE.bottom - RECT_TEMPLATE.top - height()) * ((dRate + 1.0) / 2.0));
888
//
889
// move_to_y(y);
890
//
891
// }
892
//
893
//
894
// TEMPLATETEMPLATE bool ::f64_rectangle::intersects(const ::f64_rectangle & RECT_TEMPLATE) const noexcept
895
//
896
// {
897
//
898
// return intersects_x(RECT_TEMPLATE) && intersects_y(RECT_TEMPLATE);
899
//
900
//
901
// }
902
//
903
//
904
// TEMPLATETEMPLATE bool ::f64_rectangle::intersects_x(const ::f64_rectangle & RECT_TEMPLATE) const noexcept
905
//
906
// {
907
// return (left >= RECT_TEMPLATE.left && left <= RECT_TEMPLATE.right) ||
908
//
909
// (right >= RECT_TEMPLATE.left && right <= RECT_TEMPLATE.right) ||
910
//
911
// (RECT_TEMPLATE.left >= left && RECT_TEMPLATE.left <= right) ||
912
//
913
// (RECT_TEMPLATE.right >= left && RECT_TEMPLATE.right <= right);
914
//
915
// }
916
//
917
// TEMPLATETEMPLATE bool ::f64_rectangle::intersects_y(const ::f64_rectangle & RECT_TEMPLATE) const noexcept
918
//
919
// {
920
// return (top >= RECT_TEMPLATE.top && top <= RECT_TEMPLATE.bottom) ||
921
//
922
// (bottom >= RECT_TEMPLATE.top && bottom <= RECT_TEMPLATE.bottom) ||
923
//
924
// (RECT_TEMPLATE.top >= top && RECT_TEMPLATE.top <= bottom) ||
925
//
926
// (RECT_TEMPLATE.bottom >= top && RECT_TEMPLATE.bottom <= bottom);
927
//
928
// }
929
//
930
//
931
//
932
933
934
935
936
//template < typename TARGET, typename SOURCE >
937
//inline TARGET * _001CopyRect(TARGET * prectTarget, const SOURCE * prectSource)
938
//{
939
//
940
// return _001SetRectDim(
941
// prectTarget,
942
// (decltype(::left(prectTarget))) ::left(prectSource),
943
// (decltype(::top(prectTarget))) ::top(prectSource),
944
// (decltype(::width(prectTarget))) ::width(prectSource),
945
// (decltype(::height(prectTarget))) ::height(prectSource));
946
//
947
//}
948
949
950
template
<
typename
BASE_TYPE,
typename
POINT_BASE_TYPE,
typename
SIZE_BASE_TYPE >
951
void
rectangle_type < BASE_TYPE, POINT_BASE_TYPE, SIZE_BASE_TYPE > ::get_bounding_box(
const
POINT_BASE_TYPE * ppoint, ::collection::count count)
952
{
953
954
::get_bounding_box(
this
, ppoint, count);
955
956
}
957
958
959
960
prototype
geometry2d
_aaa2025
aaa__rect_impl.h
Generated by
1.17.0