aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a02498.html
blob: f8de5cc1763dcdb5ea64767cadf007082aae8b5f (plain)
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>NeL: NLPACS::CFaceGrid::CFaceGridBuild class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex">  <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a>  | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NLPACS::CFaceGrid::CFaceGridBuild Class Reference</h1><code>#include &lt;<a class="el" href="a05694.html">face_grid.h</a>&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A temporary grid, used to create a static <a class="el" href="a02497.html">CFaceGrid</a> object. <dl compact><dt><b>Author:</b></dt><dd>Benjamin Legros <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2001</dd></dl>

<p>

<p>
Definition at line <a class="el" href="a05694.html#l00066">66</a> of file <a class="el" href="a05694.html">face_grid.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuilda0">init</a> (<a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a632">width</a>, float elsize)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Init an empty build object with width and size.  <a href="#NLPACS_1_1CFaceGrid_1_1CFaceGridBuilda0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuilda1">insert</a> (const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;bmin, const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;bmax, <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a04223.html#a658">value</a>)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Insert a value in the grid.  <a href="#NLPACS_1_1CFaceGrid_1_1CFaceGridBuilda1"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Data Fields</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; std::vector&lt;<br>
 <a class="el" href="a04558.html#a11">uint32</a> &gt; &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo0">Grid</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The grid.  <a href="#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo1">Size</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The size of each element.  <a href="#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The width, in number of rows and lines of the grid.  <a href="#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2"></a><br><br></td></tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NLPACS_1_1CFaceGrid_1_1CFaceGridBuilda0" doxytag="NLPACS::CFaceGrid::CFaceGridBuild::init" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NLPACS::CFaceGrid::CFaceGridBuild::init </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>width</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>elsize</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Init an empty build object with width and size. 
<p>

<p>
Definition at line <a class="el" href="a05694.html#l00187">187</a> of file <a class="el" href="a05694.html">face_grid.h</a>.
<p>
References <a class="el" href="a05694.html#l00070">Grid</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05646.html#l01013">width</a>.
<p>
Referenced by <a class="el" href="a05929.html#l01393">NLPACS::CLocalRetriever::initFaceGrid()</a>.
<p>
<div class="fragment"><pre>00188 {
00189         <a class="code" href="a04199.html#a6">nlassert</a>(NLMISC::isPowerOf2(width));
00190         <a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a> = <a class="code" href="a04223.html#a632">width</a>;
00191         <a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo1">Size</a> = elsize;
00192         <a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo0">Grid</a>.clear();
00193         <a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo0">Grid</a>.resize(Width*Width);
00194 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLPACS_1_1CFaceGrid_1_1CFaceGridBuilda1" doxytag="NLPACS::CFaceGrid::CFaceGridBuild::insert" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NLPACS::CFaceGrid::CFaceGridBuild::insert </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>bmin</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>bmax</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a11">uint32</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>value</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Insert a value in the grid. 
<p>

<p>
Definition at line <a class="el" href="a05694.html#l00196">196</a> of file <a class="el" href="a05694.html">face_grid.h</a>.
<p>
References <a class="el" href="a05694.html#l00070">Grid</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00100">uint32</a>, <a class="el" href="a05646.html#l01132">value</a>, <a class="el" href="a05646.html#l00236">x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a05646.html#l00236">y</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>.
<p>
Referenced by <a class="el" href="a05929.html#l01393">NLPACS::CLocalRetriever::initFaceGrid()</a>.
<p>
<div class="fragment"><pre>00199 {
00200         <a class="code" href="a04558.html#a14">sint</a>    x0 = (<a class="code" href="a04558.html#a14">sint</a>)(bmin.<a class="code" href="a03128.html#NLMISC_1_1CVectoro0">x</a>/<a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo1">Size</a>),
00201                         x1 = (<a class="code" href="a04558.html#a14">sint</a>)(bmax.<a class="code" href="a03128.html#NLMISC_1_1CVectoro0">x</a>/<a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo1">Size</a>),
00202                         y0 = (<a class="code" href="a04558.html#a14">sint</a>)(bmin.<a class="code" href="a03128.html#NLMISC_1_1CVectoro1">y</a>/<a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo1">Size</a>),
00203                         y1 = (<a class="code" href="a04558.html#a14">sint</a>)(bmax.<a class="code" href="a03128.html#NLMISC_1_1CVectoro1">y</a>/<a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo1">Size</a>);
00204 
00205         <span class="keywordflow">if</span> (x1-x0 &gt;= (<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a>)
00206         {
00207                 x0 = 0;
00208                 x1 = <a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a>-1;
00209         }
00210         <span class="keywordflow">else</span>
00211         {
00212                 x0 &amp;= (<a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a>-1);
00213                 x1 &amp;= (<a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a>-1);
00214                 <span class="keywordflow">if</span> (x1 &lt; x0)
00215                         x1 += <a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a>;
00216         }
00217 
00218         <span class="keywordflow">if</span> (y1-y0 &gt;= (<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a>)
00219         {
00220                 y0 = 0;
00221                 y1 = <a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a>-1;
00222         }
00223         <span class="keywordflow">else</span>
00224         {
00225                 y0 &amp;= (<a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a>-1);
00226                 y1 &amp;= (<a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a>-1);
00227                 <span class="keywordflow">if</span> (y1 &lt; y0)
00228                         y1 += <a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a>;
00229         }
00230 
00231         <a class="code" href="a04558.html#a14">sint</a>    <a class="code" href="a04223.html#a572">x</a>, <a class="code" href="a04223.html#a573">y</a>;
00232 
00233         <span class="keywordflow">for</span> (<a class="code" href="a04223.html#a573">y</a>=y0; <a class="code" href="a04223.html#a573">y</a>&lt;=y1; ++<a class="code" href="a04223.html#a573">y</a>)
00234                 <span class="keywordflow">for</span> (<a class="code" href="a04223.html#a572">x</a>=x0; <a class="code" href="a04223.html#a572">x</a>&lt;=x1; ++<a class="code" href="a04223.html#a572">x</a>)
00235                         <a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo0">Grid</a>[(<a class="code" href="a04223.html#a572">x</a>&amp;(<a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a>-1))+(<a class="code" href="a04223.html#a573">y</a>&amp;(<a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a>-1))*<a class="code" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">Width</a>].push_back(value);
00236 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo0" doxytag="NLPACS::CFaceGrid::CFaceGridBuild::Grid" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> std::vector&lt; std::vector&lt;<a class="el" href="a04558.html#a11">uint32</a>&gt; &gt; <a class="el" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo0">NLPACS::CFaceGrid::CFaceGridBuild::Grid</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The grid. 
<p>

<p>
Definition at line <a class="el" href="a05694.html#l00070">70</a> of file <a class="el" href="a05694.html">face_grid.h</a>.
<p>
Referenced by <a class="el" href="a05694.html#l00129">NLPACS::CFaceGrid::create()</a>, <a class="el" href="a05694.html#l00187">init()</a>, and <a class="el" href="a05694.html#l00196">insert()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo1" doxytag="NLPACS::CFaceGrid::CFaceGridBuild::Size" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> float <a class="el" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo1">NLPACS::CFaceGrid::CFaceGridBuild::Size</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The size of each element. 
<p>

<p>
Definition at line <a class="el" href="a05694.html#l00076">76</a> of file <a class="el" href="a05694.html">face_grid.h</a>.
<p>
Referenced by <a class="el" href="a05694.html#l00129">NLPACS::CFaceGrid::create()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2" doxytag="NLPACS::CFaceGrid::CFaceGridBuild::Width" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a02498.html#NLPACS_1_1CFaceGrid_1_1CFaceGridBuildo2">NLPACS::CFaceGrid::CFaceGridBuild::Width</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The width, in number of rows and lines of the grid. 
<p>

<p>
Definition at line <a class="el" href="a05694.html#l00073">73</a> of file <a class="el" href="a05694.html">face_grid.h</a>.
<p>
Referenced by <a class="el" href="a05694.html#l00129">NLPACS::CFaceGrid::create()</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="a05694.html">face_grid.h</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 14:13:23 2004 for NeL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.6 </small></address>
</body>
</html>