Hi Martin, the use of the OverlayManager is not recommended in mappers because they don't provide a suitable interface for that. With the OverlayManager you would need to control two events, the creation and the removal of the overlay. But the mappers in mitk only provide you with the current render call.
Bug 18910 is actually kind of related to this, as the proposed solution would provide a method where the overlay can be deleted. It might be possible to use the OverlayManager savely then. I did not try to reproduce the vtk error yet, but I will look into it when working on the bug as well. I will try to do this before the next release. Regards Christoph On Tue, 2015-11-17 at 14:07 +0100, Martin Klemm wrote: > Hi, > > did anyone of you receive the vtk error message "Invalid layer for > renderer: not rendered." before? This message appears after I call > renderer->GetOverlayManager() the first time in my mapper. The overlay > manager itself works perfectly. Everything is placed properly and > nothing is missing. The only ugly thing is the vtk pop up error message. > > The error message is printed in the vtkRendererCollection.cxx in line 61. > > // Let the user know if they have put a renderer at an unused layer. > for (this->InitTraversal(rsit); (ren = this->GetNextRenderer(rsit)); ) > { > if (ren->GetLayer() < 0 || ren->GetLayer() >= numLayers) > { > vtkErrorMacro(<< "Invalid layer for renderer: not rendered."); > } > } > > numLayers is 2 and ren->GetLayer() returns also 2. If I understand it > properly GetOverlayManager creates a second layer to have the normal > renderer plus a foreground renderer. But where does the third renderer > in my case come from? I am using a 2015.05 build under Windows and a > custom QML application (not the workbench). > > After I read this note [1]: > > In order to integrate an Overlay into an mitk::Mapper, it is advised not > to use the OverlayManager but to manually manage the Overlay. > > I implemented the Overlay directly in my mapper which works without the > vtk error message. But I still do not understand why the previous > approach with the OverlayManager produce an error message and why it is > not recommended to use it. > > I also had to implement a workaround to remove the overlay from the > renderer because ReleaseGraphicsResources is not called. This bug was > reported here http://bugs.mitk.org/show_bug.cgi?id=18910 . Are there any > news regarding this bug? Do you plan to fix it for the next release? > > > Thanks in advance. > > Best > > Martin > > [1] > http://docs.mitk.org/nightly/OverlaysPage.html#OverlaysPage_ArchitectureSection > > ------------------------------------------------------------------------------ > _______________________________________________ > mitk-users mailing list > mitk-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mitk-users ------------------------------------------------------------------------------ Go from Idea to Many App Stores Faster with Intel(R) XDK Give your users amazing mobile app experiences with Intel(R) XDK. Use one codebase in this all-in-one HTML5 development environment. Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 _______________________________________________ mitk-users mailing list mitk-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mitk-users