Thank you for the responses. I want to share my solution (this is for
overlays manually used inside VtkMappers, I do not know what happens when
using the OverlayManager):

mitk::VtkMapper has a public method GetVtkProp(). If, instead of executing
AddToBaseRenderer()/RemoveFromBaseRenderer() in my mapper I obtain the
Overlay2D actors and return an assembly of them in my mapper GetVtkProp, I
solve two problems:
1) the visibility update works ok (updated immediately) without doing a
ForceImmediateUpdate.
2) when the node is deleted from the DataStorage the overlays are rendered
invisible (if we do not do this, GenerateDataForRenderer() of the mapper is
never called again and the Overlay will be always visible even thought the
node displaying them is deleted).

Now, a little technical issue: GetVtkProp() in VtkOverlays is not public,
so you would have to subclass your overlays and add a public
GetInternalVtkProp(). Of course, this is a coding horror, but I find no
other way without doing changes in MITK.

Thanks,

Fede

On Fri, Sep 18, 2015 at 6:59 AM, Hettich, Martin <
m.hett...@dkfz-heidelberg.de> wrote:

> Hi,
> I had the same issue with TextOverlay3D, did  not understand why
> it got delayed, and  used ForceImmediateUpdate() instead of Update()
> to "solve" this issue.
>
>
> http://docs.mitk.org/nightly/classmitk_1_1RenderingManager.html#aa4c8ec10e4dd6f921bbb6b405383d5ba
>
> Sorry about the typing error.
>
> -------- Original Message --------
> From: Federico Milano <fmil...@gmail.com>
> Sent: September 17, 2015 9:44:19 PM CEST
> To: mitk-users@lists.sourceforge.net
> Subject: [mitk-users] Overlay visibility in VtkMapper
>
> Hi. I'm having an issue with the overlays visibility in my mapper.
> In GenerateDataForRenderer() of my mapper I'm doing the following:
>
> GetDataNode()->GetVisibility(visible, renderer);
> m_TextOverlay2D->SetVisibility(visible);
> /* update some other things if necessary */
> m_TextOverlay2D->Update(renderer);
>
> where m_TextOverlay2D is a mitk::TextOverlay2D.
> The problem is that the visibility is not updated until the next rendering
> loop.
> Do you have any idea of what could be going on here?
> Thanks in advance,
> Fede
>
------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to