[vtkusers] VTK size/interdependencies etc.
Dylan & Paula Nicholson
dpnich at optushome.com.au
Sat Dec 13 15:47:10 EST 2003
Hi all,
First, let me start off saying a huge thank you to everyone who has contributed towards VTK - it is, without doubt, the most comprehensive, powerful and easy-to-use graphics package I have yet seen. I only have one real qualm, which is the fact that you need to drag in so much code just to use a tiny piece of the functionality.
I spent a good few hours reducing the size of required files yesterday, but there's still huge slabs of code that I will never need, yet must be linked in because of apparently unnecessary interdependencies in the code.
In particular, vtkGraphicsFactory causes dependencies with all the volume ray cast/texture stuff that you can't avoid. For now, I've commented these out. For some reason I'm still stuck with a lot of vtkVolume stuff I don't need, although by modifying #include "vtkVolumeRayCastMapper.h" to #include "vtkVolumeMapper.h" in vtkVolume.cxx, I reduced the list considerably.
Indeed it's odd that just by including a header file you seem to drag in a bunch of dependencies, even though the code doesn't directly seem to reference them.
I believe the vtkGraphicsFactory problem can be fixed by using a dynamically created factory map (class name to creation function pointer) - that is, each class is responsible for putting its own entry in the factory map, although to be honest, if it was just done through a #define, it would be better than nothing.
I know library size isn't an issue for a lot of users, but it is for me, especially because library size can directly impact performance in lowish memory situations.
Oh, one other tiny thing - there's two memory leaks, one of which you can work around, the other that can't be. The first is the graphics factory itself, which requires a manual call to vtkObjectFactory::UnRegisterAllFactories() to dispose of, the other is the vtkTimerLog array, which currently there is no mechanism to free. It's just annoying because it took a while to determine that it wasn't a bug in my code that was leaking memory.
Thanks for any feedback
Dylan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20031214/6881be11/attachment.htm>
More information about the vtkusers
mailing list