Skip to content
Snippets Groups Projects
Commit bdeb6f3e authored by Anton Piccardo-Selg's avatar Anton Piccardo-Selg
Browse files

Refs #13872 Fix non-orthogonal with hkl

parent 15bd657e
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
#include "MantidVatesAPI/LoadVTK.h"
#include "MantidAPI/IMDHistoWorkspace.h"
#include "MantidGeometry/MDGeometry/IMDDimension.h"
#include "MantidGeometry/MDGeometry/UnknownFrame.h"
#include "MantidAPI/AlgorithmManager.h"
using namespace Mantid::API;
......@@ -129,14 +130,29 @@ public:
outWSName);
TS_ASSERT_EQUALS(3, outWS->getNumDims());
do_check_dimension(outWS->getDimension(0), "X", 0, 67, 68); // These numbers are expected min, max, and nbins known from the input file for dim x.
do_check_dimension(outWS->getDimension(1), "Y", 0, 67, 68); // These numbers are expected min, max, and nbins known from the input file for dim y.
do_check_dimension(outWS->getDimension(2), "Z", 0, 67, 68); // These numbers are expected min, max, and nbins known from the input file for dim z.
do_check_dimension(outWS->getDimension(0), "X", 0, 67,
68); // These numbers are expected min, max, and nbins
// known from the input file for dim x.
do_check_dimension(outWS->getDimension(1), "Y", 0, 67,
68); // These numbers are expected min, max, and nbins
// known from the input file for dim y.
do_check_dimension(outWS->getDimension(2), "Z", 0, 67,
68); // These numbers are expected min, max, and nbins
// known from the input file for dim z.
TSM_ASSERT_THROWS_NOTHING(
"Should be an UnknownFrame",
dynamic_cast<const Mantid::Geometry::UnknownFrame &>(
outWS->getDimension(0)->getMDFrame()))
TSM_ASSERT_THROWS_NOTHING(
"Should be an UnknownFrame",
dynamic_cast<const Mantid::Geometry::UnknownFrame &>(
outWS->getDimension(1)->getMDFrame()))
TSM_ASSERT_THROWS_NOTHING(
"Should be an UnknownFrame",
dynamic_cast<const Mantid::Geometry::UnknownFrame &>(
outWS->getDimension(2)->getMDFrame()))
TSM_ASSERT_THROWS_NOTHING("Should be an UnknownFrame", dynamic_cast<const Mantid::Geometry::UnknownFrame&>(outWS->getDimension(0)))
TSM_ASSERT_THROWS_NOTHING("Should be an UnknownFrame", dynamic_cast<const Mantid::Geometry::UnknownFrame&>(outWS->getDimension(1)))
TSM_ASSERT_THROWS_NOTHING("Should be an UnknownFrame", dynamic_cast<const Mantid::Geometry::UnknownFrame&>(outWS->getDimension(2)))
double topPercent = loadVTK.getProperty("KeepTopPercent");
TSM_ASSERT_EQUALS("Should default to 25%", 25, topPercent);
......
......@@ -10,6 +10,9 @@
#include "MantidKernel/PropertyWithValue.h"
#include "MantidDataObjects/CoordTransformAffine.h"
#include "MantidTestHelpers/MDEventsTestHelper.h"
#include "MantidGeometry/MDGeometry/QSample.h"
#include "MantidGeometry/MDGeometry/HKL.h"
#include "MantidKernel/MDUnit.h"
#include <vtkDataArray.h>
#include <vtkFieldData.h>
......@@ -38,15 +41,17 @@ private:
// Creating an MDEventWorkspace as the content is not germain to the
// information necessary for the non-orthogonal axes
std::string wsName = "simpleWS";
IMDEventWorkspace_sptr ws = makeAnyMDEW<MDEvent<4>, 4>(1, 0.0, 1.0, 1, wsName);
IMDEventWorkspace_sptr ws;
// Set the coordinate system
if (!wrongCoords)
{
ws->setCoordinateSystem(Mantid::Kernel::HKL);
}
else
{
ws->setCoordinateSystem(QSample);
if (wrongCoords) {
Mantid::Geometry::QSample frame;
ws = MDEventsTestHelper::makeAnyMDEWWithFrames<MDEvent<4>, 4>(
1, 0.0, 1.0, frame, 1, wsName);
} else {
Mantid::Geometry::HKL frame(new Mantid::Kernel::ReciprocalLatticeUnit);
ws = MDEventsTestHelper::makeAnyMDEWWithFrames<MDEvent<4>, 4>(
1, 0.0, 1.0, frame, 1, wsName);
}
// Set the UB matrix
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment