Commit 9f2e054c authored by Samuel Jackson's avatar Samuel Jackson
Browse files

Refs #21208 Apply clang format patch

parent 026c9670
......@@ -85,7 +85,8 @@ public:
* @param position :: V3D positon of the peak.
* @param position :: Coordinate system frame of the peak position.
*/
virtual void addPeak(const Kernel::V3D &position, const Kernel::SpecialCoordinateSystem &frame) = 0;
virtual void addPeak(const Kernel::V3D &position,
const Kernel::SpecialCoordinateSystem &frame) = 0;
//---------------------------------------------------------------------------------------------
/** Return a reference to the Peak
......@@ -120,7 +121,7 @@ public:
*/
virtual Mantid::Geometry::IPeak *
createPeak(const Mantid::Kernel::V3D &QLabFrame,
boost::optional<double> detectorDistance= boost::none) const = 0;
boost::optional<double> detectorDistance = boost::none) const = 0;
//---------------------------------------------------------------------------------------------
/** Create an instance of a Peak
......
......@@ -102,7 +102,8 @@ public:
void addPeak(const Geometry::IPeak &peak) override;
/// Move a peak object into this peaks workspace
void addPeak(Peak &&peak);
void addPeak(const Kernel::V3D &position, const Kernel::SpecialCoordinateSystem &frame) override;
void addPeak(const Kernel::V3D &position,
const Kernel::SpecialCoordinateSystem &frame) override;
Peak &getPeak(int peakNum) override;
const Peak &getPeak(int peakNum) const override;
......@@ -110,9 +111,9 @@ public:
const Kernel::V3D &QLabFrame,
boost::optional<double> detectorDistance = boost::none) const override;
std::unique_ptr<Geometry::IPeak> createPeak(
const Kernel::V3D &Position,
const Kernel::SpecialCoordinateSystem& frame) const override;
std::unique_ptr<Geometry::IPeak>
createPeak(const Kernel::V3D &Position,
const Kernel::SpecialCoordinateSystem &frame) const override;
std::vector<std::pair<std::string, std::string>>
peakInfo(const Kernel::V3D &qFrame, bool labCoords) const override;
......
......@@ -188,8 +188,8 @@ void PeaksWorkspace::addPeak(const Geometry::IPeak &ipeak) {
* @param position :: position on the peak in the specified coordinate frame
* @param frame :: the coordinate frame that the position is specified in
*/
void PeaksWorkspace::addPeak(const V3D &position, const SpecialCoordinateSystem &frame)
{
void PeaksWorkspace::addPeak(const V3D &position,
const SpecialCoordinateSystem &frame) {
auto peak = createPeak(position, frame);
addPeak(*peak);
}
......@@ -260,23 +260,23 @@ PeaksWorkspace::createPeak(const Kernel::V3D &QLabFrame,
std::unique_ptr<Geometry::IPeak>
PeaksWorkspace::createPeak(const Kernel::V3D &position,
const Kernel::SpecialCoordinateSystem &frame) const {
if (frame == Mantid::Kernel::HKL) {
return std::unique_ptr<Geometry::IPeak>(createPeakHKL(position));
} else if (frame == Mantid::Kernel::QLab) {
return std::unique_ptr<Geometry::IPeak>(createPeak(position));
} else {
return std::unique_ptr<Geometry::IPeak>(createPeakQSample(position));
}
if (frame == Mantid::Kernel::HKL) {
return std::unique_ptr<Geometry::IPeak>(createPeakHKL(position));
} else if (frame == Mantid::Kernel::QLab) {
return std::unique_ptr<Geometry::IPeak>(createPeak(position));
} else {
return std::unique_ptr<Geometry::IPeak>(createPeakQSample(position));
}
}
//---------------------------------------------------------------------------------------------
/** Creates an instance of a Peak BUT DOES NOT ADD IT TO THE WORKSPACE
* @param position :: QSample position of the center of the peak, in reciprocal space
* @param position :: QSample position of the center of the peak, in reciprocal
* space
* detector. You do NOT need to explicitly provide this distance.
* @return a pointer to a new Peak object.
*/
Peak *PeaksWorkspace::createPeakQSample(const V3D &position) const
{
Peak *PeaksWorkspace::createPeakQSample(const V3D &position) const {
// Create a peak from QSampleFrame
const auto goniometer = run().getGoniometer();
// create a peak using the qLab frame
......
......@@ -370,18 +370,18 @@ public:
peak->getHKL());
TSM_ASSERT_EQUALS("New peak should have QLab we expected.", params.qLab,
peak->getQLabFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.", params.qSample,
peak->getQSampleFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.",
params.qSample, peak->getQSampleFrame());
auto detector = peak->getDetector();
TSM_ASSERT("No detector", detector);
TSM_ASSERT_EQUALS("This detector id does not match what we expect from the "
"instrument definition",
1, detector->getID());
TSM_ASSERT_EQUALS("Thie detector position is wrong", params.detectorPosition,
detector->getPos());
TSM_ASSERT_EQUALS("Goniometer has not been set properly", params.goniometer.getR(),
peak->getGoniometerMatrix());
TSM_ASSERT_EQUALS("Thie detector position is wrong",
params.detectorPosition, detector->getPos());
TSM_ASSERT_EQUALS("Goniometer has not been set properly",
params.goniometer.getR(), peak->getGoniometerMatrix());
// Clean up.
delete peak;
......@@ -397,8 +397,8 @@ public:
peak->getHKL());
TSM_ASSERT_EQUALS("New peak should have QLab we expected.", params.qLab,
peak->getQLabFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.", params.qSample,
peak->getQSampleFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.",
params.qSample, peak->getQSampleFrame());
}
void test_create_peak_with_position_qsample() {
......@@ -409,8 +409,8 @@ public:
TSM_ASSERT_EQUALS("New peak should have QLab we expected.", params.qLab,
peak->getQLabFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.", params.qSample,
peak->getQSampleFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.",
params.qSample, peak->getQSampleFrame());
}
void test_create_peak_with_position_qlab() {
......@@ -421,8 +421,8 @@ public:
TSM_ASSERT_EQUALS("New peak should have QLab we expected.", params.qLab,
peak->getQLabFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.", params.qSample,
peak->getQSampleFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.",
params.qSample, peak->getQSampleFrame());
}
void test_add_peak_with_position_hkl() {
......@@ -438,8 +438,8 @@ public:
peak.getHKL());
TSM_ASSERT_EQUALS("New peak should have QLab we expected.", params.qLab,
peak.getQLabFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.", params.qSample,
peak.getQSampleFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.",
params.qSample, peak.getQSampleFrame());
}
void test_add_peak_with_position_qlab() {
......@@ -453,8 +453,8 @@ public:
TSM_ASSERT_EQUALS("New peak should have QLab we expected.", params.qLab,
peak.getQLabFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.", params.qSample,
peak.getQSampleFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.",
params.qSample, peak.getQSampleFrame());
}
void test_add_peak_with_position_qsample() {
......@@ -468,8 +468,8 @@ public:
TSM_ASSERT_EQUALS("New peak should have QLab we expected.", params.qLab,
peak.getQLabFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.", params.qSample,
peak.getQSampleFrame());
TSM_ASSERT_EQUALS("New peak should have QSample we expected.",
params.qSample, peak.getQSampleFrame());
}
/**
......@@ -601,14 +601,13 @@ private:
1, 1, 1, 90, 90, 90); // U is identity, real and reciprocal lattice
// vectors are identical.
V3D qSample = Rinv * qLab;
V3D hkl = qSample / (2 * M_PI); // Given our settings above, this is the
// simplified relationship between qLab and
// hkl.
// simplified relationship between qLab and
// hkl.
return PeakParameters {minimalInstrument, goniometer, orientedLattice,
hkl, qLab, qSample, detectorPos};
return PeakParameters{minimalInstrument, goniometer, orientedLattice, hkl,
qLab, qSample, detectorPos};
}
PeaksWorkspace_sptr makeWorkspace(const PeakParameters &params) {
......
......@@ -38,9 +38,7 @@ IPeak *createPeakQLabWithDistance(IPeaksWorkspace &self, const object &data,
detectorDistance);
}
/// Create a peak via it's QLab value from a list or numpy array
void addPeak(IPeaksWorkspace &self, const IPeak& peak) {
self.addPeak(peak);
}
void addPeak(IPeaksWorkspace &self, const IPeak &peak) { self.addPeak(peak); }
}
void export_IPeaksWorkspace() {
......
......@@ -34,8 +34,7 @@ PeaksWorkspaceWidget::PeaksWorkspaceWidget(
Mantid::API::IPeaksWorkspace_const_sptr ws,
const std::string &coordinateSystem,
PeakViewColor defaultForegroundPeakViewColor,
PeakViewColor defaultBackgroundPeakViewColor,
PeaksViewer *parent)
PeakViewColor defaultBackgroundPeakViewColor, PeaksViewer *parent)
: QWidget(parent), m_ws(ws), m_coordinateSystem(coordinateSystem),
m_foregroundPeakViewColor(defaultForegroundPeakViewColor),
m_backgroundPeakViewColor(defaultBackgroundPeakViewColor),
......
Markdown is supported
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