<html><head></head><body><div class="ydp75171053yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div><div>My solution to this kind of problem in the past has been to build a (non-clustered) sorted index for fast lookup on the collection, without changing the underlying collection itself. In fact multiple indicies could be built and (if desired) attached to the collection in a list. Of course it means that each index needs to be rebuilt, when anything is added to or removed from the collection. The most efficient way to do that is to set a flag when anything changes and then only rebuild the index the next time it is accessed.<br></div><div><br></div><div><br></div><div><br></div><div class="ydp75171053signature"><div style="font-size:16px;font-family:Helvetica, Arial, sans-serif;"><div>Todd Martin, PhD.<br></div><div><i>Freelance Engineer/Software Architect.</i></div><br></div></div></div>
        <div><br></div><div><br></div>
        
        </div><div id="yahoo_quoted_5635360879" class="yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Friday, 14 December 2018, 12:06:59 PM NZDT, David Gobbi <david.gobbi@gmail.com> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="yiv7840540130"><div><div dir="ltr">Hi Elvis,<div><br clear="none"></div><div>I don't think there are any fans of vtkCollection, but replacing it</div><div>with something modern would be lot of work and would provide</div><div>far less benefit than e.g. the recent reworking of the VTK data</div><div>arrays to provide flexible memory access patterns.</div><div><br clear="none"></div><div>Also, given the cost for vtkRenderer to render a bunch of props,</div><div>you would have to be doing many hundreds (thousands?) of</div><div>insertions/removals per render before the time required for those</div><div>operations becomes significant to overall app performance.</div><div><br clear="none"></div><div>  David</div><div><br clear="none"></div><div><br clear="none"><div class="yiv7840540130gmail_quote"><div class="yiv7840540130yqt6418243541" id="yiv7840540130yqtfd14644"><div dir="ltr">On Thu, Dec 13, 2018 at 3:33 PM Elvis Stansvik <<a rel="nofollow" shape="rect" ymailto="mailto:elvis.stansvik@orexplore.com" target="_blank" href="mailto:elvis.stansvik@orexplore.com">elvis.stansvik@orexplore.com</a>> wrote:<br clear="none"></div><blockquote class="yiv7840540130gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;">Hi all,<br clear="none">
<br clear="none">
The props of a vtkRenderer are kept in a vtkCollection (and probably<br clear="none">
have been since VTKs childhood), meaning linear time<br clear="none">
search/insert/remove.<br clear="none">
<br clear="none">
I realize the use of vtkCollection is pervasive in these classes, and<br clear="none">
also shines through in their API, so this is a bit of a long shot,<br clear="none">
but, is there any chance that it'll at some point be converted to use<br clear="none">
a sorted data structure, to permit logarithmic operations?<br clear="none">
<br clear="none">
Has anyone else had the need to rapidly insert/remove/check for props<br clear="none">
in a renderer with a large amounts of props in it? Has the idea of<br clear="none">
having vtkRenderer backed by something else been discussed before?<br clear="none">
<br clear="none">
Cheers,<br clear="none">
Elvis<br clear="none">
</blockquote></div></div></div></div></div></div><div class="yqt6418243541" id="yqtfd79468">_______________________________________________<br clear="none">Powered by www.kitware.com<br clear="none"><br clear="none">Visit other Kitware open-source projects at <a shape="rect" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br clear="none"><br clear="none">Search the list archives at: <a shape="rect" href="http://markmail.org/search/?q=vtk-developers" target="_blank">http://markmail.org/search/?q=vtk-developers</a><br clear="none"><br clear="none">Follow this link to subscribe/unsubscribe:<br clear="none"><a shape="rect" href="https://public.kitware.com/mailman/listinfo/vtk-developers" target="_blank">https://public.kitware.com/mailman/listinfo/vtk-developers</a><br clear="none"><br clear="none"></div></div>
            </div>
        </div></body></html>