As part of implementing a scene file loader, I would like to add the possibility to load scene files using the normal "File/Open" menu of ExtApp.
A major difference of scene loading compared to other file loaders is that the scene file reader must also recreate the hierarchy of multiple objects in DataStroage. Plain file readers only output a vector of DataTreeNodes without hierarchy.
If scenes should be loadable via File/Open, we have to create a way to tell a class called SceneFileReader an instance of DataStorage. (As DataStorage is no longer a singleton, there is no other way).
The code part that is used for File/Open is found in mitk/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkFileOpenAction.cpp. This code instantiates a mitk::DataTreeNodeFactory, uses this instance to load DataTreeNodes and adds all loaded nodes to the "current editor's data storage".
My proposed solution is to provide SetDataStorage(..) methods to the following classes:
mitk::DataTreeNodeFactory (entry point for FileOpenAction)
mitk::BaseDataIO (handles file reader factories)
mitk::IOAdapterBase (wrapper for file readers)
mitk::FileReader (interface for file readers)
SetDataStorage() and a respective GetDataStorage() method should be setter/getter methods for a member m_DataStorage.
mitk::IOAdaper<T>::CreateIOProcessObject would be modified to call SetDataStorage(..) on the appropriate mitk::FileReader. In cases where this is mitk::SceneFileReader, we would have a way to add read nodes to a data storage and create a hierarchy for them.