Mantid
Loading...
Searching...
No Matches
NonOrthogonal.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
10#include "MantidKernel/Matrix.h"
12#include <array>
13
14namespace MantidQt {
15namespace API {
16
17enum class DimensionSelection { H, K, L };
18
21
23
25
27 size_t dimX, size_t dimY);
28
30 std::array<Mantid::coord_t, 9> &skewMatrixCoord);
31
32template <typename T>
33void transformLookpointToWorkspaceCoord(T &lookPoint, const std::array<Mantid::coord_t, 9> &skewMatrix,
34 const size_t &dimX, const size_t &dimY, const size_t &dimSlice) {
35 auto sliceDimResult = (lookPoint[dimSlice] - skewMatrix[3 * dimSlice + dimX] * lookPoint[dimX] -
36 skewMatrix[3 * dimSlice + dimY] * lookPoint[dimY]) /
37 skewMatrix[3 * dimSlice + dimSlice];
38
39 auto OrigDimSliceValue = lookPoint[dimSlice];
40 lookPoint[dimSlice] = sliceDimResult;
41
42 auto v1 = lookPoint[0];
43 auto v2 = lookPoint[1];
44 auto v3 = lookPoint[2];
45
46 lookPoint[dimX] = v1 * skewMatrix[0 + 3 * dimX] + v2 * skewMatrix[1 + 3 * dimX] + v3 * skewMatrix[2 + 3 * dimX];
47 lookPoint[dimY] = v1 * skewMatrix[0 + 3 * dimY] + v2 * skewMatrix[1 + 3 * dimY] + v3 * skewMatrix[2 + 3 * dimY];
48
49 lookPoint[dimSlice] = OrigDimSliceValue;
50}
51
52std::pair<double, double> EXPORT_OPT_MANTIDQT_COMMON
53getGridLineAnglesInRadian(const std::array<Mantid::coord_t, 9> &skewMatrixCoord, size_t dimX, size_t dimY);
54} // namespace API
55} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
Basic MD Workspace Abstract Class.
Definition: IMDWorkspace.h:40
std::pair< double, double > EXPORT_OPT_MANTIDQT_COMMON getGridLineAnglesInRadian(const std::array< Mantid::coord_t, 9 > &skewMatrixCoord, size_t dimX, size_t dimY)
We get the angles that are used for plotting of the grid lines.
void EXPORT_OPT_MANTIDQT_COMMON provideSkewMatrix(Mantid::Kernel::DblMatrix &skewMatrix, const Mantid::API::IMDWorkspace &workspace)
bool EXPORT_OPT_MANTIDQT_COMMON requiresSkewMatrix(const Mantid::API::IMDWorkspace &workspace)
bool EXPORT_OPT_MANTIDQT_COMMON isHKLDimensions(const Mantid::API::IMDWorkspace &workspace, size_t dimX, size_t dimY)
void transformLookpointToWorkspaceCoord(T &lookPoint, const std::array< Mantid::coord_t, 9 > &skewMatrix, const size_t &dimX, const size_t &dimY, const size_t &dimSlice)
Definition: NonOrthogonal.h:33
void EXPORT_OPT_MANTIDQT_COMMON transformFromDoubleToCoordT(const Mantid::Kernel::DblMatrix &skewMatrix, std::array< Mantid::coord_t, 9 > &skewMatrixCoord)
size_t EXPORT_OPT_MANTIDQT_COMMON getMissingHKLDimensionIndex(const Mantid::API::IMDWorkspace_const_sptr &workspace, size_t dimX, size_t dimY)
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
std::shared_ptr< const IMDWorkspace > IMDWorkspace_const_sptr
Shared pointer to the IMDWorkspace base class (const version)
Definition: IMDWorkspace.h:148