Skip to content

Commit

Permalink
refs #10904 SpecialCoords API->Kernel
Browse files Browse the repository at this point in the history
Since we have put PeakShape in Geometry, SpecialCoordinateSystem must be moved to the Kernel package out of API.
  • Loading branch information
OwenArnold committed Feb 9, 2015
1 parent bf27026 commit 5612143
Show file tree
Hide file tree
Showing 89 changed files with 197 additions and 199 deletions.
2 changes: 0 additions & 2 deletions Code/Mantid/Framework/API/CMakeLists.txt
Expand Up @@ -272,7 +272,6 @@ set ( INC_FILES
inc/MantidAPI/ScriptRepositoryFactory.h
inc/MantidAPI/SingleValueParameter.h
inc/MantidAPI/SingleValueParameterParser.h
inc/MantidAPI/SpecialCoordinateSystem.h
inc/MantidAPI/SpectraAxis.h
inc/MantidAPI/SpectrumDetectorMapping.h
inc/MantidAPI/TableRow.h
Expand Down Expand Up @@ -361,7 +360,6 @@ set ( TEST_FILES
SampleTest.h
ScopedWorkspaceTest.h
ScriptBuilderTest.h
SpecialCoordinateSystemTest.h
SpectraAxisTest.h
SpectrumDetectorMappingTest.h
TextAxisTest.h
Expand Down
Expand Up @@ -83,7 +83,7 @@ class MANTID_API_DLL IMDEventWorkspace : public API::IMDWorkspace,
virtual bool threadSafe() const;

virtual void setCoordinateSystem(
const Mantid::API::SpecialCoordinateSystem coordinateSystem) = 0;
const Mantid::Kernel::SpecialCoordinateSystem coordinateSystem) = 0;

protected:
virtual const std::string toString() const;
Expand Down
Expand Up @@ -89,7 +89,7 @@ class DLLExport IMDHistoWorkspace : public IMDWorkspace,
virtual double &operator[](const size_t &index) = 0;

virtual void setCoordinateSystem(
const Mantid::API::SpecialCoordinateSystem coordinateSystem) = 0;
const Mantid::Kernel::SpecialCoordinateSystem coordinateSystem) = 0;

virtual boost::shared_ptr<IMDHistoWorkspace> clone() const = 0;

Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/API/inc/MantidAPI/IMDWorkspace.h
Expand Up @@ -12,7 +12,7 @@
#include "MantidAPI/MDGeometry.h"
#include "MantidGeometry/MDGeometry/MDImplicitFunction.h"
#include "MantidAPI/IMDWorkspace.h"
#include "MantidAPI/SpecialCoordinateSystem.h"
#include "MantidKernel/SpecialCoordinateSystem.h"
#include "MantidAPI/ITableWorkspace.h"

namespace Mantid {
Expand Down Expand Up @@ -119,7 +119,7 @@ class MANTID_API_DLL IMDWorkspace : public Workspace,
/// Clear existing masks
virtual void clearMDMasking() = 0;
///
virtual Mantid::API::SpecialCoordinateSystem
virtual Mantid::Kernel::SpecialCoordinateSystem
getSpecialCoordinateSystem() const = 0;
/// if a workspace was filebacked, this should clear file-based status, delete
/// file-based information and close related files.
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/API/inc/MantidAPI/IPeaksWorkspace.h
Expand Up @@ -6,7 +6,7 @@
//----------------------------------------------------------------------
#include "MantidAPI/ITableWorkspace.h"
#include "MantidAPI/ExperimentInfo.h"
#include "MantidAPI/SpecialCoordinateSystem.h"
#include "MantidKernel/SpecialCoordinateSystem.h"

namespace Mantid {

Expand Down Expand Up @@ -127,15 +127,15 @@ class MANTID_API_DLL IPeaksWorkspace : public ITableWorkspace,
* @param coordinateSystem : Special Q3D coordinate system to use.
*/
virtual void setCoordinateSystem(
const Mantid::API::SpecialCoordinateSystem coordinateSystem) = 0;
const Mantid::Kernel::SpecialCoordinateSystem coordinateSystem) = 0;

//---------------------------------------------------------------------------------------------
/**
* Get the special coordinate system.
* @returns special Q3D coordinate system to use being used by this
* PeaksWorkspace object. Probably the one the workspace was generated with.
*/
virtual Mantid::API::SpecialCoordinateSystem
virtual Mantid::Kernel::SpecialCoordinateSystem
getSpecialCoordinateSystem() const = 0;
virtual std::vector<std::pair<std::string, std::string>>
peakInfo(Kernel::V3D QFrame, bool labCoords) const = 0;
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h
Expand Up @@ -392,7 +392,7 @@ class MANTID_API_DLL MatrixWorkspace : public IMDWorkspace,
void clearMDMasking();

/// @return the special coordinate system used if any.
virtual Mantid::API::SpecialCoordinateSystem
virtual Mantid::Kernel::SpecialCoordinateSystem
getSpecialCoordinateSystem() const;

//=====================================================================================
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/API/inc/MantidAPI/PeakTransform.h
Expand Up @@ -5,7 +5,7 @@
#include "MantidAPI/IPeak.h"
#include <boost/regex.hpp>
#include <boost/shared_ptr.hpp>
#include "MantidAPI/SpecialCoordinateSystem.h"
#include "MantidKernel/SpecialCoordinateSystem.h"

namespace Mantid {
namespace API {
Expand Down Expand Up @@ -35,7 +35,7 @@ class DLLExport PeakTransform {
/// Getter for a friendly name to describe the transform type.
virtual std::string getFriendlyName() const = 0;
/// Getter for the special coordinate representation of this transform type.
virtual Mantid::API::SpecialCoordinateSystem getCoordinateSystem() const = 0;
virtual Mantid::Kernel::SpecialCoordinateSystem getCoordinateSystem() const = 0;

protected:
PeakTransform(const PeakTransform &other);
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/PeakTransformHKL.h
Expand Up @@ -31,7 +31,7 @@ class DLLExport PeakTransformHKL : public PeakTransform {
/// Getter for a friendly name to describe the transform type.
virtual std::string getFriendlyName() const { return name(); }
/// Getter for the special coordinate representation of this transform type.
Mantid::API::SpecialCoordinateSystem getCoordinateSystem() const;
Mantid::Kernel::SpecialCoordinateSystem getCoordinateSystem() const;
};

/// Typedef a factory for type of PeaksTransform.
Expand Down
Expand Up @@ -31,7 +31,7 @@ class DLLExport PeakTransformQLab : public PeakTransform {
/// Get the transform friendly name.
virtual std::string getFriendlyName() const { return name(); }
/// Getter for the special coordinate representation of this transform type.
Mantid::API::SpecialCoordinateSystem getCoordinateSystem() const;
Mantid::Kernel::SpecialCoordinateSystem getCoordinateSystem() const;
};

/// Typedef a factory for type of PeaksTransform.
Expand Down
Expand Up @@ -32,7 +32,7 @@ class DLLExport PeakTransformQSample : public PeakTransform {
/// Getter for the transform name.
virtual std::string getFriendlyName() const { return name(); }
/// Getter for the special coordinate representation of this transform type.
Mantid::API::SpecialCoordinateSystem getCoordinateSystem() const;
Mantid::Kernel::SpecialCoordinateSystem getCoordinateSystem() const;
};

/// Typedef a factory for type of PeaksTransform.
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/API/src/MatrixWorkspace.cpp
Expand Up @@ -1704,9 +1704,9 @@ void MatrixWorkspace::clearMDMasking() {
/**
@return the special coordinate system used if any.
*/
Mantid::API::SpecialCoordinateSystem
Mantid::Kernel::SpecialCoordinateSystem
MatrixWorkspace::getSpecialCoordinateSystem() const {
return Mantid::API::None;
return Mantid::Kernel::None;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/API/src/PeakTransformHKL.cpp
Expand Up @@ -55,9 +55,9 @@ PeakTransformHKL::transformPeak(const Mantid::API::IPeak &peak) const {
/**
* @return Special coordinate system associated with this type of transform.
*/
Mantid::API::SpecialCoordinateSystem
Mantid::Kernel::SpecialCoordinateSystem
PeakTransformHKL::getCoordinateSystem() const {
return Mantid::API::HKL;
return Mantid::Kernel::HKL;
}
}
}
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/API/src/PeakTransformQLab.cpp
Expand Up @@ -54,9 +54,9 @@ PeakTransformQLab::transformPeak(const Mantid::API::IPeak &peak) const {
/**
* @return Special coordinate system associated with this type of transform.
*/
Mantid::API::SpecialCoordinateSystem
Mantid::Kernel::SpecialCoordinateSystem
PeakTransformQLab::getCoordinateSystem() const {
return Mantid::API::QLab;
return Mantid::Kernel::QLab;
}
}
}
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/API/src/PeakTransformQSample.cpp
Expand Up @@ -54,9 +54,9 @@ PeakTransformQSample::transformPeak(const Mantid::API::IPeak &peak) const {
/**
* @return Special coordinate system associated with this type of transform.
*/
Mantid::API::SpecialCoordinateSystem
Mantid::Kernel::SpecialCoordinateSystem
PeakTransformQSample::getCoordinateSystem() const {
return Mantid::API::QSample;
return Mantid::Kernel::QSample;
}
}
}
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h
Expand Up @@ -760,7 +760,7 @@ class MatrixWorkspaceTest : public CxxTest::TestSuite
void test_getSpecialCoordinateSystem_default()
{
WorkspaceTester ws;
TSM_ASSERT_EQUALS("Should default to no special coordinate system.", Mantid::API::None, ws.getSpecialCoordinateSystem());
TSM_ASSERT_EQUALS("Should default to no special coordinate system.", Mantid::Kernel::None, ws.getSpecialCoordinateSystem());
}

void test_getFirstPulseTime_getLastPulseTime()
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/test/MockObjects.h
Expand Up @@ -39,7 +39,7 @@ namespace
MOCK_CONST_METHOD1(transform, Mantid::Kernel::V3D(const Mantid::Kernel::V3D&));
MOCK_CONST_METHOD1(transformPeak, Mantid::Kernel::V3D(const Mantid::API::IPeak&));
MOCK_CONST_METHOD0(getFriendlyName, std::string());
MOCK_CONST_METHOD0(getCoordinateSystem, Mantid::API::SpecialCoordinateSystem());
MOCK_CONST_METHOD0(getCoordinateSystem, Mantid::Kernel::SpecialCoordinateSystem());
};

/*------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/test/PeakTransformHKLTest.h
Expand Up @@ -273,7 +273,7 @@ void test_getFriendlyName()
void test_getCoordinateSystem()
{
PeakTransformHKL transform;
TS_ASSERT_EQUALS(Mantid::API::HKL, transform.getCoordinateSystem())
TS_ASSERT_EQUALS(Mantid::Kernel::HKL, transform.getCoordinateSystem())
}

};
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/test/PeakTransformQLabTest.h
Expand Up @@ -207,7 +207,7 @@ void test_getFriendlyName()
void test_getCoordinateSystem()
{
PeakTransformQLab transform;
TS_ASSERT_EQUALS(Mantid::API::QLab, transform.getCoordinateSystem())
TS_ASSERT_EQUALS(Mantid::Kernel::QLab, transform.getCoordinateSystem())
}


Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/test/PeakTransformQSampleTest.h
Expand Up @@ -207,7 +207,7 @@ void test_getFriendlyName()
void test_getCoordinateSystem()
{
PeakTransformQSample transform;
TS_ASSERT_EQUALS(Mantid::API::QSample, transform.getCoordinateSystem())
TS_ASSERT_EQUALS(Mantid::Kernel::QSample, transform.getCoordinateSystem())
}

};
Expand Down
Expand Up @@ -88,7 +88,7 @@ namespace
MOCK_METHOD1(getSpectrum, Mantid::API::ISpectrum*(const std::size_t));
MOCK_CONST_METHOD1(getSpectrum, const Mantid::API::ISpectrum*(const std::size_t));
MOCK_METHOD3(init, void(const size_t&, const size_t&, const size_t&));
MOCK_CONST_METHOD0(getSpecialCoordinateSystem, Mantid::API::SpecialCoordinateSystem());
MOCK_CONST_METHOD0(getSpecialCoordinateSystem, Mantid::Kernel::SpecialCoordinateSystem());
virtual ~MockIEventWorkspace()
{}
};}
Expand Down
Expand Up @@ -49,7 +49,7 @@ class DLLExport PeakBackground : public HardThresholdBackground {
/// Radius estimate
double m_radiusEstimate;
/// MD coordinates to use
Mantid::API::SpecialCoordinateSystem m_mdCoordinates;
Mantid::Kernel::SpecialCoordinateSystem m_mdCoordinates;
/// Pointer to member function used for coordinate determination.
boost::function<Mantid::Kernel::V3D(const Mantid::API::IPeak *)>
m_coordFunction;
Expand All @@ -59,7 +59,7 @@ class DLLExport PeakBackground : public HardThresholdBackground {
PeakBackground(Mantid::API::IPeaksWorkspace_const_sptr peaksWS,
const double &radiusEstimate, const double &thresholdSignal,
const Mantid::API::MDNormalization normalisation,
const Mantid::API::SpecialCoordinateSystem coordinates);
const Mantid::Kernel::SpecialCoordinateSystem coordinates);

/// Copy constructor
PeakBackground(const PeakBackground &other);
Expand Down
Expand Up @@ -55,21 +55,21 @@ class DLLExport SetSpecialCoordinates : public API::Algorithm {
void init();
void exec();
std::vector<std::string> m_specialCoordinatesNames;
typedef std::map<std::string, Mantid::API::SpecialCoordinateSystem>
typedef std::map<std::string, Mantid::Kernel::SpecialCoordinateSystem>
SpecialCoordinatesNameMap;
SpecialCoordinatesNameMap m_specialCoordinatesMap;
static const std::string QLabOption();
static const std::string QSampleOption();
static const std::string HKLOption();
bool writeCoordinatesToMDEventWorkspace(
Mantid::API::Workspace_sptr inWS,
Mantid::API::SpecialCoordinateSystem coordinateSystem);
Mantid::Kernel::SpecialCoordinateSystem coordinateSystem);
bool writeCoordinatesToMDHistoWorkspace(
Mantid::API::Workspace_sptr inWS,
Mantid::API::SpecialCoordinateSystem coordinateSystem);
Mantid::Kernel::SpecialCoordinateSystem coordinateSystem);
bool writeCoordinatesToPeaksWorkspace(
Mantid::API::Workspace_sptr inWS,
Mantid::API::SpecialCoordinateSystem coordinateSystem);
Mantid::Kernel::SpecialCoordinateSystem coordinateSystem);
};

} // namespace Crystal
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/Crystal/src/PeakBackground.cpp
Expand Up @@ -26,7 +26,7 @@ PeakBackground::PeakBackground(IPeaksWorkspace_const_sptr peaksWS,
m_coordFunction = &IPeak::getQLabFrame;
} else if (m_mdCoordinates == QSample) {
m_coordFunction = &IPeak::getQSampleFrame;
} else if (m_mdCoordinates == Mantid::API::HKL) {
} else if (m_mdCoordinates == Mantid::Kernel::HKL) {
m_coordFunction = &IPeak::getHKL;
} else {
throw std::invalid_argument(
Expand Down
Expand Up @@ -28,7 +28,7 @@ PeakTransform_sptr makePeakTransform(IMDWorkspace const *const mdWS) {
peakTransformFactory = boost::make_shared<PeakTransformQLabFactory>();
} else if (mdCoordinates == QSample) {
peakTransformFactory = boost::make_shared<PeakTransformQSampleFactory>();
} else if (mdCoordinates == Mantid::API::HKL) {
} else if (mdCoordinates == Mantid::Kernel::HKL) {
peakTransformFactory = boost::make_shared<PeakTransformHKLFactory>();
}
const std::string xDim = mdWS->getDimension(0)->getName();
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/Crystal/src/SetSpecialCoordinates.cpp
Expand Up @@ -40,11 +40,11 @@ SetSpecialCoordinates::SetSpecialCoordinates() {
m_specialCoordinatesNames.push_back(SetSpecialCoordinates::HKLOption());

m_specialCoordinatesMap.insert(
std::make_pair(SetSpecialCoordinates::QLabOption(), Mantid::API::QLab));
std::make_pair(SetSpecialCoordinates::QLabOption(), Mantid::Kernel::QLab));
m_specialCoordinatesMap.insert(std::make_pair(
SetSpecialCoordinates::QSampleOption(), Mantid::API::QSample));
SetSpecialCoordinates::QSampleOption(), Mantid::Kernel::QSample));
m_specialCoordinatesMap.insert(
std::make_pair(SetSpecialCoordinates::HKLOption(), Mantid::API::HKL));
std::make_pair(SetSpecialCoordinates::HKLOption(), Mantid::Kernel::HKL));
}

//----------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/Crystal/test/FindClusterFacesTest.h
Expand Up @@ -25,7 +25,7 @@ namespace
IPeaksWorkspace_sptr create_peaks_WS(Instrument_sptr inst)
{
PeaksWorkspace* pPeaksWS = new PeaksWorkspace();
pPeaksWS->setCoordinateSystem(Mantid::API::HKL);
pPeaksWS->setCoordinateSystem(Mantid::Kernel::HKL);
IPeaksWorkspace_sptr peakWS(pPeaksWS);
peakWS->setInstrument(inst);
return peakWS;
Expand Down
8 changes: 4 additions & 4 deletions Code/Mantid/Framework/Crystal/test/PeakBackgroundTest.h
Expand Up @@ -98,7 +98,7 @@ class PeakBackgroundTest : public CxxTest::TestSuite
IPeaksWorkspace_const_sptr peaksWS = make_peaks_workspace(hklPeak);
const double radius = 1;
const double threshold = 100;
PeakBackground strategy(peaksWS, radius, threshold, NoNormalization, Mantid::API::HKL);
PeakBackground strategy(peaksWS, radius, threshold, NoNormalization, Mantid::Kernel::HKL);

MockIMDIterator mockIterator;
EXPECT_CALL(mockIterator, getNormalizedSignal()).WillOnce(Return(threshold+1)); // Returns above the threshold.
Expand All @@ -115,7 +115,7 @@ class PeakBackgroundTest : public CxxTest::TestSuite
IPeaksWorkspace_const_sptr peaksWS = make_peaks_workspace(hklPeak);
const double radius = 1;
const double threshold = 100;
PeakBackground strategy(peaksWS, radius, threshold, NoNormalization, Mantid::API::HKL);
PeakBackground strategy(peaksWS, radius, threshold, NoNormalization, Mantid::Kernel::HKL);

MockIMDIterator mockIterator;
V3D iteratorCenter(hklPeak[0] + radius, hklPeak[1], hklPeak[2]); // Offset so to be outside of peak radius.
Expand All @@ -133,7 +133,7 @@ class PeakBackgroundTest : public CxxTest::TestSuite
IPeaksWorkspace_const_sptr peaksWS = make_peaks_workspace(hklPeak);
const double radius = 1;
const double threshold = 100;
PeakBackground strategy(peaksWS, radius, threshold, NoNormalization, Mantid::API::HKL);
PeakBackground strategy(peaksWS, radius, threshold, NoNormalization, Mantid::Kernel::HKL);

MockIMDIterator mockIterator;
V3D iteratorCenter(hklPeak[0] + radius - 1e-4, hklPeak[1], hklPeak[2]); // Offset so to be outside of peak radius.
Expand All @@ -151,7 +151,7 @@ class PeakBackgroundTest : public CxxTest::TestSuite
IPeaksWorkspace_const_sptr peaksWS = make_peaks_workspace(hklPeak);
const double radius = 1;
const double threshold = 100;
PeakBackground strategy(peaksWS, radius, threshold, NoNormalization, Mantid::API::HKL);
PeakBackground strategy(peaksWS, radius, threshold, NoNormalization, Mantid::Kernel::HKL);

MockIMDIterator mockIterator;
EXPECT_CALL(mockIterator, getNormalizedSignal()).WillOnce(Return(threshold)); // Returns equal to the threshold. Exclusive checking.
Expand Down
Expand Up @@ -33,7 +33,7 @@ class PeakClusterProjectionTest: public CxxTest::TestSuite
IPeaksWorkspace_sptr create_peaks_WS(Instrument_sptr inst) const
{
PeaksWorkspace* pPeaksWS = new PeaksWorkspace();
pPeaksWS->setCoordinateSystem(Mantid::API::HKL);
pPeaksWS->setCoordinateSystem(Mantid::Kernel::HKL);
IPeaksWorkspace_sptr peakWS(pPeaksWS);
peakWS->setInstrument(inst);
return peakWS;
Expand Down Expand Up @@ -98,7 +98,7 @@ class PeakClusterProjectionTest: public CxxTest::TestSuite
void test_throws_if_mdws_has_no_coordinate_system()
{
IMDHistoWorkspace_sptr inWS = MDEventsTestHelper::makeFakeMDHistoWorkspace(1, 3, 1);
inWS->setCoordinateSystem(None);
inWS->setCoordinateSystem(Mantid::Kernel::None);

TSM_ASSERT_THROWS("Must have a known coordinate system", PeakClusterProjection object(inWS),
std::invalid_argument&);
Expand All @@ -107,7 +107,7 @@ class PeakClusterProjectionTest: public CxxTest::TestSuite
void test_throws_if_mdws_is_less_than_three_dimensional()
{
IMDHistoWorkspace_sptr inWS = MDEventsTestHelper::makeFakeMDHistoWorkspace(1, 2, 1);
inWS->setCoordinateSystem(Mantid::API::HKL);
inWS->setCoordinateSystem(Mantid::Kernel::HKL);

TSM_ASSERT_THROWS("Must be +3 dimensional", PeakClusterProjection object(inWS),
std::invalid_argument&);
Expand Down

0 comments on commit 5612143

Please sign in to comment.