acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
_aaa_defer_shape.h
1// From _defer.h by camilo on 2022-06-28 21:20 <3ThomasBorregaardSorensen!! (Mummi and bilbo in ca2HQ)
2#pragma once
3
4
5template < typename SHAPE, enum_shape ESHAPE, typename HOLDEE >
6inline bool _shape < SHAPE, ESHAPE, HOLDEE >::get_bounding_box(::i32_rectangle & rectangle) const
7{
8
9 return ::get_bounding_box(rectangle, m_shape);
10
11}
12
13
14template < typename SHAPE, enum_shape ESHAPE, typename HOLDEE >
15inline bool _shape < SHAPE, ESHAPE, HOLDEE >::get_bounding_box(::f64_rectangle & rectangle) const
16{
17
18 return ::get_bounding_box(rectangle, m_shape);
19
20}
21
22
23template < typename SHAPE, enum_shape ESHAPE, typename HOLDEE >
24bool _shape < SHAPE, ESHAPE, HOLDEE >::expand_bounding_rect(::f64_rectangle & rectangle) const
25{
26
27 ::f64_rectangle r;
28
29 if (!this->get_bounding_box(r))
30 {
31
32 return false;
33
34 }
35
36 ::unite(rectangle, r);
37
38 return true;
39
40}
41
42
43template < typename SHAPE, enum_shape ESHAPE, typename HOLDEE >
44bool _shape < SHAPE, ESHAPE, HOLDEE >::expand_bounding_rect(::i32_rectangle & rectangle) const
45{
46
47 ::i32_rectangle r;
48
49 if (!this->get_bounding_box(r))
50 {
51
52 return false;
53
54 }
55
56 ::unite(rectangle, r);
57
58 return true;
59
60}
61
62
63template < typename SHAPE, enum_shape ESHAPE, typename HOLDEE >
64inline bool _shape < SHAPE, ESHAPE, HOLDEE >::contains(const ::i32_point & point) const
65{
66
67 return ::shape_contains(m_shape, point);
68
69}
70
71
72template < typename SHAPE, enum_shape ESHAPE, typename HOLDEE >
73inline bool _shape < SHAPE, ESHAPE, HOLDEE >::contains(const ::f64_point & point) const
74{
75
76 return ::shape_contains(m_shape, point);
77
78}
79
80
81template < typename HOLDEE >
82template < typename GEOMETRY >
83inline void shape_array < HOLDEE >::add_shape(const GEOMETRY & geometry)
84{
85
86 this->add(__create_shape(geometry, holdee < HOLDEE >()));
87
88}
89
90