acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
region.h
1// From aura/graphics/draw2d/region by camilo on 2023-05-26 13:51 <3ThomasBorregaardSorensen!!
2#pragma once
3
4
5//#include "_geometry2d.h"
6#include "_collection.h"
7
8
9
10namespace geometry2d
11{
12
13
14 class CLASS_DECL_ACME region :
15 virtual public ::particle
16 {
17 public:
18
19
20 //class CLASS_DECL_ACME item :
21 // virtual public ::particle
22 //{
23 //public:
24
25 // virtual void translate(const ::i32_point & point);
26 // virtual void expand_bounding_box(::f64_rectangle & rectangle);
27 // virtual bool internal_contains(const ::f64_point & p);
28
29 //};
30
31
32 //class CLASS_DECL_ACME rectangle_item :
33 // virtual public item
34 //{
35 //public:
36
37 // ::f64_rectangle m_rectangle;
38
39 // void translate(const ::i32_point & point) override;
40 // void expand_bounding_box(::f64_rectangle & rectangle) override;
41 // bool internal_contains(const ::f64_point & p) override;
42
43 //};
44
45 //class CLASS_DECL_ACME ellipse_item :
46 // virtual public item
47 //{
48 //public:
49
50
51 // ::f64_rectangle m_rectangle;
52
53 // void translate(const ::i32_point & point) override;
54 // void expand_bounding_box(::f64_rectangle & rectangle) override;
55 // bool internal_contains(const ::f64_point & p) override;
56
57
58
59 //};
60
61 //class CLASS_DECL_ACME polygon_item :
62 // virtual public item
63 //{
64 //public:
65
66 // ::f64_polygon m_polygon;
67 // ::draw2d::enum_fill_mode m_efillmode;
68
69
70 // void translate(const ::i32_point & point) override;
71 // void expand_bounding_box(::f64_rectangle & rectangle) override;
72 // bool internal_contains(const ::f64_point & p) override;
73
74
75 //};
76
77
78 //class CLASS_DECL_ACME poly_polygon_item :
79 // virtual public item
80 //{
81 //public:
82
83 // pointer_array < ::f64_polygon > m_polygona;
84 // ::draw2d::enum_fill_mode m_efillmode;
85
86 // void translate(const ::i32_point & point) override;
87 // void expand_bounding_box(::f64_rectangle & rectangle) override;
88 // bool internal_contains(const ::f64_point & p) override;
89
90
91 //};
92
93 //class CLASS_DECL_ACME combine_item :
94 // virtual public item
95 //{
96 //public:
97
98 // pointer_array < ::f64_polygon > m_polygon;
99
100 // ::pointer<::geometry2d::region> m_pregion1;
101 // ::pointer<::geometry2d::region> m_pregion2;
102 // ::draw2d::enum_combine m_ecombine;
103
104 // void translate(const ::i32_point & point) override;
105 // void expand_bounding_box(::f64_rectangle & rectangle) override;
106 // bool internal_contains(const ::f64_point & p) override;
107
108
109
110 //};
111
112
113 //class CLASS_DECL_ACME round_rectangle_item :
114 // virtual public item
115 //{
116 //public:
117
118
119 // ::f64_rectangle m_rectangle;
120 // ::f64_size m_sizeRadius;
121
122
123 // void translate(const ::i32_point & point) override;
124 // void expand_bounding_box(::f64_rectangle & rectangle) override;
125 // bool internal_contains(const ::f64_point & p) override;
126
127 //};
128
129
130 ::pointer<item> m_pitem;
131
132 ::i32_point m_pointOffset;
133
134
135 region();
136 region(const region & region);
137 ~region() override;
138
139
140 //virtual void destroy() override;
141
142
143 region & operator = (const region & regionSrc);
144
145
146 virtual bool create_rectangle(const ::f64_rectangle & rectangle);
147
148 virtual bool create_ellipse(const ::f64_ellipse & ellipse);
149
150 virtual bool create_polygon(const ::i32_point * pPoints, ::i32 nCount, ::draw2d::enum_fill_mode efillmode = ::draw2d::e_fill_mode_winding);
151
152 virtual bool create_polygon(const ::f64_point * pPoints, ::i32 nCount, ::draw2d::enum_fill_mode efillmode = ::draw2d::e_fill_mode_winding);
153
154 virtual bool create_polygon(const f64_polygon & polygon, ::draw2d::enum_fill_mode efillmode = ::draw2d::e_fill_mode_winding);
155
156 virtual bool create_poly_polygon(const ::f64_point * pPoints, const ::i32 * lpPolyCounts, ::i32 nCount, ::draw2d::enum_fill_mode efillmode);
157
158 virtual bool create_poly_polygon(const ::i32_point * pPoints, const ::i32 * lpPolyCounts, ::i32 nCount, ::draw2d::enum_fill_mode efillmode);
159
160 virtual bool create_poly_polygon(const f64_poly_polygon & polygon, ::draw2d::enum_fill_mode efillmode = ::draw2d::e_fill_mode_winding);
161
162
163 virtual bool combine(const ::geometry2d::region * prgn1, const ::geometry2d::region * prgn2, ::draw2d::enum_combine ecombine);
164 virtual bool translate(const ::f64_point & point);
165 virtual bool get_bounding_box(::f64_rectangle & rectangle);
166
167
168
169 //virtual bool contains(const ::i32_point & point);
170 virtual bool contains(const ::f64_point & point);
171
172
173 bool internal_contains(const ::f64_point & point);
174
175 bool internal_rectangle_contains(const ::f64_point & point);
176
177 bool internal_ellipse_contains(const ::f64_point & point);
178
179 bool internal_polygon_contains(const ::f64_point & point);
180
181 bool internal_poly_polygon_contains(const ::f64_point & point);
182
183 bool internal_combine_contains(const ::f64_point & point);
184
185
186
187 //bool internal_contains(const ::f64_point & point);
188
189
190
191 //virtual void expand_bounding_box(::i32_rectangle & rectangle);
192
193
194
195 virtual void expand_bounding_box(::f64_rectangle & rectangle);
196
197
198
199 };
200
201
202} // namespace geometry2d
203
204
205