diff --git a/Code/Mantid/Vates/VatesAPI/test/vtkSplatterPlotFactoryTest.h b/Code/Mantid/Vates/VatesAPI/test/vtkSplatterPlotFactoryTest.h index ba20b8e01db5..7151ec60016c 100644 --- a/Code/Mantid/Vates/VatesAPI/test/vtkSplatterPlotFactoryTest.h +++ b/Code/Mantid/Vates/VatesAPI/test/vtkSplatterPlotFactoryTest.h @@ -45,13 +45,6 @@ class vtkSplatterPlotFactoryTest : public CxxTest::TestSuite TSM_ASSERT_THROWS("This is a NULL workspace. Should throw.", factory.initialize( Workspace_sptr(ws) ), std::invalid_argument); } - void testInitializeWithWrongWorkspaceTypeThrows() - { - IMDWorkspace* ws = new MockIMDWorkspace; - vtkSplatterPlotFactory factory(ThresholdRange_scptr(new UserDefinedThresholdRange(0, 1)), "signal"); - TSM_ASSERT_THROWS("This is an invalid workspace. Should throw.", factory.initialize( Workspace_sptr(ws) ), std::invalid_argument); - } - /*Demonstrative tests*/ void test_3DWorkspace() diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h index 5987c3e3c881..c103e5173430 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h @@ -126,7 +126,7 @@ protected slots: QHBoxLayout *viewLayout; ///< Layout manager for the view widget pqViewSettingsReaction *viewSettings; ///< Holder for the view settings reaction bool viewSwitched; - ModeControlWidget::Views initialView; ///< Holds the initial view + ModeControlWidget::Views initialView; ///< Holds the initial view /// Check the environmental variables. @@ -163,18 +163,18 @@ protected slots: void swapViews(); /// Update the state of application widgets. void updateAppState(); - /// Get the initial view for the current workspace and user setting - ModeControlWidget::Views getInitialView(int workspaceType, std::string instrumentName); + /// Get the initial view for the current workspace and user setting + ModeControlWidget::Views getInitialView(int workspaceType, std::string instrumentName); /// Check that the view is valid for teh workspace type - ModeControlWidget::Views checkViewAgainstWorkspace(ModeControlWidget::Views view, int workspaceType); - /// Get the technique associated with an instrument. - const std::string getTechniqueForInstrument(const std::string& instrumentName) const; - /// Get the view for a specified instrument - std::string getViewForInstrument(const std::string& instrument) const; - /// Check if a technique contains a keyword - bool checkIfTechniqueContainsKeyword(const std::set& techniques, const std::string& keyword) const; - /// Reset the current view to the appropriate initial view. - void resetCurrentView(int workspaceType, const std::string& instrumentName); + ModeControlWidget::Views checkViewAgainstWorkspace(ModeControlWidget::Views view, int workspaceType); + /// Get the technique associated with an instrument. + const std::string getTechniqueForInstrument(const std::string& instrumentName) const; + /// Get the view for a specified instrument + std::string getViewForInstrument(const std::string& instrument) const; + /// Check if a technique contains a keyword + bool checkIfTechniqueContainsKeyword(const std::set& techniques, const std::string& keyword) const; + /// Reset the current view to the appropriate initial view. + void resetCurrentView(int workspaceType, const std::string& instrumentName); }; } // SimpleGui diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp index e8f0836e999d..4c6c61e63b43 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/MdViewerWidget.cpp @@ -219,6 +219,7 @@ void MdViewerWidget::setupMainView() // Set the view at startup to STANDARD, the view will be changed, depending on the workspace this->currentView = this->setMainViewWidget(this->ui.viewWidget, ModeControlWidget::STANDARD); + this->initialView = ModeControlWidget::STANDARD; this->currentView->installEventFilter(this); // Create a layout to manage the view properly @@ -696,6 +697,7 @@ void MdViewerWidget::setupPluginMode() this->setupMainView(); } + /** * This function tells the current view to render the data, perform any * necessary checks on the view given the workspace type and update the @@ -774,6 +776,7 @@ void MdViewerWidget::switchViews(ModeControlWidget::Views v) this->currentView->setColorsForView(); this->currentView->checkViewOnSwitch(); this->updateAppState(); + this->initialView = v; } /**