[Smtk-developers] Resource manager question

David Thompson david.thompson at kitware.com
Sat Nov 4 14:17:44 EDT 2017


Hi TJ (et al.),

I have some questions about how to use the resource manager:

Let's say I have a VTK reader class that loads SMTK model files (one which is perhaps named vtkSMTKModelReader and located in smtk/extension/paraview/server). Since a file is a resource, making the reader behave as expected as far as both VTK and SMTK will be interesting.

1. VTK expects the reader object to work if the filename changes. This means the same reader can read multiple resources into the resource manager. Should the previous resource be removed when the reader's filename changes? If not, there will be things in memory that aren't shown on the screen.

2. Now let's say the file changes on disk or someone calls Modified() on the VTK reader... should it re-read the file? If it does, how should it go about this? By deleting the previous resource and calling read() again on the resource manager? This seems like it might work for PV-based applications where there's client-server separation. But in a standalone VTK app, it could be annoying since related GUI state like a model-tree view would get reset to empty before being re-populated with a default view in a different state than before.

3. Finally, there doesn't appear to be a way for the resource manager to find resources by location. If we don't do this, it will be possible to have the same file loaded into the application multiple times. That might seem like a feature at first ("But I wanted to load it twice and render different things on each copy!") until someone clicks save ("Why did it overwrite my model with an old copy!?").

	David


More information about the Smtk-developers mailing list