File: v-sim-surfaces-points.html

package info (click to toggle)
v-sim 3.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 15,860 kB
  • sloc: ansic: 75,222; sh: 10,239; makefile: 580; python: 572; cpp: 353; xml: 130
file content (337 lines) | stat: -rw-r--r-- 17,412 bytes parent folder | download
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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>surfaces_points</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="V_Sim API - Reference Manual">
<link rel="up" href="ch06.html" title="Extra functionalities">
<link rel="prev" href="v-sim-surfaces.html" title="surfaces">
<link rel="next" href="v-sim-surfaces-resources.html" title="surfaces_resources">
<meta name="generator" content="GTK-Doc V1.14 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="v-sim-surfaces.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch06.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">V_Sim API - Reference Manual</th>
<td><a accesskey="n" href="v-sim-surfaces-resources.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#v-sim-surfaces-points.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#v-sim-surfaces-points.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="surfaces_points">
<a name="v-sim-surfaces-points"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="v-sim-surfaces-points.top_of_page"></a>surfaces_points</span></h2>
<p>surfaces_points — Define a structure to store a set of triangles
defining a surface.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="v-sim-surfaces-points.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">#define             <a class="link" href="v-sim-surfaces-points.html#SurfacesPoints-normalOffset" title="SurfacesPoints_normalOffset">SurfacesPoints_normalOffset</a>
#define             <a class="link" href="v-sim-surfaces-points.html#SurfacesPoints-translationOffset" title="SurfacesPoints_translationOffset">SurfacesPoints_translationOffset</a>
#define             <a class="link" href="v-sim-surfaces-points.html#SurfacesPoints-userOffset" title="SurfacesPoints_userOffset">SurfacesPoints_userOffset</a>
                    <a class="link" href="v-sim-surfaces-points.html#SurfacesPoints" title="SurfacesPoints">SurfacesPoints</a>;
<span class="returnvalue">void</span>                <a class="link" href="v-sim-surfaces-points.html#isosurfacesPointsInit" title="isosurfacesPointsInit ()">isosurfacesPointsInit</a>               (<em class="parameter"><code><a class="link" href="v-sim-surfaces-points.html#SurfacesPoints" title="SurfacesPoints"><span class="type">SurfacesPoints</span></a> *points</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> bufferSize</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="v-sim-surfaces-points.html#isosurfacesPointsAllocate" title="isosurfacesPointsAllocate ()">isosurfacesPointsAllocate</a>           (<em class="parameter"><code><a class="link" href="v-sim-surfaces-points.html#SurfacesPoints" title="SurfacesPoints"><span class="type">SurfacesPoints</span></a> *points</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> nsurf</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> npolys</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> npoints</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="v-sim-surfaces-points.html#isosurfacesPointsFree" title="isosurfacesPointsFree ()">isosurfacesPointsFree</a>               (<em class="parameter"><code><a class="link" href="v-sim-surfaces-points.html#SurfacesPoints" title="SurfacesPoints"><span class="type">SurfacesPoints</span></a> *points</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="v-sim-surfaces-points.html#isosurfacesPointsRemove" title="isosurfacesPointsRemove ()">isosurfacesPointsRemove</a>             (<em class="parameter"><code><a class="link" href="v-sim-surfaces-points.html#SurfacesPoints" title="SurfacesPoints"><span class="type">SurfacesPoints</span></a> *points</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> pos</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="v-sim-surfaces-points.html#isosurfacesPointsTranslate" title="isosurfacesPointsTranslate ()">isosurfacesPointsTranslate</a>          (<em class="parameter"><code><a class="link" href="v-sim-surfaces-points.html#SurfacesPoints" title="SurfacesPoints"><span class="type">SurfacesPoints</span></a> *points</code></em>,
                                                         <em class="parameter"><code><span class="type">float</span> xyz[3]</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="v-sim-surfaces-points.html#isosurfacesPointsCheck" title="isosurfacesPointsCheck ()">isosurfacesPointsCheck</a>              (<em class="parameter"><code><a class="link" href="v-sim-surfaces-points.html#SurfacesPoints" title="SurfacesPoints"><span class="type">SurfacesPoints</span></a> *points</code></em>);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="v-sim-surfaces-points.description"></a><h2>Description</h2>
<p>
</p>
<p>This structure is used to store and draw polyedges as a set
of XYZ points and a set of link to them.</p>
<p>
</p>
</div>
<div class="refsect1" title="Details">
<a name="v-sim-surfaces-points.details"></a><h2>Details</h2>
<div class="refsect2" title="SurfacesPoints_normalOffset">
<a name="SurfacesPoints-normalOffset"></a><h3>SurfacesPoints_normalOffset</h3>
<pre class="programlisting">#define SurfacesPoints_normalOffset 3
</pre>
<p>
The offset to read the normal values in poly_points.
</p>
</div>
<hr>
<div class="refsect2" title="SurfacesPoints_translationOffset">
<a name="SurfacesPoints-translationOffset"></a><h3>SurfacesPoints_translationOffset</h3>
<pre class="programlisting">#define SurfacesPoints_translationOffset 6
</pre>
<p>
The offset to read the translation values in poly_points.
</p>
</div>
<hr>
<div class="refsect2" title="SurfacesPoints_userOffset">
<a name="SurfacesPoints-userOffset"></a><h3>SurfacesPoints_userOffset</h3>
<pre class="programlisting">#define SurfacesPoints_userOffset 9
</pre>
<p>
The offset to read the user values in poly_points.
</p>
</div>
<hr>
<div class="refsect2" title="SurfacesPoints">
<a name="SurfacesPoints"></a><h3>SurfacesPoints</h3>
<pre class="programlisting">typedef struct {
  /* Number of different surfaces. */
  int nsurf;
  /* This is the size of additional data on each points in addition to
     (x,y,z) coordinates, normal and translation. Then poly_points is
     allocated to (num_points * (9 + bufferSize)). */
  int bufferSize;

  /* Number of polygons */
  int num_polys, num_points;

  /* Number of polygons per surface. */
  int *num_polys_surf;

  /* Give the number of the surface when the number of the
     polygon is given. */
  int *poly_surf_index;

  /* Return the number of vertices when the id of
     the polygon is given. */
  int *poly_num_vertices;

  /* Return the id in poly_points_data of the vertice j of polygon i. */
  int **poly_vertices;

  /* Vectors giving points and normal of the vertice i. */
  float **poly_points_data;
} SurfacesPoints;
</pre>
<p>
This structure stores geometric description of surfaces.
Several surfaces are stored in a single structure for improved performances.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><span class="type">int</span> <em class="structfield"><code><a name="SurfacesPoints.nsurf"></a>nsurf</code></em>;</span></p></td>
<td>number of surfaces encoded in this structure ;
</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">int</span> <em class="structfield"><code><a name="SurfacesPoints.bufferSize"></a>bufferSize</code></em>;</span></p></td>
<td>number of stored float in addition to coordinates and
normals ;
</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">int</span> <em class="structfield"><code><a name="SurfacesPoints.num-polys"></a>num_polys</code></em>;</span></p></td>
<td>number of polygoins stored in this structure ;
</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">int</span> <em class="structfield"><code><a name="SurfacesPoints.num-points"></a>num_points</code></em>;</span></p></td>
<td>number of vertices stored in this structure ;
</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">int</span> *<em class="structfield"><code><a name="SurfacesPoints.num-polys-surf"></a>num_polys_surf</code></em>;</span></p></td>
<td>number of visible polygons stored in this structure per surface ;
</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">int</span> *<em class="structfield"><code><a name="SurfacesPoints.poly-surf-index"></a>poly_surf_index</code></em>;</span></p></td>
<td>gives the id of the surface for each polygon,
                  this value ranges from - nsurf to + nsurf. abs(id - 1) gives
                  the index of the surface the polygon is attached to. If values
                  are negative, then the polygon is currently not used ;
</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">int</span> *<em class="structfield"><code><a name="SurfacesPoints.poly-num-vertices"></a>poly_num_vertices</code></em>;</span></p></td>
<td>gives the number of vertices used by each polygons ;
</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">int</span> **<em class="structfield"><code><a name="SurfacesPoints.poly-vertices"></a>poly_vertices</code></em>;</span></p></td>
<td>returns the id j of the vertices of polygon i ;
</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">float</span> **<em class="structfield"><code><a name="SurfacesPoints.poly-points-data"></a>poly_points_data</code></em>;</span></p></td>
<td>vectors giving additional data of vertex i.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="isosurfacesPointsInit ()">
<a name="isosurfacesPointsInit"></a><h3>isosurfacesPointsInit ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                isosurfacesPointsInit               (<em class="parameter"><code><a class="link" href="v-sim-surfaces-points.html#SurfacesPoints" title="SurfacesPoints"><span class="type">SurfacesPoints</span></a> *points</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> bufferSize</code></em>);</pre>
<p>
Initialise a SurfacesPoints structure. It must be done before any use.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>points</code></em> :</span></p></td>
<td>a pointer on a set of points (not initialised) ;
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>bufferSize</code></em> :</span></p></td>
<td>the number of additional data to coordinates and
normals.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="isosurfacesPointsAllocate ()">
<a name="isosurfacesPointsAllocate"></a><h3>isosurfacesPointsAllocate ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                isosurfacesPointsAllocate           (<em class="parameter"><code><a class="link" href="v-sim-surfaces-points.html#SurfacesPoints" title="SurfacesPoints"><span class="type">SurfacesPoints</span></a> *points</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> nsurf</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> npolys</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> npoints</code></em>);</pre>
<p>
Allocate the arrays to store a set of points.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>points</code></em> :</span></p></td>
<td>a pointer on a set of points (not allocated) ;
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>nsurf</code></em> :</span></p></td>
<td>the number of stored surfaces ;
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>npolys</code></em> :</span></p></td>
<td>the number of stored polygons ;
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>npoints</code></em> :</span></p></td>
<td>the corresponding number of points ;
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="isosurfacesPointsFree ()">
<a name="isosurfacesPointsFree"></a><h3>isosurfacesPointsFree ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                isosurfacesPointsFree               (<em class="parameter"><code><a class="link" href="v-sim-surfaces-points.html#SurfacesPoints" title="SurfacesPoints"><span class="type">SurfacesPoints</span></a> *points</code></em>);</pre>
<p>
Free all allocated arrays of the given set of points. The point
structure itself is not freed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>points</code></em> :</span></p></td>
<td>a set of points.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="isosurfacesPointsRemove ()">
<a name="isosurfacesPointsRemove"></a><h3>isosurfacesPointsRemove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                isosurfacesPointsRemove             (<em class="parameter"><code><a class="link" href="v-sim-surfaces-points.html#SurfacesPoints" title="SurfacesPoints"><span class="type">SurfacesPoints</span></a> *points</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> pos</code></em>);</pre>
<p>
Remove the points belonging to surface number <em class="parameter"><code>pos</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>points</code></em> :</span></p></td>
<td>a set of points ;
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pos</code></em> :</span></p></td>
<td>an integer between 0 and points-&gt;nsurf.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="isosurfacesPointsTranslate ()">
<a name="isosurfacesPointsTranslate"></a><h3>isosurfacesPointsTranslate ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                isosurfacesPointsTranslate          (<em class="parameter"><code><a class="link" href="v-sim-surfaces-points.html#SurfacesPoints" title="SurfacesPoints"><span class="type">SurfacesPoints</span></a> *points</code></em>,
                                                         <em class="parameter"><code><span class="type">float</span> xyz[3]</code></em>);</pre>
<p>
In devel...
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>points</code></em> :</span></p></td>
<td>a set of points.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>xyz</code></em> :</span></p></td>
<td>a given translation in cartesian coordinates.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="isosurfacesPointsCheck ()">
<a name="isosurfacesPointsCheck"></a><h3>isosurfacesPointsCheck ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                isosurfacesPointsCheck              (<em class="parameter"><code><a class="link" href="v-sim-surfaces-points.html#SurfacesPoints" title="SurfacesPoints"><span class="type">SurfacesPoints</span></a> *points</code></em>);</pre>
<p>
A debug routines to check that all pointers and size are
relevant. It should not be used outside a debug area because it can
be slow.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>points</code></em> :</span></p></td>
<td>a set of points.
</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.14</div>
</body>
</html>