Page MenuHomePhabricator

Allow File/Open for scene serializations
Closed, ResolvedPublic

Description

Loading a scene is different to "normal" file readers (see T2646), so the usual file reader approach does not work.

If loading scenes should be possible via File/Open or Drag&Drop, the best place to implement it would be

CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkFileOpenAction.cpp and
CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkDnDFrameWidget.cpp

These files are both part of CoreUI, so CoreUI would need a dependency to SceneSerialization. I guess this is not wanted.

Sascha, what is the current status of this command framework? Would it be useful for enhancing the File/Open possibilities?

I leave this open for discussion, because I cannot see the best way to do it yet.

Event Timeline

Following our "Core" concept, "Black Forest" release, CoreUI can only depend on Core and I think scene serialization is not a Core feature.

OK, this bus is assigned to me, so I'm feeling urged to participate the discussion.

This is a balance of design principles and resulting work and maintenance issues.

SceneSerialization should be a QM module as it is a valuable feature in many products. But, the core should remain as plain as possible to ensure a manageable specification.

Are there viable ways to avoid the dependency?

I talked to Sascha and we came up with the following idea:

we will create a new bundle for the ExtApp that comes with its own workbench advisor class (which will be derived from the core workbench advisor). The new workbench advisor can change/enhance the menues that are present in the core application.

Sascha will implement the new application bundle, I will modify the workbench advisor to implement "File/Open" in a way that scenes can be opened and that there are menu items "File/Open project" and "File/Save project".

@all: would you rather call the things that we save "scene" or "project". I am not a user but would call it "project".

i think "project" is more intuitive for end user and as good as "scene" for developers

I made the necessary changes in my working copy, see the attachment for a specification.

CoreUI change request

[SVN revision 19488]
FIX (#2650): Adding new org.mitk.gui.qt.extapplication bundle. This bundle also replaces org.mitk.gui.qt.ext. Pulled out some code from org.mitk.gui.qt.application in order to make the CoreUI code more lightweight.

[SVN revision 19489]
COMP (#2650): fixing wrong import/export macro

[SVN revision 19649]
ENH (#2650): Further streamlined the workbench advisor classes for better reusability. The application bundles can now be completely independent from each other and hence multiple "default" perspectives (one in each application bundle) can be avoided.

This has already been fixed with T2864.

File/Open now loads .mitk scene files! But Drag&Drop of a .mitk scene file does not work yet (on Windows with a current checkout).

also, it seems that a global reinit is missing if a scene file is loaded.
If I start with an empty project and load a scene, nothing is displayed in the render windows until I click on "Global Reinit" in the DataManager or "Reset View" in the render window context menus.

(In reply to comment #16)

also, it seems that a global reinit is missing if a scene file is loaded.
If I start with an empty project and load a scene, nothing is displayed in the
render windows until I click on "Global Reinit" in the DataManager or "Reset
View" in the render window context menus.

I already fixed this (one statement was missing), I'll start a new bug with a core change request for this.

Then this bug can be considered fixed, right?

(In reply to comment #18)

Then this bug can be considered fixed, right?

After I can commit the fix in T2925...