Commit 49b979ff authored by Samuel Jackson's avatar Samuel Jackson
Browse files

Refs #18920 Add basic implementation of VirtualPeak

parent 5b95f24b
......@@ -44,6 +44,7 @@ set ( SRC_FILES
src/TableColumn.cpp
src/TableWorkspace.cpp
src/VectorColumn.cpp
src/VirtualPeak.cpp
src/Workspace2D.cpp
src/WorkspaceCreation.cpp
src/WorkspaceProperty.cpp
......@@ -123,6 +124,7 @@ set ( INC_FILES
inc/MantidDataObjects/TableColumn.h
inc/MantidDataObjects/TableWorkspace.h
inc/MantidDataObjects/VectorColumn.h
inc/MantidDataObjects/VirtualPeak.h
inc/MantidDataObjects/Workspace2D.h
inc/MantidDataObjects/WorkspaceCreation.h
inc/MantidDataObjects/WorkspaceSingleValue.h
......@@ -183,6 +185,7 @@ set ( TEST_FILES
TableWorkspaceTest.h
TofEventTest.h
VectorColumnTest.h
VirtualPeakTest.h
WeightedEventNoTimeTest.h
WeightedEventTest.h
Workspace2DTest.h
......
......@@ -135,7 +135,7 @@ public:
void setRow(int m_row);
void setCol(int m_col);
Mantid::Kernel::V3D getDetPos() const override;
virtual Mantid::Kernel::V3D getDetPos() const override;
double getL1() const override;
double getL2() const override;
......
#ifndef MANTID_DATAOBJECTS_VIRTUAL_PEAK_H_
#define MANTID_DATAOBJECTS_VIRTUAL_PEAK_H_
#include "MantidDataObjects/Peak.h"
namespace Mantid {
namespace DataObjects {
/** Structure describing a virtual single-crystal peak
*/
class DLLExport VirtualPeak : public Peak {
public:
// Override the detector position
Mantid::Kernel::V3D getDetPos() const override;
};
}
}
#endif /* MANTID_DATAOBJECTS_VIRTUAL_PEAK_H_ */
#include "MantidDataObjects/VirtualPeak.h"
#include "MantidKernel/V3D.h"
using namespace Mantid::Kernel;
namespace Mantid {
namespace DataObjects {
V3D VirtualPeak::getDetPos() const {
return V3D(0, 0, 0);
}
}
}
#ifndef MANTID_DATAOBJECTS_VIRTUAL_PEAKTEST_H_
#define MANTID_DATAOBJECTS_VIRTUAL_PEAKTEST_H_
#include <cxxtest/TestSuite.h>
#include "MantidDataObjects/VirtualPeak.h"
#include "MantidKernel/V3D.h"
using namespace Mantid::DataObjects;
using namespace Mantid::Kernel;
class VirtualPeakTest : public CxxTest::TestSuite {
public:
// This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests
static VirtualPeakTest *createSuite() { return new VirtualPeakTest(); }
static void destroySuite(VirtualPeakTest *suite) { delete suite; }
void test_constructor() {
VirtualPeak p;
}
void test_getDetPos() {
VirtualPeak p;
auto pos = p.getDetPos();
TS_ASSERT_EQUALS(pos, V3D(0,0,0))
}
};
#endif /* MANTID_DATAOBJECTS_VIRTUAL_PEAKTEST_H_ */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment