<div dir="ltr">Hi Carlos, <div><br></div><div>This is indeed a bug. Thanks for catching this. If you add a mapper to multiple actors then I guess the right thing would be is to mark the actor's bound dirty and then use this information to decide whether or not we need to recompute the bounds. </div>
<div><br></div><div style>I will push a branch today to fix this issue. Thanks for reporting this.</div><div style><br></div><div style>- Aashish</div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Jun 25, 2013 at 10:32 AM, Carlos <span dir="ltr"><<a href="mailto:ves@calculoandamios.com" target="_blank">ves@calculoandamios.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="ES" link="blue" vlink="purple"><div><p class="MsoNormal">Hi,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span lang="EN-US">I think there is a bug in <u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">void</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> vesActor::computeBounds()<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas">{<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> assert(<span style="color:blue">this</span>->m_mapper);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">if</span> (<span style="color:blue">this</span>->m_mapper && <span style="color:blue">this</span>->m_mapper->boundsDirty()) {<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">this</span>->m_mapper->computeBounds();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> vesVector3f min = transformPoint3f(<span style="color:blue">this</span>->matrix(), <span style="color:blue">this</span>->m_mapper->boundsMinimum());<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> vesVector3f max = transformPoint3f(<span style="color:blue">this</span>->matrix(), <span style="color:blue">this</span>->m_mapper->boundsMaximum());<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">this</span>->setBounds(min, max);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:green">// Since now we have new internal bounds, we would have to</span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:green">// calculate whole bounds for this actor once again.</span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">this</span>->setBoundsDirty(<span style="color:blue">true</span>);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">this</span>->setBoundsDirty(<span style="color:blue">false</span>);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">this</span>->setParentBoundsDirty(<span style="color:blue">true</span>);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> }<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">else</span> <span style="color:blue">if</span> (!<span style="color:blue">this</span>->m_mapper && <span style="color:blue">this</span>->boundsDirty()) {<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> </span><span style="font-size:9.5pt;font-family:Consolas;color:blue">this</span><span style="font-size:9.5pt;font-family:Consolas">->resetBounds();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas"> }<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas">}<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US">I have included an additional checking just in order that this-</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas">></span><span lang="EN-US">_mapper is true but the bounds are ”not dirty”.If I use the same mapper for different actors, the mapper becomes “not dirty” and the bounds of the scene are not properly calculated. In this case the resetview does not fit the whole scene. At least this works for me.<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">void</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> vesActor::computeBounds()<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas">{<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> assert(<span style="color:blue">this</span>->m_mapper);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">if</span> (<span style="color:blue">this</span>->m_mapper && <span style="color:blue">this</span>->m_mapper->boundsDirty()) {<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">this</span>->m_mapper->computeBounds();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> vesVector3f min = transformPoint3f(<span style="color:blue">this</span>->matrix(), <span style="color:blue">this</span>->m_mapper->boundsMinimum());<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> vesVector3f max = transformPoint3f(<span style="color:blue">this</span>->matrix(), <span style="color:blue">this</span>->m_mapper->boundsMaximum());<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">this</span>->setBounds(min, max);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:green">// Since now we have new internal bounds, we would have to</span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:green">// calculate whole bounds for this actor once again.</span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">this</span>->setBoundsDirty(<span style="color:blue">true</span>);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">this</span>->setBoundsDirty(<span style="color:blue">false</span>);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">this</span>->setParentBoundsDirty(<span style="color:blue">true</span>);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> }<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">else</span> <span style="color:blue">if</span> (!<span style="color:blue">this</span>->m_mapper && <span style="color:blue">this</span>->boundsDirty()) {<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">this</span>->resetBounds();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"> }<span style="color:red">else <u></u><u></u></span></span></p><p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:red">{<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:red"> this->m_mapper->computeBounds();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:red"><u></u> <u></u></span></p><p class="MsoNormal" style="text-indent:35.4pt;text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:red"> vesVector3f min = transformPoint3f(this->matrix(), this->m_mapper->boundsMinimum());<u></u><u></u></span></p>
<p class="MsoNormal" style="text-indent:35.4pt;text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:red"> vesVector3f max = transformPoint3f(this->matrix(), this->m_mapper->boundsMaximum());<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:red"><u></u> <u></u></span></p><p class="MsoNormal" style="text-indent:35.4pt;text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:red"> this->setBounds(min, max);<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:red">}<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas">}<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US"> <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div></div><br>_______________________________________________<br>
Ves mailing list<br>
<a href="mailto:Ves@public.kitware.com">Ves@public.kitware.com</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/ves" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/ves</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>| Aashish Chaudhary <br>| R&D Engineer <br>| Kitware Inc. <br>| <a href="http://www.kitware.com">www.kitware.com</a>
</div>