Index: Bundles/org.mitk.core.services/src/internal/mitkDataStorageService.cpp =================================================================== --- Bundles/org.mitk.core.services/src/internal/mitkDataStorageService.cpp (revision 22256) +++ Bundles/org.mitk.core.services/src/internal/mitkDataStorageService.cpp (working copy) @@ -18,7 +18,6 @@ #include "mitkDataStorageService.h" #include "mitkDataStorageReference.h" -#include "mitkStandaloneDataStorage.h" namespace mitk { @@ -52,7 +51,16 @@ return ref; } +IDataStorageReference::Pointer DataStorageService::CreateDataStorage(const std::string& label, StandaloneDataStorage::Pointer dataStorage) +{ + DataStorageReference::Pointer ref(new DataStorageReference(dataStorage.GetPointer())); + ref->SetLabel(label); + m_DataStorageReferences.push_back(ref); + return ref; +} + + std::vector DataStorageService::GetDataStorageReferences() const { return m_DataStorageReferences; Index: Bundles/org.mitk.core.services/src/internal/mitkDataStorageService.h =================================================================== --- Bundles/org.mitk.core.services/src/internal/mitkDataStorageService.h (revision 22256) +++ Bundles/org.mitk.core.services/src/internal/mitkDataStorageService.h (working copy) @@ -19,6 +19,7 @@ #define MITKDATASTORAGESERVICE_H_ #include "../mitkIDataStorageService.h" +#include "mitkStandaloneDataStorage.h" namespace mitk { @@ -33,7 +34,8 @@ const std::type_info& GetType() const; IDataStorageReference::Pointer CreateDataStorage(const std::string& label); - + IDataStorageReference::Pointer CreateDataStorage(const std::string& label, StandaloneDataStorage::Pointer dataStorage); + std::vector GetDataStorageReferences() const; IDataStorageReference::Pointer GetDefaultDataStorage() const; Index: Bundles/org.mitk.core.services/src/mitkIDataStorageService.h =================================================================== --- Bundles/org.mitk.core.services/src/mitkIDataStorageService.h (revision 22256) +++ Bundles/org.mitk.core.services/src/mitkIDataStorageService.h (working copy) @@ -22,6 +22,7 @@ #include "mitkCoreServicesPluginDll.h" #include "mitkIDataStorageReference.h" +#include "mitkStandaloneDataStorage.h" #include @@ -35,6 +36,7 @@ static const std::string ID; virtual IDataStorageReference::Pointer CreateDataStorage(const std::string& label) = 0; + virtual IDataStorageReference::Pointer CreateDataStorage(const std::string& label, StandaloneDataStorage::Pointer dataStorage) = 0; virtual std::vector GetDataStorageReferences() const = 0; virtual IDataStorageReference::Pointer GetDefaultDataStorage() const = 0; Index: Bundles/org.mitk.gui.common/src/mitkDataStorageEditorInput.cpp =================================================================== --- Bundles/org.mitk.gui.common/src/mitkDataStorageEditorInput.cpp (revision 22256) +++ Bundles/org.mitk.gui.common/src/mitkDataStorageEditorInput.cpp (working copy) @@ -46,6 +46,11 @@ return false; } +void DataStorageEditorInput::SetDataStorageReference(IDataStorageReference::Pointer ref) +{ + m_DataStorageRef = ref; +} + IDataStorageReference::Pointer DataStorageEditorInput::GetDataStorageReference() { Index: Bundles/org.mitk.gui.common/src/mitkDataStorageEditorInput.h =================================================================== --- Bundles/org.mitk.gui.common/src/mitkDataStorageEditorInput.h (revision 22256) +++ Bundles/org.mitk.gui.common/src/mitkDataStorageEditorInput.h (working copy) @@ -35,6 +35,7 @@ std::string GetName() const; std::string GetToolTipText() const; + void SetDataStorageReference(IDataStorageReference::Pointer ref); IDataStorageReference::Pointer GetDataStorageReference(); bool operator==(const berry::Object*) const; Index: Qmitk/QmitkRenderWindowMenu.cpp =================================================================== --- Qmitk/QmitkRenderWindowMenu.cpp (revision 22256) +++ Qmitk/QmitkRenderWindowMenu.cpp (working copy) @@ -168,6 +168,9 @@ m_Left2Dand3DRight2DLayoutAction = new QAction( "Transversal n 3D left, Sagittal right", m_Settings ); m_Left2Dand3DRight2DLayoutAction->setDisabled( false ); + m_TransversalUpLayoutAction = new QAction( "Transversal up", m_Settings ); + m_TransversalUpLayoutAction->setDisabled( false ); + m_Settings->addAction(m_DefaultLayoutAction); m_Settings->addAction(m_2DImagesUpLayoutAction); m_Settings->addAction(m_2DImagesLeftLayoutAction); @@ -180,6 +183,7 @@ m_Settings->addAction(m_SmallUpperWidget2Big3and4LayoutAction); m_Settings->addAction(m_2x2Dand3DWidgetLayoutAction); m_Settings->addAction(m_Left2Dand3DRight2DLayoutAction); + m_Settings->addAction(m_TransversalUpLayoutAction); m_Settings->setVisible( false ); @@ -195,6 +199,7 @@ connect( m_SmallUpperWidget2Big3and4LayoutAction, SIGNAL( triggered(bool) ), this, SLOT(OnChangeLayoutToSmallUpperWidget2Big3and4(bool)) ); connect( m_2x2Dand3DWidgetLayoutAction, SIGNAL( triggered(bool) ), this, SLOT(OnChangeLayoutTo2x2Dand3DWidget(bool)) ); connect( m_Left2Dand3DRight2DLayoutAction, SIGNAL( triggered(bool) ), this, SLOT(OnChangeLayoutToLeft2Dand3DRight2D(bool)) ); + connect( m_TransversalUpLayoutAction, SIGNAL( triggered(bool) ), this, SLOT(OnChangeLayoutToTransversalUp(bool)) ); } @@ -390,6 +395,16 @@ emit SignalChangeLayoutDesign( LAYOUT_LEFT2DAND3DRIGHT2D ); } +void QmitkRenderWindowMenu::OnChangeLayoutToTransversalUp(bool) +{ + //set Full Screen Mode to false, if Layout Design was changed by the LayoutDesign_List + m_FullScreenMode = false; + this->ChangeFullScreenIcon(); + + m_LayoutDesign = LAYOUT_TRANSVERSALUP; + emit SignalChangeLayoutDesign( LAYOUT_TRANSVERSALUP ); +} + void QmitkRenderWindowMenu::UpdateLayoutDesignList( int layoutDesignIndex ) { m_LayoutDesign = layoutDesignIndex; @@ -413,6 +428,7 @@ m_SmallUpperWidget2Big3and4LayoutAction->setEnabled(true); m_2x2Dand3DWidgetLayoutAction->setEnabled(true); m_Left2Dand3DRight2DLayoutAction->setEnabled(true); + m_TransversalUpLayoutAction->setEnabled(true); break; } @@ -430,6 +446,7 @@ m_SmallUpperWidget2Big3and4LayoutAction->setEnabled(true); m_2x2Dand3DWidgetLayoutAction->setEnabled(true); m_Left2Dand3DRight2DLayoutAction->setEnabled(true); + m_TransversalUpLayoutAction->setEnabled(true); break; } case LAYOUT_2DIMAGELEFT: @@ -446,6 +463,7 @@ m_SmallUpperWidget2Big3and4LayoutAction->setEnabled(true); m_2x2Dand3DWidgetLayoutAction->setEnabled(true); m_Left2Dand3DRight2DLayoutAction->setEnabled(true); + m_TransversalUpLayoutAction->setEnabled(true); break; } case LAYOUT_BIG3D: @@ -462,6 +480,7 @@ m_SmallUpperWidget2Big3and4LayoutAction->setEnabled(true); m_2x2Dand3DWidgetLayoutAction->setEnabled(true); m_Left2Dand3DRight2DLayoutAction->setEnabled(true); + m_TransversalUpLayoutAction->setEnabled(true); break; } case LAYOUT_TRANSVERSAL: @@ -478,6 +497,7 @@ m_SmallUpperWidget2Big3and4LayoutAction->setEnabled(true); m_2x2Dand3DWidgetLayoutAction->setEnabled(true); m_Left2Dand3DRight2DLayoutAction->setEnabled(true); + m_TransversalUpLayoutAction->setEnabled(true); break; } case LAYOUT_SAGITTAL: @@ -494,6 +514,7 @@ m_SmallUpperWidget2Big3and4LayoutAction->setEnabled(true); m_2x2Dand3DWidgetLayoutAction->setEnabled(true); m_Left2Dand3DRight2DLayoutAction->setEnabled(true); + m_TransversalUpLayoutAction->setEnabled(true); break; } case LAYOUT_CORONAL: @@ -510,6 +531,7 @@ m_SmallUpperWidget2Big3and4LayoutAction->setEnabled(true); m_2x2Dand3DWidgetLayoutAction->setEnabled(true); m_Left2Dand3DRight2DLayoutAction->setEnabled(true); + m_TransversalUpLayoutAction->setEnabled(true); break; } case LAYOUT_2X2DAND3DWIDGET: @@ -526,6 +548,7 @@ m_SmallUpperWidget2Big3and4LayoutAction->setEnabled(true); m_2x2Dand3DWidgetLayoutAction->setEnabled(false); m_Left2Dand3DRight2DLayoutAction->setEnabled(true); + m_TransversalUpLayoutAction->setEnabled(true); break; } case LAYOUT_ROWWIDGET3AND4: @@ -542,6 +565,7 @@ m_SmallUpperWidget2Big3and4LayoutAction->setEnabled(true); m_2x2Dand3DWidgetLayoutAction->setEnabled(true); m_Left2Dand3DRight2DLayoutAction->setEnabled(true); + m_TransversalUpLayoutAction->setEnabled(true); break; } case LAYOUT_COLUMNWIDGET3AND4: @@ -558,6 +582,7 @@ m_SmallUpperWidget2Big3and4LayoutAction->setEnabled(true); m_2x2Dand3DWidgetLayoutAction->setEnabled(true); m_Left2Dand3DRight2DLayoutAction->setEnabled(true); + m_TransversalUpLayoutAction->setEnabled(true); break; } case LAYOUT_SMALLUPPERWIDGET2BIGAND4: @@ -574,6 +599,7 @@ m_SmallUpperWidget2Big3and4LayoutAction->setEnabled(false); m_2x2Dand3DWidgetLayoutAction->setEnabled(true); m_Left2Dand3DRight2DLayoutAction->setEnabled(true); + m_TransversalUpLayoutAction->setEnabled(true); break; } case LAYOUT_LEFT2DAND3DRIGHT2D: @@ -590,8 +616,26 @@ m_SmallUpperWidget2Big3and4LayoutAction->setEnabled(true); m_2x2Dand3DWidgetLayoutAction->setEnabled(true); m_Left2Dand3DRight2DLayoutAction->setEnabled(false); + m_TransversalUpLayoutAction->setEnabled(true); break; } + case LAYOUT_TRANSVERSALUP: + { + m_DefaultLayoutAction->setEnabled(true); + m_2DImagesUpLayoutAction->setEnabled(true); + m_2DImagesLeftLayoutAction->setEnabled(true); + m_Big3DLayoutAction->setEnabled(true); + m_Widget1LayoutAction->setEnabled(true); + m_Widget2LayoutAction->setEnabled(true); + m_Widget3LayoutAction->setEnabled(true); + m_RowWidget3And4LayoutAction->setEnabled(true); + m_ColumnWidget3And4LayoutAction->setEnabled(true); + m_SmallUpperWidget2Big3and4LayoutAction->setEnabled(true); + m_2x2Dand3DWidgetLayoutAction->setEnabled(true); + m_Left2Dand3DRight2DLayoutAction->setEnabled(true); + m_TransversalUpLayoutAction->setEnabled(false); + break; + } } } Index: Qmitk/QmitkRenderWindowMenu.h =================================================================== --- Qmitk/QmitkRenderWindowMenu.h (revision 22256) +++ Qmitk/QmitkRenderWindowMenu.h (working copy) @@ -178,6 +178,9 @@ /*! Slot for changing layout design to Transversal n 3D left, Sagittal right layout. The slot is connected to the triggered() signal of m_Left2Dand3DRight2DLayoutAction. */ void OnChangeLayoutToLeft2Dand3DRight2D(bool); + /*! Slot for changing layout design to Transversal up*/ + void OnChangeLayoutToTransversalUp(bool); + void OnCrossHairMenuAboutToShow(); public: @@ -205,7 +208,8 @@ LAYOUT_COLUMNWIDGET3AND4, LAYOUT_ROWWIDGETSMALL3ANDBIG4, //not in use in this class, but we need it here to synchronize with the SdtMultiWidget. LAYOUT_SMALLUPPERWIDGET2BIGAND4, - LAYOUT_LEFT2DAND3DRIGHT2D + LAYOUT_LEFT2DAND3DRIGHT2D, + LAYOUT_TRANSVERSALUP }; @@ -257,6 +261,10 @@ /*! QAction for transversal n 3D left, sagittal right layout design*/ QAction* m_Left2Dand3DRight2DLayoutAction; + /*! QAction for transversal up*/ + QAction* m_TransversalUpLayoutAction; + + QLabel *m_TSLabel; Index: Qmitk/QmitkStdMultiWidget.cpp =================================================================== --- Qmitk/QmitkStdMultiWidget.cpp (revision 22256) +++ Qmitk/QmitkStdMultiWidget.cpp (working copy) @@ -25,6 +25,7 @@ #include #include #include +#include #include "mitkProperties.h" #include "mitkGeometry2DDataMapper2D.h" @@ -1133,6 +1134,70 @@ this->UpdateAllWidgets(); } +void QmitkStdMultiWidget::changeLayoutToTransversalUp() +{ + SMW_INFO << "changing layout to Transversal plane up. Sagital and Frontal Down" << std::endl; + + //Hide all Menu Widgets + this->HideAllWidgetToolbars(); + + delete QmitkStdMultiWidgetLayout ; + + //create Main Layout + QmitkStdMultiWidgetLayout = new QHBoxLayout( this ); + + //create main splitter + m_MainSplit = new QSplitter( this ); + QmitkStdMultiWidgetLayout->addWidget( m_MainSplit ); + + //create m_LayoutSplit and add to the mainSplit + m_LayoutSplit = new QSplitter( Qt::Vertical, m_MainSplit ); + m_MainSplit->addWidget( m_LayoutSplit ); + + //add LevelWindow Widget to mainSplitter + m_MainSplit->addWidget( levelWindowWidget ); + + //create m_SubSplit1 and m_SubSplit2 + m_SubSplit1 = new QSplitter( Qt::Vertical, m_LayoutSplit ); + m_SubSplit2 = new QSplitter( m_LayoutSplit ); + + //insert Widget into the splitters + m_SubSplit1->addWidget( mitkWidget1Container ); + + m_SubSplit2->addWidget( mitkWidget2Container ); + m_SubSplit2->addWidget( mitkWidget3Container ); + + //set Splitter Size + QList splitterSize; + splitterSize.push_back(500); + splitterSize.push_back(500); + m_SubSplit2->setSizes( splitterSize ); + splitterSize.clear(); + splitterSize.push_back(1500); + splitterSize.push_back(500); + m_LayoutSplit->setSizes( splitterSize ); + + //show mainSplitt + m_MainSplit->show(); + + //show Widget if hidden + mitkWidget4->hide(); + if ( mitkWidget1->isHidden() ) mitkWidget1->show(); + if ( mitkWidget2->isHidden() ) mitkWidget2->show(); + if ( mitkWidget3->isHidden() ) mitkWidget3->show(); + + m_Layout = LAYOUT_TRANSVERSAL_UP; + + //update Layout Design List + mitkWidget1->LayoutDesignListChanged( LAYOUT_TRANSVERSAL_UP ); + mitkWidget2->LayoutDesignListChanged( LAYOUT_TRANSVERSAL_UP ); + mitkWidget3->LayoutDesignListChanged( LAYOUT_TRANSVERSAL_UP ); + mitkWidget4->LayoutDesignListChanged( LAYOUT_TRANSVERSAL_UP ); + + //update Alle Widgets + this->UpdateAllWidgets(); +} + void QmitkStdMultiWidget::changeLayoutTo2DUpAnd3DDown() { SMW_INFO << "changing layout to 2D up and 3D down" << std::endl; @@ -1357,6 +1422,13 @@ emit WheelMoved( e ); } +void QmitkStdMultiWidget::mousePressEvent(QMouseEvent * e) +{ + if (e->button() == Qt::LeftButton) { + mitk::Point3D pointValue = this->GetLastLeftClickPosition(); + emit LeftMouseClicked(pointValue); + } +} mitk::DisplayVectorInteractor* QmitkStdMultiWidget::GetMoveAndZoomInteractor() { @@ -1846,6 +1918,8 @@ void QmitkStdMultiWidget::OnLayoutDesignChanged( int layoutDesignIndex ) { +std:cout << "Layoutindex" << layoutDesignIndex << std::endl; + switch( layoutDesignIndex ) { case LAYOUT_DEFAULT: @@ -1913,6 +1987,11 @@ this->changeLayoutToLeft2Dand3DRight2D(); break; } + case LAYOUT_TRANSVERSAL_UP: + { + this->changeLayoutToTransversalUp(); + break; + } }; @@ -1975,3 +2054,8 @@ m_RectangleRendering3->Disable(); m_RectangleRendering4->Disable(); } + +mitk::DataStorage::Pointer QmitkStdMultiWidget::GetDataStorage() +{ + return m_DataStorage; +} Index: Qmitk/QmitkStdMultiWidget.h =================================================================== --- Qmitk/QmitkStdMultiWidget.h (revision 22256) +++ Qmitk/QmitkStdMultiWidget.h (working copy) @@ -132,6 +132,8 @@ void changeLayoutTo2DUpAnd3DDown(); + void changeLayoutToTransversalUp(); + void Fit(); void InitPositionTracking(); @@ -146,6 +148,8 @@ void wheelEvent( QWheelEvent * e ); + void mousePressEvent(QMouseEvent * e); + void EnsureDisplayContainsPoint( mitk::DisplayGeometry* displayGeometry, const mitk::Point3D& p); @@ -195,7 +199,8 @@ signals: - void WheelMoved( QWheelEvent* ); + void LeftMouseClicked(mitk::Point3D pointValue); + void WheelMoved(QWheelEvent*); void WidgetPlanesRotationLinked(bool); void WidgetPlanesRotationEnabled(bool); void ViewsInitialized(); @@ -221,7 +226,7 @@ LAYOUT_2X_2D_AND_3D_WIDGET, LAYOUT_ROW_WIDGET_3_AND_4, LAYOUT_COLUMN_WIDGET_3_AND_4, LAYOUT_ROW_WIDGET_SMALL3_AND_BIG4 , LAYOUT_SMALL_UPPER_WIDGET2_BIG3_AND4,LAYOUT_2D_AND_3D_LEFT_2D_RIGHT_WIDGET, - LAYOUT_2D_UP_AND_3D_DOWN}; + LAYOUT_TRANSVERSAL_UP, LAYOUT_2D_UP_AND_3D_DOWN}; enum { TRANSVERSAL, @@ -230,7 +235,9 @@ THREE_D }; + mitk::DataStorage::Pointer GetDataStorage(); + protected: QHBoxLayout* QmitkStdMultiWidgetLayout;