aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/mrm__internal_8h-source.html
blob: 6f8e65dfadd111cc440b9e345e5558c9e0f436e0 (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
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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
	<TITLE>nevrax.org : docs</TITLE>
	<LINK REL=stylesheet TYPE="text/css" HREF="/inc/css/nevrax.css">
	<link href="doxygen.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY MARGINHEIGHT="0" MARGINWIDTH="0">

<!-- uplinks -->
<TABLE CELLSPACING=0 CELLPADDING=0  BORDER=0>
 <TR>
        <TD WIDTH=16><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
        <TD WIDTH=140 BGCOLOR=#dddddd><IMG  SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD>
        <TD WIDTH=16><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
        <TD><IMG width=6 height=14 SRC="/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF='/'><b>Home</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
        <TD><IMG  width=6 height=14  SRC="/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF='/'><b>nevrax.com</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
 </TR>
</TABLE> 

<!-- banner Nevrax -->
<TABLE CELLSPACING=0 CELLPADDING=0  BORDER=0 WIDTH=100%>
 <TR><TD  BGCOLOR="#000000" BACKGROUND="/inc/img/black_banner.jpg"><A HREF=""><IMG  SRC="/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR>
</TABLE>

<!-- main table -->
<TABLE CELLSPACING=0 CELLPADDING=0  BORDER=0 height=100%>
 <TR>
	<TD WIDTH=16><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD>
	<TD WIDTH=140   BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG  SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">

		<!------ Begin Box ------>
		<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0  cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black>
		<FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td  colspan=2 bgcolor=#FFFFFF>
		<TABLE cellspacing=0 cellpadding=1 border=0>
			<tr><td ALIGN=middle><a  class='linkbox' href="/news/" TITLE="Rubrique news"><img width=13 height=15  hspace=5 border=0 src=/inc/img/picto-news.gif ALT=#></A></td><td><a  class='linkbox' href="/news/" TITLE="News">News</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/mail/" TITLE="Rubrique mail"><img width=15 height=11  hspace=5 border=0 src=/inc/img/picto-mail.gif ALT=#></A></td><td><a  class='linkbox' href="/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/docs/" TITLE="Rubrique docs"><img width=14 height=16  hspace=5 border=0 src=/inc/img/picto-docs.gif ALT=#></A></td><td><a  class='linkbox' href="/docs/" TITLE="Documentation">Documentation</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/cvs/" TITLE="Rubrique cvs"><img width=13 height=17  hspace=5 border=0 src=/inc/img/picto-cvs.gif ALT=#></A></td><td><a  class='linkbox' href="/cvs/" TITLE="CVS Web">CVS</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/bugs/" TITLE="Rubrique bugs"><img width=20 height=16  hspace=5 border=0 src=/inc/img/picto-bugs.gif ALT=#></A></td><td><a  class='linkbox' href="/bugs/" TITLE="Bugtracking">Bugs</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/GPL.php3" TITLE="Rubrique license"><img  width=18 height=12   hspace=5 border=0 src=/inc/img/picto-gpl.gif ALT=#></A></td><td><a  class='linkbox' href="/GPL.php3" TITLE="License">License</a></td></tr>
		</TABLE>
		</TD></TR></TABLE></TD></TR></TABLE>
		<!------ End Box  ------>

	</TD>
	<TD WIDTH=15><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
	<TD ALIGN=left valign=top><IMG  SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">

<!-- title -->
<TABLE  background="/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0  BORDER=0 width=100%><tr><td>
<A HREF="/docs/"><img src="/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A>
</td><td><IMG  SRC="/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT="">
</td></tr></table>
&nbsp;

<!-- block -->
<TABLE  bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0  BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="/inc/img/reddots.gif"></TD>
	<TD><B>Documentation</B></TD>
	<TD ALIGN=RIGHT>&nbsp;</td>
</tr></table>
<!-- Generated by Doxygen 1.2.14 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; <a class="qindexRef" doxygen="_cgi:/cgi-bin/nel-search.cgi" href="/cgi-bin/nel-search.cgi">Search</a> &nbsp; </center>
<hr><h1>mrm_internal.h</h1><a href="mrm__internal_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 
00007 <font class="comment">/* Copyright, 2001 Nevrax Ltd.</font>
00008 <font class="comment"> *</font>
00009 <font class="comment"> * This file is part of NEVRAX NEL.</font>
00010 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font>
00011 <font class="comment"> * it under the terms of the GNU General Public License as published by</font>
00012 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font>
00013 <font class="comment"> * any later version.</font>
00014 <font class="comment"></font>
00015 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font>
00016 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00017 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font>
00018 <font class="comment"> * General Public License for more details.</font>
00019 <font class="comment"></font>
00020 <font class="comment"> * You should have received a copy of the GNU General Public License</font>
00021 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font>
00022 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font>
00023 <font class="comment"> * MA 02111-1307, USA.</font>
00024 <font class="comment"> */</font>
00025 
00026 <font class="preprocessor">#ifndef NL_MRM_INTERNAL_H</font>
00027 <font class="preprocessor"></font><font class="preprocessor">#define NL_MRM_INTERNAL_H</font>
00028 <font class="preprocessor"></font>
00029 <font class="preprocessor">#include "<a class="code" href="types__nl_8h.html">nel/misc/types_nl.h</a>"</font>
00030 <font class="preprocessor">#include "<a class="code" href="mrm__mesh_8h.html">3d/mrm_mesh.h</a>"</font>
00031 
00032 
00033 <font class="keyword">namespace </font>NL3D
00034 {
00035 
00036 <font class="comment">// ***************************************************************************</font>
<a name="l00037"></a><a class="code" href="structNL3D_1_1CLinearEquation.html">00037</a> <font class="keyword">struct </font>CLinearEquation
00038 {
<a name="l00039"></a><a class="code" href="structNL3D_1_1CLinearEquation_1_1Element.html">00039</a>         <font class="keyword">struct </font>Element
00040         {
<a name="l00041"></a><a class="code" href="structNL3D_1_1CLinearEquation_1_1Element.html#m0">00041</a>                 uint32  <a class="code" href="structNL3D_1_1CLinearEquation_1_1Element.html#m0">index</a>;
<a name="l00042"></a><a class="code" href="structNL3D_1_1CLinearEquation_1_1Element.html#m1">00042</a>                 <font class="keywordtype">float</font>   <a class="code" href="structNL3D_1_1CLinearEquation_1_1Element.html#m1">factor</a>;
00043 
<a name="l00044"></a><a class="code" href="structNL3D_1_1CLinearEquation_1_1Element.html#a0">00044</a>                 <a class="code" href="structNL3D_1_1CLinearEquation_1_1Element.html#a0">Element</a>(uint32 i, <font class="keywordtype">float</font> f)
00045                 {
00046                         <a class="code" href="structNL3D_1_1CLinearEquation_1_1Element.html#m0">index</a> = i;
00047                         <a class="code" href="structNL3D_1_1CLinearEquation_1_1Element.html#m1">factor</a> = f;
00048                 }
00049         };
00050 
<a name="l00051"></a><a class="code" href="structNL3D_1_1CLinearEquation.html#m0">00051</a>         std::vector&lt;Element&gt; <a class="code" href="structNL3D_1_1CLinearEquation.html#m0">Elts</a>;
00052 
<a name="l00053"></a><a class="code" href="structNL3D_1_1CLinearEquation.html#a0">00053</a>         <font class="keywordtype">void</font> <a class="code" href="structNL3D_1_1CLinearEquation.html#a0">init</a>(uint32 ii)
00054         {
00055                 <a class="code" href="structNL3D_1_1CLinearEquation.html#a3">clear</a>();
00056                 <a class="code" href="structNL3D_1_1CLinearEquation.html#m0">Elts</a>.push_back (Element(ii, 1.0f));
00057         }
00058 
00059         <font class="comment">// this = this + eq * factor</font>
<a name="l00060"></a><a class="code" href="structNL3D_1_1CLinearEquation.html#a1">00060</a>         <font class="keywordtype">void</font> <a class="code" href="structNL3D_1_1CLinearEquation.html#a1">add</a>(CLinearEquation&amp; eq, <font class="keywordtype">float</font> factor)
00061         {
00062                 Element tmp(0, 0.0f);
00063 
00064                 <font class="keywordflow">for</font> (uint32 i = 0; i &lt; eq.Elts.size(); ++i)
00065                 {
00066                         tmp.index = eq.Elts[i].index;
00067                         tmp.factor = factor * eq.Elts[i].factor;
00068                         <a class="code" href="structNL3D_1_1CLinearEquation.html#m0">Elts</a>.push_back (tmp);
00069                 }
00070         }
00071 
00072         <font class="comment">// this = this * factor</font>
<a name="l00073"></a><a class="code" href="structNL3D_1_1CLinearEquation.html#a2">00073</a>         <font class="keywordtype">void</font> <a class="code" href="structNL3D_1_1CLinearEquation.html#a2">mul</a> (<font class="keywordtype">float</font> factor)
00074         {
00075                 <font class="keywordflow">for</font> (uint32 i = 0; i &lt; <a class="code" href="structNL3D_1_1CLinearEquation.html#m0">Elts</a>.size(); ++i)
00076                         <a class="code" href="structNL3D_1_1CLinearEquation.html#m0">Elts</a>[i].factor *= factor;
00077         }
00078 
<a name="l00079"></a><a class="code" href="structNL3D_1_1CLinearEquation.html#a3">00079</a>         <font class="keywordtype">void</font> <a class="code" href="structNL3D_1_1CLinearEquation.html#a3">clear</a>()
00080         {
00081                 <a class="code" href="namespaceNLMISC.html#a222">NLMISC::contReset</a> (<a class="code" href="structNL3D_1_1CLinearEquation.html#m0">Elts</a>);
00082         }
00083 };
00084 
00085 <font class="comment">// ***************************************************************************</font>
<a name="l00092"></a><a class="code" href="structNL3D_1_1CMRMVertex.html">00092</a> <font class="comment"></font><font class="keyword">struct  </font>CMRMVertex
00093 {
00094 <font class="keyword">public</font>:
00095         <font class="comment">// Original / Dest position.</font>
<a name="l00096"></a><a class="code" href="structNL3D_1_1CMRMVertex.html#m1">00096</a>         CVector                                 <a class="code" href="structNL3D_1_1CMRMVertex.html#m0">Current</a>,<a class="code" href="structNL3D_1_1CMRMVertex.html#m1">Original</a>;
<a name="l00097"></a><a class="code" href="structNL3D_1_1CMRMVertex.html#m2">00097</a>         std::vector&lt;CVector&gt;    <a class="code" href="structNL3D_1_1CMRMVertex.html#m2">BSCurrent</a>;
00098         <font class="comment">// For Skinning.</font>
<a name="l00099"></a><a class="code" href="structNL3D_1_1CMRMVertex.html#m4">00099</a>         CMesh::CSkinWeight              <a class="code" href="structNL3D_1_1CMRMVertex.html#m3">CurrentSW</a>, <a class="code" href="structNL3D_1_1CMRMVertex.html#m4">OriginalSW</a>;
<a name="l00100"></a><a class="code" href="structNL3D_1_1CMRMVertex.html#m5">00100</a>         std::vector&lt;sint&gt;               <a class="code" href="structNL3D_1_1CMRMVertex.html#m5">SharedFaces</a>;
<a name="l00101"></a><a class="code" href="structNL3D_1_1CMRMVertex.html#m6">00101</a>         sint                                    <a class="code" href="structNL3D_1_1CMRMVertex.html#m6">CollapsedTo</a>;
00102         <font class="comment">// Final index in the coarser mesh.</font>
<a name="l00103"></a><a class="code" href="structNL3D_1_1CMRMVertex.html#m7">00103</a>         sint                                    <a class="code" href="structNL3D_1_1CMRMVertex.html#m7">CoarserIndex</a>;
00104 
00105         <font class="comment">// The link to the current meshInterface vertex.</font>
<a name="l00106"></a><a class="code" href="structNL3D_1_1CMRMVertex.html#m8">00106</a>         CMesh::CInterfaceLink   <a class="code" href="structNL3D_1_1CMRMVertex.html#m8">InterfaceLink</a>;
00107 
00108 <font class="keyword">public</font>:
<a name="l00109"></a><a class="code" href="structNL3D_1_1CMRMVertex.html#a0">00109</a>         <a class="code" href="structNL3D_1_1CMRMVertex.html#a0">CMRMVertex</a>() {<a class="code" href="structNL3D_1_1CMRMVertex.html#m6">CollapsedTo</a>=-1;}
00110 };
00111 
00112 
00113 <font class="comment">// ***************************************************************************</font>
<a name="l00120"></a><a class="code" href="structNL3D_1_1CMRMAttribute.html">00120</a> <font class="comment"></font><font class="keyword">struct  </font>CMRMAttribute
00121 {
00122 <font class="keyword">public</font>:
<a name="l00123"></a><a class="code" href="structNL3D_1_1CMRMAttribute.html#m1">00123</a>         CVectorH                <a class="code" href="structNL3D_1_1CMRMAttribute.html#m0">Current</a>,<a class="code" href="structNL3D_1_1CMRMAttribute.html#m1">Original</a>;
<a name="l00124"></a><a class="code" href="structNL3D_1_1CMRMAttribute.html#m2">00124</a>         std::vector&lt;CVectorH&gt;           <a class="code" href="structNL3D_1_1CMRMAttribute.html#m2">BSCurrent</a>;
<a name="l00125"></a><a class="code" href="structNL3D_1_1CMRMAttribute.html#m3">00125</a>         sint                    <a class="code" href="structNL3D_1_1CMRMAttribute.html#m3">CollapsedTo</a>;            <font class="comment">// -2 &lt;=&gt; "must interpolate from Current to Original".</font>
00126         <font class="comment">// Final index in the coarser mesh.</font>
<a name="l00127"></a><a class="code" href="structNL3D_1_1CMRMAttribute.html#m4">00127</a>         sint                    <a class="code" href="structNL3D_1_1CMRMAttribute.html#m4">CoarserIndex</a>;
00128 
00129 <font class="keyword">public</font>:
00130         <font class="comment">// temporary data in construction:</font>
<a name="l00131"></a><a class="code" href="structNL3D_1_1CMRMAttribute.html#m5">00131</a>         sint                    <a class="code" href="structNL3D_1_1CMRMAttribute.html#m5">InterpolatedFace</a>;
<a name="l00132"></a><a class="code" href="structNL3D_1_1CMRMAttribute.html#m6">00132</a>         sint                    <a class="code" href="structNL3D_1_1CMRMAttribute.html#m6">NbSharedFaces</a>;
<a name="l00133"></a><a class="code" href="structNL3D_1_1CMRMAttribute.html#m7">00133</a>         <font class="keywordtype">bool</font>                    <a class="code" href="structNL3D_1_1CMRMAttribute.html#m7">Shared</a>;
00134         <font class="comment">// A wedge is said "shared" if after edge is collapsed, he lost corners.</font>
00135         <font class="comment">// If NbSharedFaces==0, this wedge has been entirely destroyed.</font>
00136 
00137 <font class="keyword">public</font>:
<a name="l00138"></a><a class="code" href="structNL3D_1_1CMRMAttribute.html#a0">00138</a>         <a class="code" href="structNL3D_1_1CMRMAttribute.html#a0">CMRMAttribute</a>() {<a class="code" href="structNL3D_1_1CMRMAttribute.html#m3">CollapsedTo</a>=-1;}
00139 };
00140 
00141 
00142 <font class="comment">// ***************************************************************************</font>
<a name="l00149"></a><a class="code" href="structNL3D_1_1CMRMEdge.html">00149</a> <font class="comment"></font><font class="keyword">struct  </font>CMRMEdge
00150 {
<a name="l00151"></a><a class="code" href="structNL3D_1_1CMRMEdge.html#m1">00151</a>         sint    <a class="code" href="structNL3D_1_1CMRMEdge.html#m0">v0</a>,<a class="code" href="structNL3D_1_1CMRMEdge.html#m1">v1</a>;
<a name="l00152"></a><a class="code" href="structNL3D_1_1CMRMEdge.html#a0">00152</a>         <a class="code" href="structNL3D_1_1CMRMEdge.html#a0">CMRMEdge</a>() {}
<a name="l00153"></a><a class="code" href="structNL3D_1_1CMRMEdge.html#a1">00153</a>         <a class="code" href="structNL3D_1_1CMRMEdge.html#a0">CMRMEdge</a>(sint a, sint b) {<a class="code" href="structNL3D_1_1CMRMEdge.html#m0">v0</a>= a; <a class="code" href="structNL3D_1_1CMRMEdge.html#m1">v1</a>=b;}
<a name="l00154"></a><a class="code" href="structNL3D_1_1CMRMEdge.html#a2">00154</a>         <font class="keywordtype">bool</font> <a class="code" href="structNL3D_1_1CMRMEdge.html#a2">operator==</a>(<font class="keyword">const</font> <a class="code" href="structNL3D_1_1CMRMEdge.html#a0">CMRMEdge</a> &amp;o)<font class="keyword"> const</font>
00155 <font class="keyword">        </font>{
00156                 <font class="comment">// Order means nothing  ( (v0,v1) == (v1,v0) ).... Kick it.</font>
00157                 <font class="keywordflow">return</font> (<a class="code" href="structNL3D_1_1CMRMEdge.html#m0">v0</a>==o.v0 &amp;&amp; <a class="code" href="structNL3D_1_1CMRMEdge.html#m1">v1</a>==o.v1) || (<a class="code" href="structNL3D_1_1CMRMEdge.html#m0">v0</a>==o.v1 &amp;&amp; <a class="code" href="structNL3D_1_1CMRMEdge.html#m1">v1</a>==o.v0);
00158         }
<a name="l00159"></a><a class="code" href="structNL3D_1_1CMRMEdge.html#a3">00159</a>         <font class="keywordtype">bool</font> <a class="code" href="structNL3D_1_1CMRMEdge.html#a3">operator&lt;</a>(<font class="keyword">const</font> <a class="code" href="structNL3D_1_1CMRMEdge.html#a0">CMRMEdge</a> &amp;o)<font class="keyword"> const</font>
00160 <font class="keyword">        </font>{
00161                 <font class="comment">// Order means nothing  ( (v0,v1) == (v1,v0) ).... Kick it.</font>
00162                 sint max0= std::max(<a class="code" href="structNL3D_1_1CMRMEdge.html#m0">v0</a>,<a class="code" href="structNL3D_1_1CMRMEdge.html#m1">v1</a>);
00163                 sint min0= <a class="code" href="bit__set_8cpp.html#a0">std::min</a>(<a class="code" href="structNL3D_1_1CMRMEdge.html#m0">v0</a>,<a class="code" href="structNL3D_1_1CMRMEdge.html#m1">v1</a>);
00164                 sint max1= std::max(o.v0,o.v1);
00165                 sint min1= <a class="code" href="bit__set_8cpp.html#a0">std::min</a>(o.v0,o.v1);
00166                 <font class="keywordflow">if</font>(max0!=max1)
00167                         <font class="keywordflow">return</font> max0&lt;max1;
00168                 <font class="keywordflow">else</font>
00169                         <font class="keywordflow">return</font> min0&lt;min1;
00170         }
00171 };
00172 
00173 
00174 <font class="comment">// ***************************************************************************</font>
00175 <font class="keyword">struct  </font>CMRMFaceBuild;
<a name="l00182"></a><a class="code" href="structNL3D_1_1CMRMEdgeFace.html">00182</a> <font class="keyword">struct  </font>CMRMEdgeFace : <font class="keyword">public</font> CMRMEdge
00183 {
<a name="l00184"></a><a class="code" href="structNL3D_1_1CMRMEdgeFace.html#m0">00184</a>         CMRMFaceBuild           *<a class="code" href="structNL3D_1_1CMRMEdgeFace.html#m0">Face</a>;
00185         <a class="code" href="structNL3D_1_1CMRMEdgeFace.html#a0">CMRMEdgeFace</a>();
<a name="l00186"></a><a class="code" href="structNL3D_1_1CMRMEdgeFace.html#a1">00186</a>         <a class="code" href="structNL3D_1_1CMRMEdgeFace.html#a0">CMRMEdgeFace</a>(sint a, sint b, CMRMFaceBuild *f) 
00187         {
00188                 <a class="code" href="structNL3D_1_1CMRMEdge.html#m0">v0</a>=a; <a class="code" href="structNL3D_1_1CMRMEdge.html#m1">v1</a>=b;
00189                 <a class="code" href="structNL3D_1_1CMRMEdgeFace.html#m0">Face</a>= f;
00190         }
<a name="l00191"></a><a class="code" href="structNL3D_1_1CMRMEdgeFace.html#a2">00191</a>         <a class="code" href="structNL3D_1_1CMRMEdgeFace.html#a0">CMRMEdgeFace</a>(<font class="keyword">const</font> <a class="code" href="structNL3D_1_1CMRMEdge.html#a0">CMRMEdge</a> &amp;e, CMRMFaceBuild *f) : <a class="code" href="structNL3D_1_1CMRMEdge.html#a0">CMRMEdge</a>(e)
00192         {
00193                 <a class="code" href="structNL3D_1_1CMRMEdgeFace.html#m0">Face</a>= f;
00194         }
00195 
00196 };
00197 
00198 
00199 <font class="comment">// ***************************************************************************</font>
00206 <font class="comment"></font><font class="keyword">typedef</font> std::multimap&lt;float, CMRMEdgeFace&gt;      <a class="code" href="namespaceNL3D.html#a160">TEdgeMap</a>;
00207 <font class="keyword">typedef</font> TEdgeMap::iterator                                      <a class="code" href="namespaceNL3D.html#a161">ItEdgeMap</a>;
00208 
00209 
00210 <font class="comment">// ***************************************************************************</font>
<a name="l00217"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html">00217</a> <font class="comment"></font><font class="keyword">struct  </font>CMRMFaceBuild : <font class="keyword">public</font> CMRMFace
00218 {
00219 <font class="keyword">public</font>:
00220         <font class="comment">// temporary data in construction:</font>
00221         <font class="comment">// The interpolated attrbute of the face.</font>
<a name="l00222"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m0">00222</a>         CVectorH                <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m0">InterpolatedAttribute</a>;
<a name="l00223"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m1">00223</a>         std::vector&lt;CVectorH&gt;   <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m1">BSInterpolated</a>;
00224 
00225         <font class="comment">// Is this face deleted in the current MRM collapse?</font>
<a name="l00226"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m2">00226</a>         <font class="keywordtype">bool</font>                    <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m2">Deleted</a>;
00227         <font class="comment">// The iterator of the edges in the EdgeCollapse list.</font>
<a name="l00228"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m5">00228</a>         <a class="code" href="namespaceNL3D.html#a161">ItEdgeMap</a>               <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m3">It0</a>, <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m4">It1</a>, <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m5">It2</a>;
00229         <font class="comment">// The mirror value of iterator: are they valid???</font>
<a name="l00230"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m8">00230</a>         <font class="keywordtype">bool</font>                    <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m6">ValidIt0</a>, <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m7">ValidIt1</a>, <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m8">ValidIt2</a>;
00231 
00232 
00233 <font class="keyword">public</font>:
<a name="l00234"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a0">00234</a>         <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a0">CMRMFaceBuild</a>()
00235         {
00236                 <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m2">Deleted</a>=<font class="keyword">false</font>;
00237                 <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m6">ValidIt0</a>= <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m7">ValidIt1</a>= <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m8">ValidIt2</a>= <font class="keyword">false</font>;
00238         }
<a name="l00239"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a1">00239</a>         <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a0">CMRMFaceBuild</a> &amp;<a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a1">operator=</a>(<font class="keyword">const</font> CMRMFace &amp;f)
00240         {
00241                 (CMRMFace &amp;)(*this)=f;
00242                 <font class="keywordflow">return</font> *<font class="keyword">this</font>;
00243         }
00244 
00245         <font class="comment">// Edges.</font>
00246         <font class="comment">//=======</font>
<a name="l00247"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a2">00247</a>         sint    <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a2">getAssociatedEdge</a>(<font class="keyword">const</font> CMRMEdge &amp;edge)<font class="keyword"> const</font>
00248 <font class="keyword">        </font>{
00249                 sint v0= edge.v0;
00250                 sint v1= edge.v1;
00251                 <font class="keywordflow">if</font>(<a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[0].Vertex==v0 &amp;&amp; <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[1].Vertex==v1)        <font class="keywordflow">return</font> 0;
00252                 <font class="keywordflow">if</font>(<a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[0].Vertex==v1 &amp;&amp; <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[1].Vertex==v0)        <font class="keywordflow">return</font> 0;
00253                 <font class="keywordflow">if</font>(<a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[1].Vertex==v0 &amp;&amp; <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[2].Vertex==v1)        <font class="keywordflow">return</font> 1;
00254                 <font class="keywordflow">if</font>(<a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[1].Vertex==v1 &amp;&amp; <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[2].Vertex==v0)        <font class="keywordflow">return</font> 1;
00255                 <font class="keywordflow">if</font>(<a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[0].Vertex==v0 &amp;&amp; <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[2].Vertex==v1)        <font class="keywordflow">return</font> 2;
00256                 <font class="keywordflow">if</font>(<a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[0].Vertex==v1 &amp;&amp; <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[2].Vertex==v0)        <font class="keywordflow">return</font> 2;
00257                 <font class="keywordflow">return</font> -1;
00258         }
<a name="l00259"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a3">00259</a>         <font class="keywordtype">bool</font>    <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a3">hasEdge</a>(<font class="keyword">const</font> CMRMEdge &amp;edge)<font class="keyword"> const</font>
00260 <font class="keyword">        </font>{
00261                 <font class="keywordflow">return</font> <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a2">getAssociatedEdge</a>(edge)!=-1;
00262         }
<a name="l00263"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a4">00263</a>         CMRMEdge        <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a4">getEdge</a>(sint eId)<font class="keyword"> const</font>
00264 <font class="keyword">        </font>{
00265                 <font class="keywordflow">if</font>(eId==0) <font class="keywordflow">return</font> CMRMEdge(<a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[0].Vertex, <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[1].Vertex);
00266                 <font class="keywordflow">if</font>(eId==1) <font class="keywordflow">return</font> CMRMEdge(<a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[1].Vertex, <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[2].Vertex);
00267                 <font class="keywordflow">if</font>(eId==2) <font class="keywordflow">return</font> CMRMEdge(<a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[2].Vertex, <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[0].Vertex);
00268                 <a class="code" href="debug_8h.html#a12">nlstop</a>;
00269                 <font class="keywordflow">return</font> CMRMEdge(-1,-1);
00270         }
<a name="l00271"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a5">00271</a>         <font class="keywordtype">void</font>    <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a5">invalidAllIts</a>(<a class="code" href="namespaceNL3D.html#a160">TEdgeMap</a> &amp;edgeMap)
00272         {
00273                 <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m6">ValidIt0</a>= <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m7">ValidIt1</a>= <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m8">ValidIt2</a>= <font class="keyword">false</font>;
00274                 <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m3">It0</a>= edgeMap.end();
00275                 <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m4">It1</a>= edgeMap.end();
00276                 <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m5">It2</a>= edgeMap.end();
00277         }
<a name="l00278"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a6">00278</a>         <font class="keywordtype">void</font>    <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a6">invalidEdgeIt</a>(<font class="keyword">const</font> CMRMEdge &amp;e, <a class="code" href="namespaceNL3D.html#a160">TEdgeMap</a> &amp;edgeMap)
00279         {
00280                 <font class="keywordflow">if</font>(e== <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a4">getEdge</a>(0))
00281                         <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m3">It0</a>= edgeMap.end(), <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m6">ValidIt0</a>= <font class="keyword">false</font>;
00282                 <font class="keywordflow">else</font> <font class="keywordflow">if</font>(e== <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a4">getEdge</a>(1))
00283                         <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m4">It1</a>= edgeMap.end(), <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m7">ValidIt1</a>= <font class="keyword">false</font>;
00284                 <font class="keywordflow">else</font> <font class="keywordflow">if</font>(e== <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a4">getEdge</a>(2))
00285                         <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m5">It2</a>= edgeMap.end(), <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m8">ValidIt2</a>= <font class="keyword">false</font>;
00286                 <font class="keywordflow">else</font> <a class="code" href="debug_8h.html#a12">nlstop</a>;
00287         }
<a name="l00288"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a7">00288</a>         <font class="keywordtype">bool</font>    <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a7">validEdgeIt</a>(<font class="keyword">const</font> CMRMEdge &amp;e)
00289         {
00290                 <font class="keywordflow">if</font>(e== <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a4">getEdge</a>(0)) <font class="keywordflow">return</font> <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m6">ValidIt0</a>;
00291                 <font class="keywordflow">if</font>(e== <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a4">getEdge</a>(1)) <font class="keywordflow">return</font> <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m7">ValidIt1</a>;
00292                 <font class="keywordflow">if</font>(e== <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a4">getEdge</a>(2)) <font class="keywordflow">return</font> <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#m8">ValidIt2</a>;
00293                 <a class="code" href="debug_8h.html#a12">nlstop</a>;
00294                 <font class="keywordflow">return</font> <font class="keyword">false</font>;
00295         }
00296 
00297         <font class="comment">// Vertices.</font>
00298         <font class="comment">//==========</font>
<a name="l00299"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a8">00299</a>         <font class="keywordtype">bool</font>    <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a8">hasVertex</a>(sint  numvertex)
00300         {
00301                 <font class="keywordflow">return</font> <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[0].Vertex==numvertex || <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[1].Vertex==numvertex || <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[2].Vertex==numvertex;
00302         }
00303 
00304         
00305         <font class="comment">// Wedges.</font>
00306         <font class="comment">//==========</font>
<a name="l00307"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a9">00307</a>         <font class="keywordtype">bool</font>    <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a9">hasWedge</a>(sint attribId, sint numwedge)
00308         {
00309                 <font class="keywordflow">return</font> <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[0].Attributes[attribId]==numwedge ||
00310                         <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[1].Attributes[attribId]==numwedge ||
00311                         <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[2].Attributes[attribId]==numwedge;
00312         }
<a name="l00313"></a><a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a10">00313</a>         sint    <a class="code" href="structNL3D_1_1CMRMFaceBuild.html#a10">getAssociatedWedge</a>(sint attribId, sint numvertex)
00314         {
00315                 <font class="keywordflow">if</font>(<a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[0].Vertex==numvertex) <font class="keywordflow">return</font> <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[0].Attributes[attribId];
00316                 <font class="keywordflow">if</font>(<a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[1].Vertex==numvertex) <font class="keywordflow">return</font> <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[1].Attributes[attribId];
00317                 <font class="keywordflow">if</font>(<a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[2].Vertex==numvertex) <font class="keywordflow">return</font> <a class="code" href="structNL3D_1_1CMRMFace.html#m0">Corner</a>[2].Attributes[attribId];
00318                 <font class="keywordflow">return</font> -1;
00319         }
00320 };
00321 
00322 
00323 <font class="comment">// ***************************************************************************</font>
<a name="l00327"></a><a class="code" href="classNL3D_1_1CMRMSewingMesh.html">00327</a> <font class="comment"></font><font class="keyword">class   </font>CMRMSewingMesh
00328 {
<a name="l00329"></a><a class="code" href="structNL3D_1_1CMRMSewingMesh_1_1CLod.html">00329</a>         <font class="keyword">struct  </font>CLod
00330         {
00331                 <font class="comment">// A list of edge that must be collapsed for this Lod. NB: sorted from first to collapse to last to collapse</font>
<a name="l00332"></a><a class="code" href="structNL3D_1_1CMRMSewingMesh_1_1CLod.html#m0">00332</a>                 std::vector&lt;CMRMEdge&gt;   <a class="code" href="structNL3D_1_1CMRMSewingMesh_1_1CLod.html#m0">EdgeToCollapse</a>;
00333         };
00334 
00335         <font class="comment">// A list of Lods.</font>
<a name="l00336"></a><a class="code" href="classNL3D_1_1CMRMSewingMesh.html#o0">00336</a>         std::vector&lt;CLod&gt;       <a class="code" href="classNL3D_1_1CMRMSewingMesh.html#o0">_Lods</a>;
00337 
00338 <font class="keyword">public</font>:
00339 
00342         <font class="keywordtype">void</font>    <a class="code" href="classNL3D_1_1CMRMSewingMesh.html#a0">build</a>(<font class="keyword">const</font> CMesh::CInterface &amp;meshInt, uint nWantedLods, uint divisor);
00343 
00347         sint    <a class="code" href="classNL3D_1_1CMRMSewingMesh.html#a1">mustCollapseEdge</a>(uint lod, <font class="keyword">const</font> CMRMEdge &amp;edge, uint &amp;vertToCollapse) <font class="keyword">const</font>;
00348 
00350         sint    <a class="code" href="classNL3D_1_1CMRMSewingMesh.html#a2">getNumCollapseEdge</a>(uint lod) <font class="keyword">const</font>;
00351 
00352 };
00353 
00354 
00355 
00356 
00357 } <font class="comment">// NL3D</font>
00358 
00359 
00360 <font class="preprocessor">#endif // NL_MRM_INTERNAL_H</font>
00361 <font class="preprocessor"></font>
00362 <font class="comment">/* End of mrm_internal.h */</font>
</pre></div>

<!-- footer -->
<BR><FONT Size=+5>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </FONT>
</TD>
<TD WIDTH=15><IMG  SRC=/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD>
</TR>
</TABLE>
</BODY>
</HTML>