[vtkusers] Adding an ImageSlice to one renderer causes the image to disappear from a different renderer?
David Gobbi
david.gobbi at gmail.com
Thu Sep 1 14:53:17 EDT 2011
On Thu, Sep 1, 2011 at 12:33 PM, David Doria <daviddoria at gmail.com> wrote:
>> Do not try to share a mapper between multiple renderers. Some simple
>> mappers might work in this kind of configuration, but many will not.
>> Create a new mapper and actor for each renderer.
>>
>> - David
>
> Yep, that worked. I don't suppose there would be some way to throw an
> error/warning if this setup is attempted with a mapper that does not
> support being shared?
It wouldn't be easy. A mapper doesn't know when its actor is
connected to a renderer. It doesn't see the renderer until its Render
method is called, since the Renderer and Actor are passed as
parameters to the mapper Render method. Storing the renderer in an
internal variable would not be a good solution, because when the
mapper sees multiple renderers, it would not know if it was in both
renderers at once, or if it had just been moved from one renderer to
another.
Any sort of a fix would require modifying (or at least adding to) ways
that the mapper, actor, and renderer talk to each other. It would be
great if someone would take up the challenge, but I am not going to
hold my breath. Note that it would not be enough for someone to fix
the issue, it would also be necessary to add dashboard tests to ensure
that the fix sticks. (Experience has made me a bit pessimistic about
these things).
- David
More information about the vtkusers
mailing list