[vtk-developers] vtkViewPort->AddProp
Robert M.O'Bara
obara at simmetrix.com
Tue Feb 24 10:57:37 EST 2004
While looking into performance issues we've noticed that it takes a
long time to initially add a large number of actors to a renderer. It
seems that vtkViewPort's AddProp() function is checking to see if a
vtkProp is already in its collection and the way its doing it is via an
O(n) search.
This can be really painful if n is large.
Couple of questions:
1. Why make vtkViewport responsible for the check instead of the
consumer? vtkViewport already provides a mechanism to getting the prop
collection so if the application thinks its possible for something to
be accidently added more than once it can test for it itself.
2. If this is not desirable, then why not add an additional parameter
to AddProp (and vtkRenderer's AddActor) to optionally prevent the
check? It could be defaulted to always do the check if necessary.
Comments?
Robert M. O'Bara, MEng.
Senior Software Engineer
Simmetrix Inc.
10 Halfmoon Executive Park Drive
Clifton Park, NY 12065
Phone (518) 348-1639 x-104
More information about the vtk-developers
mailing list