Index: mitk/Core/Code/Algorithms/mitkCoreObjectFactory.cpp
===================================================================
--- mitk/Core/Code/Algorithms/mitkCoreObjectFactory.cpp	(revision 21196)
+++ mitk/Core/Code/Algorithms/mitkCoreObjectFactory.cpp	(working copy)
@@ -299,8 +299,7 @@
 
 #define INTERNAL_FILE_EXTENSIONS \
     "all (*.seq *.mps *.nii *.pic *.pic.gz *.seq.gz *.pvtk *.stl *.vtk *.vtp *.vtu *.obj *.vti *.ves *.nrrd *.nhdr " \
-         "*.uvg *.dvg *.par *.dcm *.dc3 *.gdcm *.ima *.mhd *.hdr hpsonos.db HPSONOS.DB *.ssm *msm *.bmp *.png *.jpg *.tiff *.mitk);;" \
-    "Project files(*.mitk);;" \
+         "*.uvg *.dvg *.par *.dcm *.dc3 *.gdcm *.ima *.mhd *.hdr hpsonos.db HPSONOS.DB *.ssm *msm *.bmp *.png *.jpg *.tiff);;" \
     "DKFZ Pic (*.seq *.pic *.pic.gz *.seq.gz);;" \
     "NRRD Vector Images (*.nrrd *.nhdr);;" \
     "Point sets (*.mps);;" \
Index: mitk/CoreUI/Bundles/org.mitk.gui.qt.common/CMakeLists.txt
===================================================================
--- mitk/CoreUI/Bundles/org.mitk.gui.qt.common/CMakeLists.txt	(revision 21196)
+++ mitk/CoreUI/Bundles/org.mitk.gui.qt.common/CMakeLists.txt	(working copy)
@@ -1 +1 @@
-MACRO_CREATE_MITK_PLUGIN(Qmitk SceneSerialization)
+MACRO_CREATE_MITK_PLUGIN(Qmitk)
Index: mitk/CoreUI/Bundles/org.mitk.gui.qt.common/files.cmake
===================================================================
--- mitk/CoreUI/Bundles/org.mitk.gui.qt.common/files.cmake	(revision 21196)
+++ mitk/CoreUI/Bundles/org.mitk.gui.qt.common/files.cmake	(working copy)
@@ -3,7 +3,6 @@
   QmitkDnDFrameWidget.cpp
   QmitkDataTreeNodeSelectionProvider.cpp
   QmitkFileOpenAction.cpp
-  QmitkFileSaveProjectAction.cpp
   QmitkFileExitAction.cpp
   QmitkFunctionality.cpp
   QmitkProgressBar.cpp
@@ -21,7 +20,6 @@
 SET(MOC_H_FILES
   src/QmitkCloseProjectAction.h
   src/QmitkFileOpenAction.h
-  src/QmitkFileSaveProjectAction.h
   src/QmitkFileExitAction.h
   src/QmitkProgressBar.h
   src/QmitkPreferencesDialog.h
Index: mitk/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkDnDFrameWidget.cpp
===================================================================
--- mitk/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkDnDFrameWidget.cpp	(revision 21196)
+++ mitk/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkDnDFrameWidget.cpp	(working copy)
@@ -16,8 +16,6 @@
 #include "mitkNodePredicateNOT.h"
 #include "mitkNodePredicateProperty.h"
 
-
-#include "mitkSceneIO.h"
 #include "mitkProgressBar.h"
 
 QmitkDnDFrameWidget::QmitkDnDFrameWidget(QWidget *parent)
@@ -48,39 +46,28 @@
   for (QList<QUrl>::Iterator fileName = fileNames.begin();
     fileName != fileNames.end(); ++fileName)
   {
-    if ( fileName->toLocalFile().right(5) == ".mitk" ) 
-    {
-      mitk::SceneIO::Pointer sceneIO = mitk::SceneIO::New();
 
-      bool clearDataStorageFirst(false);
-      mitk::ProgressBar::GetInstance()->AddStepsToDo(2);
-      ds = sceneIO->LoadScene( fileName->toLocalFile().toLocal8Bit().constData(), ds, clearDataStorageFirst );
-      dsmodified = true;
-      mitk::ProgressBar::GetInstance()->Progress(2);
-    }
-    else
+    mitk::DataTreeNodeFactory::Pointer nodeReader = mitk::DataTreeNodeFactory::New();
+    try
     {
-      mitk::DataTreeNodeFactory::Pointer nodeReader = mitk::DataTreeNodeFactory::New();
-      try
+      nodeReader->SetFileName(fileName->toLocalFile().toLatin1().data());
+      nodeReader->Update();
+      for ( unsigned int i = 0 ; i < nodeReader->GetNumberOfOutputs( ); ++i )
       {
-        nodeReader->SetFileName(fileName->toLocalFile().toLatin1().data());
-        nodeReader->Update();
-        for ( unsigned int i = 0 ; i < nodeReader->GetNumberOfOutputs( ); ++i )
-        {
-          mitk::DataTreeNode::Pointer node;
-          node = nodeReader->GetOutput(i);
-          if ( node->GetData() != NULL )
-          {  
-            ds->Add(node);
-            dsmodified = true;
-          }
+        mitk::DataTreeNode::Pointer node;
+        node = nodeReader->GetOutput(i);
+        if ( node->GetData() != NULL )
+        {  
+          ds->Add(node);
+          dsmodified = true;
         }
       }
-      catch(...)
-      {
+    }
+    catch(...)
+    {
 
-      }
     }
+
   }
   
   if(dsmodified)
Index: mitk/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkFileOpenAction.cpp
===================================================================
--- mitk/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkFileOpenAction.cpp	(revision 21196)
+++ mitk/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkFileOpenAction.cpp	(working copy)
@@ -21,7 +21,6 @@
 #include <QFileInfo>
 #include <mitkDataTreeNodeFactory.h>
 
-#include "mitkSceneIO.h"
 #include "mitkProgressBar.h"
 
 #include <mitkCoreObjectFactory.h>
@@ -125,39 +124,28 @@
   for (QStringList::Iterator fileName = fileNames.begin();
     fileName != fileNames.end(); ++fileName)
   {
-    if ( fileName->right(5) == ".mitk" ) 
-    {
-      mitk::SceneIO::Pointer sceneIO = mitk::SceneIO::New();
 
-      bool clearDataStorageFirst(false);
-      mitk::ProgressBar::GetInstance()->AddStepsToDo(2);
-      dataStorage = sceneIO->LoadScene( fileName->toLocal8Bit().constData(), dataStorage, clearDataStorageFirst );
-      dsmodified = true;
-      mitk::ProgressBar::GetInstance()->Progress(2);
-    }
-    else
+    mitk::DataTreeNodeFactory::Pointer nodeReader = mitk::DataTreeNodeFactory::New();
+    try
     {
-      mitk::DataTreeNodeFactory::Pointer nodeReader = mitk::DataTreeNodeFactory::New();
-      try
+      nodeReader->SetFileName(fileName->toStdString());
+      nodeReader->Update();
+      for ( unsigned int i = 0 ; i < nodeReader->GetNumberOfOutputs( ); ++i )
       {
-        nodeReader->SetFileName(fileName->toStdString());
-        nodeReader->Update();
-        for ( unsigned int i = 0 ; i < nodeReader->GetNumberOfOutputs( ); ++i )
-        {
-          mitk::DataTreeNode::Pointer node;
-          node = nodeReader->GetOutput(i);
-          if ( node->GetData() != NULL )
-          {  
-            dataStorage->Add(node);
-            dsmodified = true;
-          }
+        mitk::DataTreeNode::Pointer node;
+        node = nodeReader->GetOutput(i);
+        if ( node->GetData() != NULL )
+        {  
+          dataStorage->Add(node);
+          dsmodified = true;
         }
       }
-      catch(...)
-      {
+    }
+    catch(...)
+    {
 
-      }
     }
+
   }
   
   if (multiWidgetEditor.IsNull())
Index: mitk/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkFileSaveProjectAction.cpp
===================================================================
--- mitk/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkFileSaveProjectAction.cpp	(revision 21196)
+++ mitk/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkFileSaveProjectAction.cpp	(working copy)
@@ -1,139 +0,0 @@
-/*=========================================================================
-
-Program:   Medical Imaging & Interaction Toolkit
-Language:  C++
-Date:      $Date: 2009-10-07 16:14:59 +0200 (Mi, 07 Okt 2009) $
-Version:   $Revision: 19343 $
-
-Copyright (c) German Cancer Research Center, Division of Medical and
-Biological Informatics. All rights reserved.
-See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
-
-This software is distributed WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.  See the above copyright notices for more information.
-
-=========================================================================*/
-
-#include "QmitkFileSaveProjectAction.h"
-
-#include <QFileDialog>
-#include <QMessageBox>
-
-#include "mitkSceneIO.h"
-#include "mitkProgressBar.h"
-#include <mitkNodePredicateNOT.h>
-#include <mitkNodePredicateProperty.h>
-#include <mitkProperties.h>
-
-#include <mitkCoreObjectFactory.h>
-#include <mitkDataStorageEditorInput.h>
-#include <berryIEditorPart.h>
-#include <berryIWorkbenchPage.h>
-
-#include "QmitkStdMultiWidgetEditor.h"
-
-QmitkFileSaveProjectAction::QmitkFileSaveProjectAction(berry::IWorkbenchWindow::Pointer window)
-: QAction(0)
-{
-  m_Window = window;
-  this->setParent(static_cast<QWidget*>(m_Window->GetShell()->GetControl()));
-  this->setText("&Save Project...");
-  this->setToolTip("Save content of Data Manager as a .mitk project file");
-  m_Window = window;
-
-  this->connect(this, SIGNAL(triggered(bool)), this, SLOT(Run()));
-}
-
-void QmitkFileSaveProjectAction::Run()
-{
-  try
-  {
-    QString fileName = QFileDialog::getSaveFileName(NULL, "Save MITK scene", QString::null, "MITK scene files (*.mitk)", NULL );
-
-    if (fileName.isEmpty() ) 
-      return;
-
-    if ( fileName.right(5) != ".mitk" ) 
-      fileName += ".mitk";
-
-    mitk::SceneIO::Pointer sceneIO = mitk::SceneIO::New();
-
-    mitk::DataStorageEditorInput::Pointer editorInput;
-    mitk::DataStorage::Pointer storage;
-    QmitkStdMultiWidgetEditor::Pointer multiWidgetEditor;
-    berry::IEditorPart::Pointer editor = m_Window->GetActivePage()->GetActiveEditor();
-    if (editor.Cast<QmitkStdMultiWidgetEditor>().IsNull())
-    {
-      editorInput = new mitk::DataStorageEditorInput();
-      storage = editorInput->GetDataStorageReference()->GetDataStorage();
-    }
-    else
-    {
-      multiWidgetEditor = editor.Cast<QmitkStdMultiWidgetEditor>();
-      storage = multiWidgetEditor->GetEditorInput().Cast<mitk::DataStorageEditorInput>()->GetDataStorageReference()->GetDataStorage();
-    }
-
-    mitk::ProgressBar::GetInstance()->AddStepsToDo(2);
-
-    /* Build list of nodes that should be saved */
-    
-    mitk::NodePredicateNOT::Pointer isNotHelperObject = mitk::NodePredicateNOT::New(mitk::NodePredicateProperty::New("helper object", mitk::BoolProperty::New(true)));
-
-    mitk::DataStorage::SetOfObjects::ConstPointer nodesToBeSaved = storage->GetSubset(isNotHelperObject);
-    if ( !sceneIO->SaveScene( nodesToBeSaved, storage, fileName.toLocal8Bit().constData() ) )
-    {
-      QMessageBox::information(NULL,
-        "Scene saving",
-        "Scene could not be written completely. Please check the log.",
-        QMessageBox::Ok);
-
-    }
-    mitk::ProgressBar::GetInstance()->Progress(2);
-
-    mitk::SceneIO::FailedBaseDataListType::ConstPointer failedNodes = sceneIO->GetFailedNodes();
-    if (failedNodes.IsNotNull())
-    {
-      std::stringstream ss;
-      ss << "The following nodes could not be serialized:" << std::endl;
-      for ( mitk::SceneIO::FailedBaseDataListType::const_iterator iter = failedNodes->begin();
-        iter != failedNodes->end();
-        ++iter )
-      {
-        ss << " - ";
-        if ( mitk::BaseData* data =(*iter)->GetData() )
-        {
-          ss << data->GetNameOfClass();
-        }
-        else
-        {
-          ss << "(NULL)";
-        }
-
-        ss << " contained in node '" << (*iter)->GetName() << "'" << std::endl;
-      }
-
-      MITK_WARN << ss.str();
-    }
-
-    mitk::PropertyList::ConstPointer failedProperties = sceneIO->GetFailedProperties();
-    if (failedProperties.IsNotNull())
-    {
-      std::stringstream ss;
-      ss << "The following properties could not be serialized:" << std::endl;
-      const mitk::PropertyList::PropertyMap* propmap = failedProperties->GetMap();
-      for ( mitk::PropertyList::PropertyMap::const_iterator iter = propmap->begin();
-        iter != propmap->end();
-        ++iter )
-      {
-        ss << " - " << iter->second.first->GetNameOfClass() << " associated to key '" << iter->first << "'" << std::endl;
-      }
-
-      MITK_WARN << ss.str();
-    }
-  }
-  catch (std::exception& e)
-  {
-    MITK_ERROR << "Exception caught during scene saving: " << e.what();
-  }
-}
Index: mitk/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkFileSaveProjectAction.h
===================================================================
--- mitk/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkFileSaveProjectAction.h	(revision 21196)
+++ mitk/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkFileSaveProjectAction.h	(working copy)
@@ -1,52 +0,0 @@
-/*=========================================================================
-
-Program:   Medical Imaging & Interaction Toolkit
-Language:  C++
-Date:      $Date: 2009-10-09 16:36:23 +0200 (Fr, 09 Okt 2009) $
-Version:   $Revision: 19414 $
-
-Copyright (c) German Cancer Research Center, Division of Medical and
-Biological Informatics. All rights reserved.
-See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
-
-This software is distributed WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE.  See the above copyright notices for more information.
-
-=========================================================================*/
-
-#ifndef QmitkFileSaveProjectAction_H_
-#define QmitkFileSaveProjectAction_H_
-
-#ifdef __MINGW32__
-// We need to inlclude winbase.h here in order to declare
-// atomic intrinsics like InterlockedIncrement correctly.
-// Otherwhise, they would be declared wrong within qatomic_windows.h .
-#include <windows.h>
-#endif
-
-#include <QAction>
-
-#include "mitkQtCommonDll.h"
-
-#include <berryIWorkbenchWindow.h>
-
-class MITK_QT_COMMON QmitkFileSaveProjectAction : public QAction
-{
-  Q_OBJECT
-
-public:
-
-  QmitkFileSaveProjectAction(berry::IWorkbenchWindow::Pointer window);
-
-protected slots:
-
-  void Run();
-
-private:
-
-  berry::IWorkbenchWindow::Pointer m_Window;
-};
-
-
-#endif /*QmitkFileSaveProjectAction_H_*/
Index: mitk/Modules/Bundles/org.mitk.gui.qt.ext/CMakeLists.txt
===================================================================
--- mitk/Modules/Bundles/org.mitk.gui.qt.ext/CMakeLists.txt	(revision 21196)
+++ mitk/Modules/Bundles/org.mitk.gui.qt.ext/CMakeLists.txt	(working copy)
@@ -1,2 +1,2 @@
 
-MACRO_CREATE_MITK_PLUGIN(QmitkExt)
+MACRO_CREATE_MITK_PLUGIN(QmitkExt SceneSerialization)
Index: mitk/Modules/Bundles/org.mitk.gui.qt.ext/files.cmake
===================================================================
--- mitk/Modules/Bundles/org.mitk.gui.qt.ext/files.cmake	(revision 21196)
+++ mitk/Modules/Bundles/org.mitk.gui.qt.ext/files.cmake	(working copy)
@@ -1,6 +1,9 @@
 SET(SRC_CPP_FILES
   QmitkExtActionBarAdvisor.cpp
   QmitkExtWorkbenchWindowAdvisor.cpp
+  QmitkExtFileOpenAction.cpp
+  QmitkExtDnDFrameWidget.cpp
+  QmitkExtFileSaveProjectAction.cpp
 )
 
 SET(INTERNAL_CPP_FILES
@@ -13,6 +16,10 @@
 
 SET(MOC_H_FILES
   src/internal/QmitkExtWorkbenchWindowAdvisorHack.h
+  src/QmitkExtFileOpenAction.h
+  src/QmitkExtFileSaveProjectAction.h
+  src/QmitkExtDnDFrameWidget.h
+  
 )
 
 SET(RESOURCE_FILES
Index: mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtDnDFrameWidget.cpp
===================================================================
--- mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtDnDFrameWidget.cpp	(revision 0)
+++ mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtDnDFrameWidget.cpp	(revision 0)
@@ -0,0 +1,99 @@
+
+#include <QmitkExtDnDFrameWidget.h>
+#include <QtGui>
+
+
+// berry Includes
+#include <berryPlatform.h>
+
+#include <mitkDataTreeNodeFactory.h>
+#include "mitkIDataStorageService.h"
+#include "mitkDataStorageEditorInput.h"
+#include "mitkRenderingManager.h"
+
+#include "mitkProperties.h"
+#include "mitkNodePredicateData.h"
+#include "mitkNodePredicateNOT.h"
+#include "mitkNodePredicateProperty.h"
+
+
+#include "mitkSceneIO.h"
+#include "mitkProgressBar.h"
+
+QmitkExtDnDFrameWidget::QmitkExtDnDFrameWidget(QWidget *parent)
+  : QWidget(parent)
+{
+   setAcceptDrops(true);
+}
+
+void QmitkExtDnDFrameWidget::dragEnterEvent( QDragEnterEvent *event )
+{   // accept drags
+  event->accept();
+}
+void QmitkExtDnDFrameWidget::dropEvent( QDropEvent * event )
+{ //open dragged files
+  
+  mitk::IDataStorageService::Pointer service = 
+    berry::Platform::GetServiceRegistry().GetServiceById<mitk::IDataStorageService>(mitk::IDataStorageService::ID);
+  
+  mitk::DataStorage::Pointer ds;
+  if (service.IsNotNull())
+    ds = service->GetActiveDataStorage()->GetDataStorage();
+  else
+    return;
+  
+  QList<QUrl> fileNames = event->mimeData()->urls();
+  
+  bool dsmodified = false;
+  for (QList<QUrl>::Iterator fileName = fileNames.begin();
+    fileName != fileNames.end(); ++fileName)
+  {
+    if ( fileName->toLocalFile().right(5) == ".mitk" ) 
+    {
+      mitk::SceneIO::Pointer sceneIO = mitk::SceneIO::New();
+
+      bool clearDataStorageFirst(false);
+      mitk::ProgressBar::GetInstance()->AddStepsToDo(2);
+      ds = sceneIO->LoadScene( fileName->toLocalFile().toLocal8Bit().constData(), ds, clearDataStorageFirst );
+      dsmodified = true;
+      mitk::ProgressBar::GetInstance()->Progress(2);
+    }
+    else
+    {
+      mitk::DataTreeNodeFactory::Pointer nodeReader = mitk::DataTreeNodeFactory::New();
+      try
+      {
+        nodeReader->SetFileName(fileName->toLocalFile().toLatin1().data());
+        nodeReader->Update();
+        for ( unsigned int i = 0 ; i < nodeReader->GetNumberOfOutputs( ); ++i )
+        {
+          mitk::DataTreeNode::Pointer node;
+          node = nodeReader->GetOutput(i);
+          if ( node->GetData() != NULL )
+          {  
+            ds->Add(node);
+            dsmodified = true;
+          }
+        }
+      }
+      catch(...)
+      {
+
+      }
+    }
+  }
+  
+  if(dsmodified)
+  {
+    // get all nodes that have not set "includeInBoundingBox" to false
+    mitk::NodePredicateNOT::Pointer pred 
+      = mitk::NodePredicateNOT::New(mitk::NodePredicateProperty::New("includeInBoundingBox"
+      , mitk::BoolProperty::New(false)));
+
+    mitk::DataStorage::SetOfObjects::ConstPointer rs = ds->GetSubset(pred);
+    // calculate bounding geometry of these nodes
+    mitk::TimeSlicedGeometry::Pointer bounds = ds->ComputeBoundingGeometry3D(rs);
+    // initialize the views to the bounding geometry
+    mitk::RenderingManager::GetInstance()->InitializeViews(bounds);
+  }
+}
\ No newline at end of file

Property changes on: mitk\Modules\Bundles\org.mitk.gui.qt.ext\src\QmitkExtDnDFrameWidget.cpp
___________________________________________________________________
Added: svn:eol-style
   + native

Index: mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtDnDFrameWidget.h
===================================================================
--- mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtDnDFrameWidget.h	(revision 0)
+++ mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtDnDFrameWidget.h	(revision 0)
@@ -0,0 +1,51 @@
+/*=========================================================================
+
+Program:   Medical Imaging & Interaction Toolkit
+Language:  C++
+Date:      $Date: 2009-02-10 14:14:32 +0100 (Di, 10 Feb 2009) $
+Version:   $Revision: 16224 $
+
+Copyright (c) German Cancer Research Center, Division of Medical and
+Biological Informatics. All rights reserved.
+See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
+
+This software is distributed WITHOUT ANY WARRANTY; without even
+the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE.  See the above copyright notices for more information.
+
+=========================================================================*/
+
+#ifndef QmitkExtDndFrameWidget_h
+#define QmitkExtDndFrameWidget_h
+
+#ifdef __MINGW32__
+// We need to inlclude winbase.h here in order to declare
+// atomic intrinsics like InterlockedIncrement correctly.
+// Otherwhise, they would be declared wrong within qatomic_windows.h .
+#include <windows.h>
+#endif
+
+#include <QWidget>
+#include "mitkQtCommonExtDll.h"
+//drag&drop
+class QDragEnterEvent;
+class QDropEvent;
+class QMouseEvent;
+
+class MITK_QT_COMMON_EXT_EXPORT QmitkExtDnDFrameWidget : public QWidget
+{
+  Q_OBJECT
+
+public:
+  QmitkExtDnDFrameWidget(QWidget *parent);
+  
+
+private:
+  void dragEnterEvent( QDragEnterEvent *event );
+  void dropEvent( QDropEvent * event );
+
+ 
+};
+
+
+#endif 

Property changes on: mitk\Modules\Bundles\org.mitk.gui.qt.ext\src\QmitkExtDnDFrameWidget.h
___________________________________________________________________
Added: svn:eol-style
   + native

Index: mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtFileOpenAction.cpp
===================================================================
--- mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtFileOpenAction.cpp	(revision 0)
+++ mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtFileOpenAction.cpp	(revision 0)
@@ -0,0 +1,197 @@
+/*=========================================================================
+
+Program:   Medical Imaging & Interaction Toolkit
+Language:  C++
+Date:      $Date: 2010-01-16 19:57:43 +0100 (Sa, 16 Jan 2010) $
+Version:   $Revision: 21070 $
+
+Copyright (c) German Cancer Research Center, Division of Medical and
+Biological Informatics. All rights reserved.
+See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
+
+This software is distributed WITHOUT ANY WARRANTY; without even
+the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE.  See the above copyright notices for more information.
+
+=========================================================================*/
+
+#include "QmitkExtFileOpenAction.h"
+
+#include <QFileDialog>
+#include <QFileInfo>
+#include <mitkDataTreeNodeFactory.h>
+
+#include "mitkSceneIO.h"
+#include "mitkProgressBar.h"
+
+#include <mitkCoreExtObjectFactory.h>
+#include <mitkDataStorageEditorInput.h>
+#include <berryIEditorPart.h>
+#include <berryIWorkbenchPage.h>
+#include <berryIPreferencesService.h>
+#include <berryPlatform.h>
+
+#include "mitkProperties.h"
+#include "mitkNodePredicateData.h"
+#include "mitkNodePredicateNOT.h"
+#include "mitkNodePredicateProperty.h"
+
+
+#include "QmitkStdMultiWidgetEditor.h"
+
+QmitkExtFileOpenAction::QmitkExtFileOpenAction(berry::IWorkbenchWindow::Pointer window)
+: QAction(0)
+{
+  this->init(window);
+}
+
+QmitkExtFileOpenAction::QmitkExtFileOpenAction(const QIcon & icon, berry::IWorkbenchWindow::Pointer window)
+: QAction(0)
+{
+  this->setIcon(icon);
+
+  this->init(window);
+}
+
+void QmitkExtFileOpenAction::init(berry::IWorkbenchWindow::Pointer window)
+{
+  m_Window = window;
+  this->setParent(static_cast<QWidget*>(m_Window->GetShell()->GetControl()));
+  this->setText("&Open...");
+  this->setToolTip("Open data files (images, surfaces,...) and project files (.mitk)");
+
+  berry::IPreferencesService::Pointer prefService
+    = berry::Platform::GetServiceRegistry()
+    .GetServiceById<berry::IPreferencesService>(berry::IPreferencesService::ID);
+  m_GeneralPreferencesNode = prefService->GetSystemPreferences()->Node("/General");
+
+  this->connect(this, SIGNAL(triggered(bool)), this, SLOT(Run()));
+}
+
+void QmitkExtFileOpenAction::Run()
+{
+  /**
+   * @brief stores the last path of last opened file
+   */
+  static QString m_LastPath;
+
+  if(m_GeneralPreferencesNode.Lock().IsNotNull())
+  {
+    if(m_LastPath.isEmpty())
+      m_LastPath = QString::fromStdString(m_GeneralPreferencesNode.Lock()->Get("LastFileOpenPath", ""));
+  }
+
+
+  //QFileDialog dialog(static_cast<QWidget*>(m_Window->GetShell()->GetControl()));
+  //dialog.setFileMode(QFileDialog::ExistingFiles);
+  //QStringList filters;
+  //filters << "Images (*.pic *.pic.gz *.vti *.dcm *.nhdr *.nrrd *.mhd)" 
+  //  << "Surfaces (*.stl *.vtk *.vtp)"
+  //  << "MITK Pointset (*.mps)"
+  //  << "All Files (*.*)";
+  //dialog.setFilters(filters);
+  std::stringstream ss;
+  ss << mitk::CoreExtObjectFactory::GetInstance()->GetFileExtensions();
+  std::string fileExtensions = ss.str();
+  fileExtensions.append(";; MITK Scene Files (*.mitk)");
+
+  fileExtensions.insert( fileExtensions.find("formats(") + 8, "*.mitk " );
+
+  MITK_INFO << fileExtensions;
+  
+  QStringList fileNames = QFileDialog::getOpenFileNames(NULL,"Open",m_LastPath, fileExtensions.c_str() );
+
+  //if (dialog.exec())
+  //  fileNames = dialog.selectedFiles();
+
+  if (fileNames.empty()) 
+    return;
+
+  QFileInfo info(fileNames.at(0));
+  m_LastPath = info.filePath();
+  if(m_GeneralPreferencesNode.Lock().IsNotNull())
+  {
+    m_GeneralPreferencesNode.Lock()->Put("LastFileOpenPath", m_LastPath.toStdString());
+    m_GeneralPreferencesNode.Lock()->Flush();
+  }
+
+  mitk::DataStorageEditorInput::Pointer editorInput;
+  mitk::DataStorage::Pointer dataStorage;
+  QmitkStdMultiWidgetEditor::Pointer multiWidgetEditor;
+  berry::IEditorPart::Pointer editor = m_Window->GetActivePage()->GetActiveEditor();
+  if (editor.Cast<QmitkStdMultiWidgetEditor>().IsNull())
+  {
+    editorInput = new mitk::DataStorageEditorInput();
+    dataStorage = editorInput->GetDataStorageReference()->GetDataStorage();
+  }
+  else
+  {
+    multiWidgetEditor = editor.Cast<QmitkStdMultiWidgetEditor>();
+    dataStorage = multiWidgetEditor->GetEditorInput().Cast<mitk::DataStorageEditorInput>()->GetDataStorageReference()->GetDataStorage();
+  }
+
+  bool dsmodified = false;
+  for (QStringList::Iterator fileName = fileNames.begin();
+    fileName != fileNames.end(); ++fileName)
+  {
+    if ( fileName->right(5) == ".mitk" ) 
+    {
+      mitk::SceneIO::Pointer sceneIO = mitk::SceneIO::New();
+
+      bool clearDataStorageFirst(false);
+      mitk::ProgressBar::GetInstance()->AddStepsToDo(2);
+      dataStorage = sceneIO->LoadScene( fileName->toLocal8Bit().constData(), dataStorage, clearDataStorageFirst );
+      dsmodified = true;
+      mitk::ProgressBar::GetInstance()->Progress(2);
+    }
+    else
+    {
+      mitk::DataTreeNodeFactory::Pointer nodeReader = mitk::DataTreeNodeFactory::New();
+      try
+      {
+        nodeReader->SetFileName(fileName->toStdString());
+        nodeReader->Update();
+        for ( unsigned int i = 0 ; i < nodeReader->GetNumberOfOutputs( ); ++i )
+        {
+          mitk::DataTreeNode::Pointer node;
+          node = nodeReader->GetOutput(i);
+          if ( node->GetData() != NULL )
+          {  
+            dataStorage->Add(node);
+            dsmodified = true;
+          }
+        }
+      }
+      catch(...)
+      {
+
+      }
+    }
+  }
+  
+  if (multiWidgetEditor.IsNull())
+  {
+    berry::IEditorPart::Pointer editor = m_Window->GetActivePage()->OpenEditor(editorInput, QmitkStdMultiWidgetEditor::EDITOR_ID);
+    multiWidgetEditor = editor.Cast<QmitkStdMultiWidgetEditor>();
+  }
+  else
+  {
+    multiWidgetEditor->GetStdMultiWidget()->RequestUpdate();
+  }
+
+  if(dsmodified)
+  {
+    // get all nodes that have not set "includeInBoundingBox" to false
+    mitk::NodePredicateNOT::Pointer pred 
+      = mitk::NodePredicateNOT::New(mitk::NodePredicateProperty::New("includeInBoundingBox"
+      , mitk::BoolProperty::New(false)));
+
+    mitk::DataStorage::SetOfObjects::ConstPointer rs = dataStorage->GetSubset(pred);
+    // calculate bounding geometry of these nodes
+    mitk::TimeSlicedGeometry::Pointer bounds = dataStorage->ComputeBoundingGeometry3D(rs);
+    // initialize the views to the bounding geometry
+    mitk::RenderingManager::GetInstance()->InitializeViews(bounds);
+  }
+
+ 
+}

Property changes on: mitk\Modules\Bundles\org.mitk.gui.qt.ext\src\QmitkExtFileOpenAction.cpp
___________________________________________________________________
Added: svn:eol-style
   + native

Index: mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtFileOpenAction.h
===================================================================
--- mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtFileOpenAction.h	(revision 0)
+++ mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtFileOpenAction.h	(revision 0)
@@ -0,0 +1,55 @@
+/*=========================================================================
+
+Program:   Medical Imaging & Interaction Toolkit
+Language:  C++
+Date:      $Date: 2010-01-16 19:57:43 +0100 (Sa, 16 Jan 2010) $
+Version:   $Revision: 21070 $
+
+Copyright (c) German Cancer Research Center, Division of Medical and
+Biological Informatics. All rights reserved.
+See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
+
+This software is distributed WITHOUT ANY WARRANTY; without even
+the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE.  See the above copyright notices for more information.
+
+=========================================================================*/
+
+#ifndef QMITKEXTFILEOPENACTION_H_
+#define QMITKEXTFILEOPENACTION_H_
+
+#ifdef __MINGW32__
+// We need to inlclude winbase.h here in order to declare
+// atomic intrinsics like InterlockedIncrement correctly.
+// Otherwhise, they would be declared wrong within qatomic_windows.h .
+#include <windows.h>
+#endif
+
+#include <QAction>
+#include <QIcon>
+
+#include "mitkQtCommonExtDll.h"
+
+#include <berryIWorkbenchWindow.h>
+#include <berryIPreferences.h>
+
+class MITK_QT_COMMON_EXT_EXPORT QmitkExtFileOpenAction : public QAction
+{
+  Q_OBJECT
+
+public:
+  QmitkExtFileOpenAction(berry::IWorkbenchWindow::Pointer window);
+  QmitkExtFileOpenAction(const QIcon & icon, berry::IWorkbenchWindow::Pointer window);
+
+protected slots:
+
+  void Run();
+
+private:
+  void init ( berry::IWorkbenchWindow::Pointer window );
+  berry::IWorkbenchWindow::Pointer m_Window;
+  berry::IPreferences::WeakPtr m_GeneralPreferencesNode;
+};
+
+
+#endif /*QMITKEXTFILEOPENACTION_H_*/

Property changes on: mitk\Modules\Bundles\org.mitk.gui.qt.ext\src\QmitkExtFileOpenAction.h
___________________________________________________________________
Added: svn:eol-style
   + native

Index: mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtFileSaveProjectAction.cpp
===================================================================
--- mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtFileSaveProjectAction.cpp	(revision 21196)
+++ mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtFileSaveProjectAction.cpp	(working copy)
@@ -15,7 +15,7 @@
 
 =========================================================================*/
 
-#include "QmitkFileSaveProjectAction.h"
+#include "QmitkExtFileSaveProjectAction.h"
 
 #include <QFileDialog>
 #include <QMessageBox>
@@ -33,7 +33,7 @@
 
 #include "QmitkStdMultiWidgetEditor.h"
 
-QmitkFileSaveProjectAction::QmitkFileSaveProjectAction(berry::IWorkbenchWindow::Pointer window)
+QmitkExtFileSaveProjectAction::QmitkExtFileSaveProjectAction(berry::IWorkbenchWindow::Pointer window)
 : QAction(0)
 {
   m_Window = window;
@@ -45,7 +45,7 @@
   this->connect(this, SIGNAL(triggered(bool)), this, SLOT(Run()));
 }
 
-void QmitkFileSaveProjectAction::Run()
+void QmitkExtFileSaveProjectAction::Run()
 {
   try
   {
Index: mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtFileSaveProjectAction.h
===================================================================
--- mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtFileSaveProjectAction.h	(revision 21196)
+++ mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtFileSaveProjectAction.h	(working copy)
@@ -15,8 +15,8 @@
 
 =========================================================================*/
 
-#ifndef QmitkFileSaveProjectAction_H_
-#define QmitkFileSaveProjectAction_H_
+#ifndef QmitkExtFileSaveProjectAction_H_
+#define QmitkExtFileSaveProjectAction_H_
 
 #ifdef __MINGW32__
 // We need to inlclude winbase.h here in order to declare
@@ -27,17 +27,17 @@
 
 #include <QAction>
 
-#include "mitkQtCommonDll.h"
+#include "mitkQtCommonExtDll.h"
 
 #include <berryIWorkbenchWindow.h>
 
-class MITK_QT_COMMON QmitkFileSaveProjectAction : public QAction
+class MITK_QT_COMMON_EXT_EXPORT QmitkExtFileSaveProjectAction : public QAction
 {
   Q_OBJECT
 
 public:
 
-  QmitkFileSaveProjectAction(berry::IWorkbenchWindow::Pointer window);
+  QmitkExtFileSaveProjectAction(berry::IWorkbenchWindow::Pointer window);
 
 protected slots:
 
@@ -49,4 +49,4 @@
 };
 
 
-#endif /*QmitkFileSaveProjectAction_H_*/
+#endif /*QmitkExtFileSaveProjectAction_H_*/
Index: mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp
===================================================================
--- mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp	(revision 21196)
+++ mitk/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp	(working copy)
@@ -36,8 +36,8 @@
 #include <internal/berryQtShowViewAction.h>
 #include <internal/berryQtOpenPerspectiveAction.h>
 
-#include <QmitkFileOpenAction.h>
-#include <QmitkFileSaveProjectAction.h>
+#include <QmitkExtFileOpenAction.h>
+#include <QmitkExtFileSaveProjectAction.h>
 #include <QmitkFileExitAction.h>
 #include <QmitkCloseProjectAction.h>
 #include <QmitkStatusBar.h>
@@ -223,9 +223,9 @@
 
   QMenu* fileMenu = menuBar->addMenu("&File");
 
-  QAction* fileOpenAction = new QmitkFileOpenAction(QIcon(":/org.mitk.gui.qt.ext/Load_48.png"), window);
+  QAction* fileOpenAction = new QmitkExtFileOpenAction(QIcon(":/org.mitk.gui.qt.ext/Load_48.png"), window);
   fileMenu->addAction(fileOpenAction);
-  QAction* fileSaveProjectAction = new QmitkFileSaveProjectAction(window);
+  QAction* fileSaveProjectAction = new QmitkExtFileSaveProjectAction(window);
   fileSaveProjectAction->setIcon(QIcon(":/org.mitk.gui.qt.ext/Save_48.png"));
   fileMenu->addAction(fileSaveProjectAction);
   QAction* closeProjectAction = new QmitkCloseProjectAction(window);
