-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbsp_8hpp_source.html
255 lines (253 loc) · 31.4 KB
/
bsp_8hpp_source.html
1
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!-- HTML header for doxygen 1.9.5-->
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-772NXFFJ4E"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-772NXFFJ4E');
</script>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=11" />
<meta name="generator" content="Doxygen 1.9.5" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>libtcod: C:/Users/4b796/Projects/libtcod/src/libtcod/bsp.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript" src="doxygen-awesome-fragment-copy-button.js"></script>
<script type="text/javascript" src="doxygen-awesome-paragraph-link.js"></script>
<script type="text/javascript" src="doxygen-awesome-interactive-toc.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
DoxygenAwesomeFragmentCopyButton.init()
DoxygenAwesomeParagraphLink.init()
DoxygenAwesomeInteractiveToc.init()
</script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only-darkmode-toggle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top">
<!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">libtcod
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(document).ready(function(){initNavTree('bsp_8hpp_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">bsp.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="bsp_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">/* BSD 3-Clause License</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment"> *</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment"> * Copyright © 2008-2022, Jice and the libtcod contributors.</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment"> * All rights reserved.</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment"> *</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment"> * Redistribution and use in source and binary forms, with or without</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment"> * modification, are permitted provided that the following conditions are met:</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment"> *</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment"> * 1. Redistributions of source code must retain the above copyright notice,</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment"> * this list of conditions and the following disclaimer.</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment"> *</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright notice,</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment"> * this list of conditions and the following disclaimer in the documentation</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment"> * and/or other materials provided with the distribution.</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment"> *</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment"> * 3. Neither the name of the copyright holder nor the names of its</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment"> * contributors may be used to endorse or promote products derived from</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment"> * this software without specific prior written permission.</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment"> *</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment"> * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment"> * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment"> * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment"> * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment"> * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment"> * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment"> * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="comment"> * POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="comment"> */</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="comment">// clang-format off</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="preprocessor">#ifndef _TCOD_BSP_HPP</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="preprocessor">#define _TCOD_BSP_HPP</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="preprocessor">#include <utility></span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="preprocessor">#include "<a class="code" href="bsp_8h.html">bsp.h</a>"</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="preprocessor">#include "<a class="code" href="list_8hpp.html">list.hpp</a>"</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="preprocessor">#include "<a class="code" href="mersenne_8hpp.html">mersenne.hpp</a>"</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="preprocessor">#include "<a class="code" href="tree_8hpp.html">tree.hpp</a>"</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="keyword">class </span><a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="class_i_t_c_o_d_bsp_callback.html"> 50</a></span><span class="keyword">class </span>TCODLIB_API <a class="code hl_class" href="class_i_t_c_o_d_bsp_callback.html">ITCODBspCallback</a> {</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span>public :</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keyword">virtual</span> <a class="code hl_class" href="class_i_t_c_o_d_bsp_callback.html">~ITCODBspCallback</a>() {}</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> visitNode(<a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a> *node, <span class="keywordtype">void</span> *userData) = 0;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span>};</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="class_t_c_o_d_bsp.html"> 63</a></span><span class="keyword">class </span>TCODLIB_API <a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a> : <span class="keyword">public</span> <a class="code hl_class" href="class_t_c_o_d_tree.html">TCODTree</a> {</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span>public :</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordtype">int</span> x,y,w,h; <span class="comment">//</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">int</span> position; <span class="comment">// position of splitting</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordtype">bool</span> horizontal; <span class="comment">// horizontal splitting ?</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> uint8_t level; <span class="comment">// level in the tree</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="class_t_c_o_d_bsp.html#a3d9dd6efec6193d43067f3e054e39ab3"> 85</a></span> <a class="code hl_function" href="class_t_c_o_d_bsp.html#a3d9dd6efec6193d43067f3e054e39ab3">TCODBsp</a>() : level(0) {}</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>(<span class="keywordtype">int</span> x,<span class="keywordtype">int</span> y,<span class="keywordtype">int</span> w, <span class="keywordtype">int</span> h) : x(x),y(y),w(w),h(h),level(0) {}</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>(<span class="keyword">const</span> <a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>&) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>& operator=(<span class="keyword">const</span> <a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>&) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>(<a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>&& rhs) <span class="keyword">noexcept</span> { (*this) = std::move(rhs); };</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>& operator=(<a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>&& rhs) <span class="keyword">noexcept</span> {</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> std::swap(next, rhs.next);</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> std::swap(father, rhs.father);</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> std::swap(sons, rhs.sons);</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> };</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> </div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"><a class="line" href="class_t_c_o_d_bsp.html#a8942e17837013284425a0616ae04ad76"> 126</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_t_c_o_d_bsp.html#a8942e17837013284425a0616ae04ad76">removeSons</a>();</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"><a class="line" href="class_t_c_o_d_bsp.html#a620f60223047a5a1f36f976af90bc863"> 155</a></span> <span class="keyword">virtual</span> <a class="code hl_function" href="class_t_c_o_d_bsp.html#a620f60223047a5a1f36f976af90bc863">~TCODBsp</a>();</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> </div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"><a class="line" href="class_t_c_o_d_bsp.html#a6b6221bf79a1d0aa2275fa2e04b751b1"> 182</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_t_c_o_d_bsp.html#a6b6221bf79a1d0aa2275fa2e04b751b1">splitOnce</a>(<span class="keywordtype">bool</span> horizontal, <span class="keywordtype">int</span> position);</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> </div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"><a class="line" href="class_t_c_o_d_bsp.html#ac45a60808aa2f17d138cb10744b65ab2"> 208</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_t_c_o_d_bsp.html#ac45a60808aa2f17d138cb10744b65ab2">splitRecursive</a>(<a class="code hl_class" href="class_t_c_o_d_random.html">TCODRandom</a> *randomizer, <span class="keywordtype">int</span> nb, <span class="keywordtype">int</span> minHSize, <span class="keywordtype">int</span> minVSize, <span class="keywordtype">float</span> maxHRatio, <span class="keywordtype">float</span> maxVRatio);</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> </div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"><a class="line" href="class_t_c_o_d_bsp.html#a4e1a2884ecf106f784f98a4525c65f08"> 239</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_t_c_o_d_bsp.html#a4e1a2884ecf106f784f98a4525c65f08">resize</a>(<span class="keywordtype">int</span> x,<span class="keywordtype">int</span> y, <span class="keywordtype">int</span> w, <span class="keywordtype">int</span> h);</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> </div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"><a class="line" href="class_t_c_o_d_bsp.html#a934a1ad8d407a365c93ecb21c4161f32"> 302</a></span> <a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a> *<a class="code hl_function" href="class_t_c_o_d_bsp.html#a934a1ad8d407a365c93ecb21c4161f32">getLeft</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>*<span class="keyword">></span>(sons);</div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> }</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> <a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a> *getRight()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> <span class="keywordflow">return</span> sons ? <span class="keyword">static_cast<</span><a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>*<span class="keyword">></span>(sons->next) : NULL;</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> }</div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> <a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a> *getFather()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>*<span class="keyword">></span>(father);</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> }</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> </div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"><a class="line" href="class_t_c_o_d_bsp.html#a6f4f880bbc5b70b7fade114deb6c05be"> 321</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="class_t_c_o_d_bsp.html#a6f4f880bbc5b70b7fade114deb6c05be">isLeaf</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> sons == NULL ; }</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> </div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"><a class="line" href="class_t_c_o_d_bsp.html#af1360cc43a7d5cd21a0bcacbfa119f89"> 334</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="class_t_c_o_d_bsp.html#af1360cc43a7d5cd21a0bcacbfa119f89">contains</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> </div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno"><a class="line" href="class_t_c_o_d_bsp.html#a25504bfc4750a5b3a1e9dd9cdb0e0b58"> 347</a></span> <a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a> *<a class="code hl_function" href="class_t_c_o_d_bsp.html#a25504bfc4750a5b3a1e9dd9cdb0e0b58">findNode</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y);</div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno"> 348</span> </div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno"><a class="line" href="class_t_c_o_d_bsp.html#a781ae46ca99abb56b9e5d0a6bc4113ca"> 423</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="class_t_c_o_d_bsp.html#a781ae46ca99abb56b9e5d0a6bc4113ca">traversePreOrder</a>(<a class="code hl_class" href="class_i_t_c_o_d_bsp_callback.html">ITCODBspCallback</a> *listener, <span class="keywordtype">void</span> *userData);</div>
<div class="line"><a id="l00424" name="l00424"></a><span class="lineno"> 424</span> <span class="keywordtype">bool</span> traverseInOrder(<a class="code hl_class" href="class_i_t_c_o_d_bsp_callback.html">ITCODBspCallback</a> *listener, <span class="keywordtype">void</span> *userData);</div>
<div class="line"><a id="l00425" name="l00425"></a><span class="lineno"> 425</span> <span class="keywordtype">bool</span> traversePostOrder(<a class="code hl_class" href="class_i_t_c_o_d_bsp_callback.html">ITCODBspCallback</a> *listener, <span class="keywordtype">void</span> *userData);</div>
<div class="line"><a id="l00426" name="l00426"></a><span class="lineno"> 426</span> <span class="keywordtype">bool</span> traverseLevelOrder(<a class="code hl_class" href="class_i_t_c_o_d_bsp_callback.html">ITCODBspCallback</a> *listener, <span class="keywordtype">void</span> *userData);</div>
<div class="line"><a id="l00427" name="l00427"></a><span class="lineno"> 427</span> <span class="keywordtype">bool</span> traverseInvertedLevelOrder(<a class="code hl_class" href="class_i_t_c_o_d_bsp_callback.html">ITCODBspCallback</a> *listener, <span class="keywordtype">void</span> *userData);</div>
<div class="line"><a id="l00428" name="l00428"></a><span class="lineno"> 428</span>protected :</div>
<div class="line"><a id="l00429" name="l00429"></a><span class="lineno"> 429</span> <a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a>(<a class="code hl_class" href="class_t_c_o_d_bsp.html">TCODBsp</a> *father, <span class="keywordtype">bool</span> left);</div>
<div class="line"><a id="l00430" name="l00430"></a><span class="lineno"> 430</span> </div>
<div class="line"><a id="l00431" name="l00431"></a><span class="lineno"> 431</span>};</div>
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno"> 433</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="absp_8h_html"><div class="ttname"><a href="bsp_8h.html">bsp.h</a></div><div class="ttdoc">Binary space partitioning module.</div></div>
<div class="ttc" id="aclass_i_t_c_o_d_bsp_callback_html"><div class="ttname"><a href="class_i_t_c_o_d_bsp_callback.html">ITCODBspCallback</a></div><div class="ttdef"><b>Definition:</b> bsp.hpp:50</div></div>
<div class="ttc" id="aclass_t_c_o_d_bsp_html"><div class="ttname"><a href="class_t_c_o_d_bsp.html">TCODBsp</a></div><div class="ttdef"><b>Definition:</b> bsp.hpp:63</div></div>
<div class="ttc" id="aclass_t_c_o_d_bsp_html_a25504bfc4750a5b3a1e9dd9cdb0e0b58"><div class="ttname"><a href="class_t_c_o_d_bsp.html#a25504bfc4750a5b3a1e9dd9cdb0e0b58">TCODBsp::findNode</a></div><div class="ttdeci">TCODBsp * findNode(int x, int y)</div><div class="ttdoc">You can search the tree for the smallest node containing a map cell.</div></div>
<div class="ttc" id="aclass_t_c_o_d_bsp_html_a3d9dd6efec6193d43067f3e054e39ab3"><div class="ttname"><a href="class_t_c_o_d_bsp.html#a3d9dd6efec6193d43067f3e054e39ab3">TCODBsp::TCODBsp</a></div><div class="ttdeci">TCODBsp()</div><div class="ttdoc">First, you have to create the root node of the tree.</div><div class="ttdef"><b>Definition:</b> bsp.hpp:85</div></div>
<div class="ttc" id="aclass_t_c_o_d_bsp_html_a4e1a2884ecf106f784f98a4525c65f08"><div class="ttname"><a href="class_t_c_o_d_bsp.html#a4e1a2884ecf106f784f98a4525c65f08">TCODBsp::resize</a></div><div class="ttdeci">void resize(int x, int y, int w, int h)</div><div class="ttdoc">This operation resets the size of the tree nodes without changing the splitting data (orientation/pos...</div></div>
<div class="ttc" id="aclass_t_c_o_d_bsp_html_a620f60223047a5a1f36f976af90bc863"><div class="ttname"><a href="class_t_c_o_d_bsp.html#a620f60223047a5a1f36f976af90bc863">TCODBsp::~TCODBsp</a></div><div class="ttdeci">virtual ~TCODBsp()</div><div class="ttdoc">You can also completely delete the tree, including the root node to release every resource used :</div></div>
<div class="ttc" id="aclass_t_c_o_d_bsp_html_a6b6221bf79a1d0aa2275fa2e04b751b1"><div class="ttname"><a href="class_t_c_o_d_bsp.html#a6b6221bf79a1d0aa2275fa2e04b751b1">TCODBsp::splitOnce</a></div><div class="ttdeci">void splitOnce(bool horizontal, int position)</div><div class="ttdoc">Once you have the root node, you can split it into two smaller non-overlapping nodes.</div></div>
<div class="ttc" id="aclass_t_c_o_d_bsp_html_a6f4f880bbc5b70b7fade114deb6c05be"><div class="ttname"><a href="class_t_c_o_d_bsp.html#a6f4f880bbc5b70b7fade114deb6c05be">TCODBsp::isLeaf</a></div><div class="ttdeci">bool isLeaf() const</div><div class="ttdoc">You can know if a node is a leaf (not split, no sons) with this function :</div><div class="ttdef"><b>Definition:</b> bsp.hpp:321</div></div>
<div class="ttc" id="aclass_t_c_o_d_bsp_html_a781ae46ca99abb56b9e5d0a6bc4113ca"><div class="ttname"><a href="class_t_c_o_d_bsp.html#a781ae46ca99abb56b9e5d0a6bc4113ca">TCODBsp::traversePreOrder</a></div><div class="ttdeci">bool traversePreOrder(ITCODBspCallback *listener, void *userData)</div><div class="ttdoc">You can scan all the nodes of the tree and have a custom function called back for each node.</div></div>
<div class="ttc" id="aclass_t_c_o_d_bsp_html_a8942e17837013284425a0616ae04ad76"><div class="ttname"><a href="class_t_c_o_d_bsp.html#a8942e17837013284425a0616ae04ad76">TCODBsp::removeSons</a></div><div class="ttdeci">void removeSons()</div><div class="ttdoc">You can delete a part of the tree, releasing resources for all sub nodes with :</div></div>
<div class="ttc" id="aclass_t_c_o_d_bsp_html_a934a1ad8d407a365c93ecb21c4161f32"><div class="ttname"><a href="class_t_c_o_d_bsp.html#a934a1ad8d407a365c93ecb21c4161f32">TCODBsp::getLeft</a></div><div class="ttdeci">TCODBsp * getLeft() const</div><div class="ttdoc">Once you have built a BSP tree, you can retrieve information from any node.</div><div class="ttdef"><b>Definition:</b> bsp.hpp:302</div></div>
<div class="ttc" id="aclass_t_c_o_d_bsp_html_ac45a60808aa2f17d138cb10744b65ab2"><div class="ttname"><a href="class_t_c_o_d_bsp.html#ac45a60808aa2f17d138cb10744b65ab2">TCODBsp::splitRecursive</a></div><div class="ttdeci">void splitRecursive(TCODRandom *randomizer, int nb, int minHSize, int minVSize, float maxHRatio, float maxVRatio)</div><div class="ttdoc">You can also recursively split the bsp.</div></div>
<div class="ttc" id="aclass_t_c_o_d_bsp_html_af1360cc43a7d5cd21a0bcacbfa119f89"><div class="ttname"><a href="class_t_c_o_d_bsp.html#af1360cc43a7d5cd21a0bcacbfa119f89">TCODBsp::contains</a></div><div class="ttdeci">bool contains(int x, int y) const</div><div class="ttdoc">You can check if a map cell is inside a node.</div></div>
<div class="ttc" id="aclass_t_c_o_d_random_html"><div class="ttname"><a href="class_t_c_o_d_random.html">TCODRandom</a></div><div class="ttdef"><b>Definition:</b> mersenne.hpp:94</div></div>
<div class="ttc" id="aclass_t_c_o_d_tree_html"><div class="ttname"><a href="class_t_c_o_d_tree.html">TCODTree</a></div><div class="ttdef"><b>Definition:</b> tree.hpp:40</div></div>
<div class="ttc" id="alist_8hpp_html"><div class="ttname"><a href="list_8hpp.html">list.hpp</a></div><div class="ttdoc">Deprecated TCODList class.</div></div>
<div class="ttc" id="amersenne_8hpp_html"><div class="ttname"><a href="mersenne_8hpp.html">mersenne.hpp</a></div><div class="ttdoc">Random number generator C++ module.</div></div>
<div class="ttc" id="atree_8hpp_html"><div class="ttname"><a href="tree_8hpp.html">tree.hpp</a></div><div class="ttdoc">Internal tree container.</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_1cd790847955b0ed5b8c016a80c66328.html">libtcod</a></li><li class="navelem"><a class="el" href="bsp_8hpp.html">bsp.hpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5 </li>
</ul>
</div>
</body>
</html>