[Ves] Possible Bug in vesactor::computebounds

Aashish Chaudhary aashish.chaudhary at kitware.com
Tue Jun 25 17:54:41 EDT 2013


Hi Carlos,

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.

I will push a branch today to fix this issue. Thanks for reporting this.

- Aashish



On Tue, Jun 25, 2013 at 10:32 AM, Carlos <ves at calculoandamios.com> wrote:

> Hi,****
>
> ** **
>
> I think there is a bug in ****
>
> ** **
>
> void vesActor::computeBounds()****
>
> {****
>
>   assert(this->m_mapper);****
>
> ** **
>
>   if (this->m_mapper && this->m_mapper->boundsDirty()) {****
>
>     this->m_mapper->computeBounds();****
>
> ** **
>
>     vesVector3f min = transformPoint3f(this->matrix(), this
> ->m_mapper->boundsMinimum());****
>
>     vesVector3f max = transformPoint3f(this->matrix(), this
> ->m_mapper->boundsMaximum());****
>
> ** **
>
>     this->setBounds(min, max);****
>
> ** **
>
>     // Since now we have new internal bounds, we would have to****
>
>     // calculate whole bounds for this actor once again.****
>
>     this->setBoundsDirty(true);****
>
>     this->setBoundsDirty(false);****
>
>     this->setParentBoundsDirty(true);****
>
>   }****
>
>   else if (!this->m_mapper && this->boundsDirty()) {****
>
>     this->resetBounds();****
>
>   }****
>
> }****
>
> ** **
>
> I have included an additional checking  just in order that this->_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.****
>
> ** **
>
> void vesActor::computeBounds()****
>
> {****
>
>   assert(this->m_mapper);****
>
> ** **
>
>   if (this->m_mapper && this->m_mapper->boundsDirty()) {****
>
>     this->m_mapper->computeBounds();****
>
> ** **
>
>     vesVector3f min = transformPoint3f(this->matrix(), this
> ->m_mapper->boundsMinimum());****
>
>     vesVector3f max = transformPoint3f(this->matrix(), this
> ->m_mapper->boundsMaximum());****
>
> ** **
>
>     this->setBounds(min, max);****
>
> ** **
>
>     // Since now we have new internal bounds, we would have to****
>
>     // calculate whole bounds for this actor once again.****
>
>     this->setBoundsDirty(true);****
>
>     this->setBoundsDirty(false);****
>
>     this->setParentBoundsDirty(true);****
>
>   }****
>
>   else if (!this->m_mapper && this->boundsDirty()) {****
>
>     this->resetBounds();****
>
>   }else ****
>
> {****
>
>        this->m_mapper->computeBounds();****
>
> ** **
>
>     vesVector3f min = transformPoint3f(this->matrix(),
> this->m_mapper->boundsMinimum());****
>
>     vesVector3f max = transformPoint3f(this->matrix(),
> this->m_mapper->boundsMaximum());****
>
> ** **
>
>     this->setBounds(min, max);****
>
> }****
>
> ** **
>
> ** **
>
> ** **
>
> }****
>
> ** **
>
> ** **
>
> ****
>
> ** **
>
> _______________________________________________
> Ves mailing list
> Ves at public.kitware.com
> http://public.kitware.com/cgi-bin/mailman/listinfo/ves
>
>


-- 
| Aashish Chaudhary
| R&D Engineer
| Kitware Inc.
| www.kitware.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20130625/26763065/attachment-0001.html>


More information about the Ves mailing list