aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a05149.html
blob: 438f8a1fec1aa0d9ab4c56ca7d6b1b7ee674d60f (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
<!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: transform_user.cpp File 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>transform_user.cpp File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
<dl compact><dt><b>Id</b></dt><dd><a class="el" href="a05149.html">transform_user.cpp</a>,v 1.18 2004/03/12 16:27:52 berenguier Exp </dd></dl>

<p>
Definition in file <a class="el" href="a06572.html">transform_user.cpp</a>.
<p>
<code>#include "<a class="el" href="a06438.html">std3d.h</a>"</code><br>
<code>#include "<a class="el" href="a06573.html">3d/transform_user.h</a>"</code><br>
<code>#include "<a class="el" href="a05823.html">3d/instance_group_user.h</a>"</code><br>
<code>#include "<a class="el" href="a05788.html">nel/misc/hierarchical_timer.h</a>"</code><br>
<code>#include "<a class="el" href="a06351.html">scene_group.h</a>"</code><br>

<p>
<a href="a06572.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a05149.html#a0">NL3D_HAUTO_SET_CLUSTER_SYSTEM</a>&nbsp;&nbsp;&nbsp;H_AUTO_USE( NL3D_Transform_Set_Cluster_System )</td></tr>

<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a05149.html#a1">H_AUTO_DECL</a> (NL3D_Transform_Set_Cluster_System) namespace NL3D</td></tr>

</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="a0" doxytag="transform_user.cpp::NL3D_HAUTO_SET_CLUSTER_SYSTEM" ></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"> #define NL3D_HAUTO_SET_CLUSTER_SYSTEM&nbsp;&nbsp;&nbsp;H_AUTO_USE( NL3D_Transform_Set_Cluster_System )
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Referenced by <a class="el" href="a06572.html#l00033">H_AUTO_DECL()</a>.    </td>
  </tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a1" doxytag="transform_user.cpp::H_AUTO_DECL" ></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"> H_AUTO_DECL </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">NL3D_Transform_Set_Cluster_System&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>

<p>
Definition at line <a class="el" href="a06572.html#l00033">33</a> of file <a class="el" href="a06572.html">transform_user.cpp</a>.
<p>
References <a class="el" href="a05149.html#a0">NL3D_HAUTO_SET_CLUSTER_SYSTEM</a>, <a class="el" href="a06573.html#l00037">NL3D_MEM_TRANSFORM</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00154">nlerror</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05646.html#l01124">num</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
<div class="fragment"><pre>00038 {
00039 
00040 <span class="comment">// ***************************************************************************</span>
00041 <span class="keywordtype">void</span> CTransformUser::setClusterSystem (UInstanceGroup *pIG)
00042 {
00043         <a class="code" href="a05149.html#a0">NL3D_HAUTO_SET_CLUSTER_SYSTEM</a>
00044 
00045         <a class="code" href="a04199.html#a6">nlassert</a>(_Transform) ; <span class="comment">// object invalid now ...</span>
00046         <span class="keywordflow">if</span> (_Transform-&gt;getForceClipRoot())
00047         {
00048                 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"Transform has been flagged to be glued to the root, and thus can't be clusterized. See UTransform::setForceClipRoot(bool)."</span>);
00049                 <span class="keywordflow">return</span>;
00050         }
00051         <span class="keywordflow">if</span> ((pIG == NULL) || (pIG == (UInstanceGroup*)-1))
00052         {
00053                 <span class="keywordflow">if</span> (pIG == NULL)
00054                         _Transform-&gt;setClusterSystem (NULL);
00055                 <span class="keywordflow">else</span>
00056                         _Transform-&gt;setClusterSystem ((CInstanceGroup*)-1);
00057         }
00058         <span class="keywordflow">else</span>
00059                 _Transform-&gt;setClusterSystem (&amp;((CInstanceGroupUser*)pIG)-&gt;_InstanceGroup);
00060 }
00061 
00062 <span class="comment">// ***************************************************************************</span>
00063 UInstanceGroup *CTransformUser::getClusterSystem ()
00064 {
00065         <a class="code" href="a04199.html#a6">nlassert</a>(_Transform) ; <span class="comment">// object invalid now ...</span>
00066         CInstanceGroup  *ig= _Transform-&gt;getClusterSystem();
00067         <span class="keywordflow">if</span>(ig==((CInstanceGroup*)-1))
00068                 <span class="keywordflow">return</span> ((UInstanceGroup*)-1);
00069         <span class="keywordflow">else</span> <span class="keywordflow">if</span>(ig==NULL)
00070                 <span class="keywordflow">return</span> NULL;
00071         <span class="keywordflow">else</span>
00072                 <span class="keywordflow">return</span> ig-&gt;getUserInterface();
00073 }
00074 
00075 <span class="comment">// ***************************************************************************</span>
00076 <span class="keywordtype">void</span>                    CTransformUser::getLastParentClusters(std::vector&lt;CCluster*&gt; &amp;clusters)<span class="keyword"> const</span>
00077 <span class="keyword"></span>{
00078         <span class="comment">// look in the list of parent of the transform object and extract the CCluster parents</span>
00079         <span class="keywordflow">if</span> (_Scene == NULL)
00080                 <span class="keywordflow">return</span>;
00081 
00082         CClipTrav       &amp;clipTrav= _Scene-&gt;getClipTrav();
00083 
00084         <a class="code" href="a04558.html#a15">uint</a>    <a class="code" href="a04223.html#a653">num</a>= _Transform-&gt;clipGetNumParents();
00085         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i&lt;<a class="code" href="a04223.html#a653">num</a>;i++)
00086         {
00087                 CCluster *pcluster = dynamic_cast&lt;CCluster*&gt;(_Transform-&gt;clipGetParent(i));
00088                 <span class="keywordflow">if</span> (pcluster != NULL)
00089                         clusters.push_back(pcluster);
00090         }
00091 
00092         <span class="comment">// If the object is link to a QuadCluster, add the RootCluster to the list</span>
00093         CTransformShape *trShp= dynamic_cast&lt;CTransformShape*&gt;( _Transform );
00094         <span class="keywordflow">if</span>( trShp &amp;&amp; trShp-&gt;isLinkToQuadCluster() )
00095                 clusters.push_back(clipTrav.RootCluster);
00096 }
00097 
00098 
00099 <span class="comment">// ***************************************************************************</span>
00100 <span class="keywordtype">void</span>                    CTransformUser::freezeHRC()
00101 {
00102         <a class="code" href="a04199.html#a6">nlassert</a>(_Transform) ; <span class="comment">// object invalid now ...</span>
00103         _Transform-&gt;freezeHRC();
00104 }
00105 
00106 <span class="comment">// ***************************************************************************</span>
00107 <span class="keywordtype">void</span>                    CTransformUser::unfreezeHRC()
00108 {
00109         <a class="code" href="a04199.html#a6">nlassert</a>(_Transform) ; <span class="comment">// object invalid now ...</span>
00110         CTransform *node = _Transform;
00111         <span class="keywordflow">while</span> (node)
00112         {
00113                 node-&gt;unfreezeHRC();
00114                 node = node-&gt;hrcGetParent();
00115         }
00116 }
00117 
00118 
00119 <span class="comment">// ***************************************************************************</span>
00120 <span class="keywordtype">void</span>                    CTransformUser::setLoadBalancingGroup(<span class="keyword">const</span> std::string &amp;group)
00121 {
00122         _Transform-&gt;setLoadBalancingGroup(group);
00123 }
00124 <span class="comment">// ***************************************************************************</span>
00125 <span class="keyword">const</span> std::string       &amp;CTransformUser::getLoadBalancingGroup()<span class="keyword"> const</span>
00126 <span class="keyword"></span>{
00127         <span class="keywordflow">return</span> _Transform-&gt;getLoadBalancingGroup();
00128 }
00129 
00130 <span class="comment">// ***************************************************************************</span>
00131 <span class="keywordtype">void</span>                    CTransformUser::setMeanColor(<a class="code" href="a03337.html">NLMISC::CRGBA</a> color)
00132 {
00133         _Transform-&gt;setMeanColor(color);
00134 }
00135 <span class="comment">// ***************************************************************************</span>
00136 <a class="code" href="a03337.html">NLMISC::CRGBA</a>   CTransformUser::getMeanColor()<span class="keyword"> const</span>
00137 <span class="keyword"></span>{
00138         <span class="keywordflow">return</span> _Transform-&gt;getMeanColor();
00139 }
00140 
00141 <span class="comment">// ***************************************************************************</span>
00142 <span class="keyword">const</span> CMatrix   &amp;CTransformUser::getLastWorldMatrixComputed()<span class="keyword"> const</span>
00143 <span class="keyword"></span>{
00144         <span class="keywordflow">return</span> _Transform-&gt;getWorldMatrix();
00145 }
00146 
00147 <span class="comment">// ***************************************************************************</span>
00148 <span class="keywordtype">void</span>                    CTransformUser::enableCastShadowMap(<span class="keywordtype">bool</span> state)
00149 {
00150         _Transform-&gt;enableCastShadowMap(state);
00151 }
00152 
00153 <span class="comment">// ***************************************************************************</span>
00154 <span class="keywordtype">bool</span>                    CTransformUser::canCastShadowMap()<span class="keyword"> const</span>
00155 <span class="keyword"></span>{
00156         <span class="keywordflow">return</span> _Transform-&gt;canCastShadowMap();
00157 }
00158 
00159 <span class="comment">// ***************************************************************************</span>
00160 <span class="keywordtype">void</span>                    CTransformUser::enableReceiveShadowMap(<span class="keywordtype">bool</span> state)
00161 {
00162         _Transform-&gt;enableReceiveShadowMap(state);
00163 }
00164 
00165 <span class="comment">// ***************************************************************************</span>
00166 <span class="keywordtype">bool</span>                    CTransformUser::canReceiveShadowMap()<span class="keyword"> const</span>
00167 <span class="keyword"></span>{
00168         <span class="keywordflow">return</span> _Transform-&gt;canReceiveShadowMap();
00169 }
00170 
00171 <span class="comment">// ***************************************************************************</span>
00172 <span class="keywordtype">void</span>                    CTransformUser::parent(UTransform *newFather)
00173 {
00174         <a class="code" href="a05150.html#a0">NL3D_MEM_TRANSFORM</a>
00175         <a class="code" href="a04199.html#a6">nlassert</a>(_Transform) ; <span class="comment">// object invalid now ...</span>
00176         <span class="keywordflow">if</span> (_Transform-&gt;getForceClipRoot())
00177         {
00178                 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"Transform has been flagged to be glued to the root, can't change parent. See UTransform::setForceClipRoot(bool)."</span>);
00179                 <span class="keywordflow">return</span>;
00180         }
00181         <span class="keywordflow">if</span>(newFather)
00182         {
00183                 <span class="comment">// link me to other.</span>
00184                 CTransformUser  *other= dynamic_cast&lt;CTransformUser*&gt;(newFather);
00185                 <span class="keywordflow">if</span>(other-&gt;_Scene!=_Scene)
00186                         <a class="code" href="a04199.html#a3">nlerror</a>(<span class="stringliteral">"Try to parent 2 object from 2 differnet scenes!!"</span>);
00187                 other-&gt;_Transform-&gt;hrcLinkSon( _Transform );
00188         }
00189         <span class="keywordflow">else</span>
00190         {
00191                 <span class="comment">// link me to Root.</span>
00192                 _Scene-&gt;getRoot()-&gt;hrcLinkSon( _Transform );
00193         }
00194 }
00195 
00196 
00197 } <span class="comment">// NL3D</span>
</pre></div>    </td>
  </tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:43:27 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>