diff --git a/Framework/Properties/Mantid.properties.template b/Framework/Properties/Mantid.properties.template index f8d66cc81e82fd7d09a90e203325ef6ca5e4a826..b48c5203a4b1ea5cfccc37a75629c764d38df257 100644 --- a/Framework/Properties/Mantid.properties.template +++ b/Framework/Properties/Mantid.properties.template @@ -128,6 +128,9 @@ curvefitting.defaultPeak=Gaussian curvefitting.findPeaksFWHM=7 curvefitting.findPeaksTolerance=4 +#Defines whether or not the sliceViewer will show NonOrthogonal view as a default +sliceviewer.nonorthogonal=false + # Network Timeouts (in seconds for various uses within Mantid) network.default.timeout = 30 network.scriptrepo.timeout = 5 diff --git a/MantidQt/API/src/QwtScaleDrawNonOrthogonal.cpp b/MantidQt/API/src/QwtScaleDrawNonOrthogonal.cpp index 97f608c88f3060d65c1119226fed1bf4b9b553d8..2517f9323b49d3ccfba2c19e6286a7c2dbc48c8a 100644 --- a/MantidQt/API/src/QwtScaleDrawNonOrthogonal.cpp +++ b/MantidQt/API/src/QwtScaleDrawNonOrthogonal.cpp @@ -208,7 +208,7 @@ void QwtScaleDrawNonOrthogonal::applyGridLinesX( // sense but we are taking the angle against the y axis in the mathematical // negative sense. angle *= -1.f; - auto offset = angle == 0. ? 0. : heightScreen * std::tan(angle); + auto offset = angle == 0. ? 0. : heightScreen * tan(angle); QPen gridPen(QColor(200, 100, 100, 100)); // grey gridPen.setWidth(3); @@ -230,7 +230,7 @@ void QwtScaleDrawNonOrthogonal::applyGridLinesY( int widthScreen = m_plot->canvas()->width(); auto angle = m_angleX; - auto offset = angle == 0. ? 0. : widthScreen * std::tan(angle); + auto offset = angle == 0. ? 0. : widthScreen * tan(angle); QPen gridPen(QColor(200, 100, 100, 100)); // grey gridPen.setWidth(3); gridPen.setCapStyle(Qt::FlatCap); diff --git a/MantidQt/SliceViewer/inc/MantidQtSliceViewer/SliceViewer.h b/MantidQt/SliceViewer/inc/MantidQtSliceViewer/SliceViewer.h index 46469efedc3c67c23f22a3c0b7c7d8a4249cc357..8960779167c24338fbbb39ae04e460e5a92f4b71 100644 --- a/MantidQt/SliceViewer/inc/MantidQtSliceViewer/SliceViewer.h +++ b/MantidQt/SliceViewer/inc/MantidQtSliceViewer/SliceViewer.h @@ -389,6 +389,8 @@ private: /// NonOrthogonal Fields std::unique_ptr<CoordinateTransform> m_coordinateTransform; bool m_firstNonOrthogonalWorkspaceOpen; + bool m_nonOrthogonalDefault; // sets whether nonOrthogonalview should be shown + // as a default // -------------------------- Controllers ------------------------ boost::shared_ptr<CompositePeaksPresenter> m_peaksPresenter; diff --git a/MantidQt/SliceViewer/src/SliceViewer.cpp b/MantidQt/SliceViewer/src/SliceViewer.cpp index 7bd5bd1146c0d80f16bca719ca71283a5dbd5c37..8bd58289fb96fdcfa15a3b7f5a408c859be90385 100644 --- a/MantidQt/SliceViewer/src/SliceViewer.cpp +++ b/MantidQt/SliceViewer/src/SliceViewer.cpp @@ -85,13 +85,19 @@ SliceViewer::SliceViewer(QWidget *parent) m_data(nullptr), m_X(), m_Y(), m_dimX(0), m_dimY(1), m_logColor(false), m_fastRender(true), m_rebinMode(false), m_rebinLocked(true), m_mdSettings(new MantidQt::API::MdSettings()), m_logger("SliceViewer"), - m_firstNonOrthogonalWorkspaceOpen(true), + m_firstNonOrthogonalWorkspaceOpen(true), m_nonOrthogonalDefault(false), m_peaksPresenter(boost::make_shared<CompositePeaksPresenter>(this)), m_proxyPeaksPresenter( boost::make_shared<ProxyCompositePeaksPresenter>(m_peaksPresenter)), m_peaksSliderWidget(NULL) { ui.setupUi(this); + std::string enableNonOrthogonal; + Kernel::ConfigService::Instance().getValue("sliceviewer.nonorthogonal", + enableNonOrthogonal); + if (enableNonOrthogonal == "true") { + m_nonOrthogonalDefault = true; + } m_inf = std::numeric_limits<double>::infinity(); @@ -703,7 +709,7 @@ void SliceViewer::switchQWTRaster(bool useNonOrthogonal) { m_data->setWorkspace(m_ws); this->setTransparentZeros(false); - if (m_firstNonOrthogonalWorkspaceOpen) { + if (m_firstNonOrthogonalWorkspaceOpen && m_nonOrthogonalDefault) { m_firstNonOrthogonalWorkspaceOpen = false; ui.btnNonOrthogonalToggle->toggle(); }