Commit c805cf06 authored by Martyn Gigg's avatar Martyn Gigg
Browse files

Remove unused resetHKL method.

Refs #26829
parent 56649237
......@@ -105,6 +105,7 @@ public:
double getL() const override;
Mantid::Kernel::V3D getHKL() const override;
Mantid::Kernel::V3D getIntHKL() const override;
Mantid::Kernel::V3D getIntMNP() const override;
void setH(double m_H) override;
void setK(double m_K) override;
void setL(double m_L) override;
......@@ -112,9 +113,9 @@ public:
void setHKL(double H, double K, double L) override;
void setHKL(const Mantid::Kernel::V3D &HKL) override;
void setIntHKL(const Mantid::Kernel::V3D HKL) override;
void setIntMNP(const Mantid::Kernel::V3D &MNP) override;
void setSamplePos(double samX, double samY, double samZ) override;
void setSamplePos(const Mantid::Kernel::V3D &XYZ) override;
void resetHKL();
Mantid::Kernel::V3D getQLabFrame() const override;
Mantid::Kernel::V3D getQSampleFrame() const override;
......@@ -162,8 +163,6 @@ public:
void setCol(int m_col);
void setPeakNumber(int m_peakNumber) override;
int getPeakNumber() const override;
void setIntMNP(const Mantid::Kernel::V3D MNP) override;
Mantid::Kernel::V3D getIntMNP() const override;
virtual Mantid::Kernel::V3D getDetPos() const override;
virtual Mantid::Kernel::V3D getSamplePos() const override;
......@@ -253,17 +252,9 @@ private:
/// Cached detector position
Mantid::Kernel::V3D detPos;
/// save values before setHKL is called for use in SortHKL
double m_orig_H;
double m_orig_K;
double m_orig_L;
// keep peak number
int m_peakNumber;
Mantid::Kernel::V3D m_IntHKL;
Mantid::Kernel::V3D m_IntMNP;
/// integer HKL of the peak
Mantid::Kernel::V3D m_intHKL;
Mantid::Kernel::V3D m_intMNP;
/// List of contributing detectors IDs
std::set<int> m_detIDs;
......
......@@ -35,9 +35,8 @@ Peak::Peak()
m_sigmaIntensity(0), m_binCount(0), m_initialEnergy(0.),
m_finalEnergy(0.), m_GoniometerMatrix(3, 3, true),
m_InverseGoniometerMatrix(3, 3, true), m_runNumber(0), m_monitorCount(0),
m_row(-1), m_col(-1), m_orig_H(0), m_orig_K(0), m_orig_L(0),
m_peakNumber(0), m_IntHKL(V3D(0, 0, 0)), m_IntMNP(V3D(0, 0, 0)),
m_peakShape(boost::make_shared<NoShape>()) {
m_row(-1), m_col(-1), m_peakNumber(0), m_intHKL(V3D(0, 0, 0)),
m_intMNP(V3D(0, 0, 0)), m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
}
......@@ -57,8 +56,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst,
: m_H(0), m_K(0), m_L(0), m_intensity(0), m_sigmaIntensity(0),
m_binCount(0), m_GoniometerMatrix(3, 3, true),
m_InverseGoniometerMatrix(3, 3, true), m_runNumber(0), m_monitorCount(0),
m_orig_H(0), m_orig_K(0), m_orig_L(0), m_peakNumber(0),
m_IntHKL(V3D(0, 0, 0)), m_IntMNP(V3D(0, 0, 0)),
m_peakNumber(0), m_intHKL(V3D(0, 0, 0)), m_intMNP(V3D(0, 0, 0)),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
this->setInstrument(m_inst);
......@@ -85,8 +83,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst,
: m_H(0), m_K(0), m_L(0), m_intensity(0), m_sigmaIntensity(0),
m_binCount(0), m_GoniometerMatrix(goniometer),
m_InverseGoniometerMatrix(goniometer), m_runNumber(0), m_monitorCount(0),
m_orig_H(0), m_orig_K(0), m_orig_L(0), m_peakNumber(0),
m_IntHKL(V3D(0, 0, 0)), m_IntMNP(V3D(0, 0, 0)),
m_peakNumber(0), m_intHKL(V3D(0, 0, 0)), m_intMNP(V3D(0, 0, 0)),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
if (fabs(m_InverseGoniometerMatrix.Invert()) < 1e-8)
......@@ -109,8 +106,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst, int m_detectorID,
: m_H(0), m_K(0), m_L(0), m_intensity(0), m_sigmaIntensity(0),
m_binCount(0), m_GoniometerMatrix(3, 3, true),
m_InverseGoniometerMatrix(3, 3, true), m_runNumber(0), m_monitorCount(0),
m_orig_H(0), m_orig_K(0), m_orig_L(0), m_peakNumber(0),
m_IntHKL(V3D(0, 0, 0)), m_IntMNP(V3D(0, 0, 0)),
m_peakNumber(0), m_intHKL(V3D(0, 0, 0)), m_intMNP(V3D(0, 0, 0)),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
this->setInstrument(m_inst);
......@@ -132,8 +128,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst, int m_detectorID,
: m_H(HKL[0]), m_K(HKL[1]), m_L(HKL[2]), m_intensity(0),
m_sigmaIntensity(0), m_binCount(0), m_GoniometerMatrix(3, 3, true),
m_InverseGoniometerMatrix(3, 3, true), m_runNumber(0), m_monitorCount(0),
m_orig_H(0), m_orig_K(0), m_orig_L(0), m_peakNumber(0),
m_IntHKL(V3D(0, 0, 0)), m_IntMNP(V3D(0, 0, 0)),
m_peakNumber(0), m_intHKL(V3D(0, 0, 0)), m_intMNP(V3D(0, 0, 0)),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
this->setInstrument(m_inst);
......@@ -157,8 +152,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst, int m_detectorID,
: m_H(HKL[0]), m_K(HKL[1]), m_L(HKL[2]), m_intensity(0),
m_sigmaIntensity(0), m_binCount(0), m_GoniometerMatrix(goniometer),
m_InverseGoniometerMatrix(goniometer), m_runNumber(0), m_monitorCount(0),
m_orig_H(0), m_orig_K(0), m_orig_L(0), m_peakNumber(0),
m_IntHKL(V3D(0, 0, 0)), m_IntMNP(V3D(0, 0, 0)),
m_peakNumber(0), m_intHKL(V3D(0, 0, 0)), m_intMNP(V3D(0, 0, 0)),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
if (fabs(m_InverseGoniometerMatrix.Invert()) < 1e-8)
......@@ -181,8 +175,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst, double scattering,
: m_H(0), m_K(0), m_L(0), m_intensity(0), m_sigmaIntensity(0),
m_binCount(0), m_GoniometerMatrix(3, 3, true),
m_InverseGoniometerMatrix(3, 3, true), m_runNumber(0), m_monitorCount(0),
m_row(-1), m_col(-1), m_orig_H(0), m_orig_K(0), m_orig_L(0),
m_IntHKL(V3D(0, 0, 0)), m_IntMNP(V3D(0, 0, 0)),
m_row(-1), m_col(-1), m_intHKL(V3D(0, 0, 0)), m_intMNP(V3D(0, 0, 0)),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
this->setInstrument(m_inst);
......@@ -210,11 +203,9 @@ Peak::Peak(const Peak &other)
m_runNumber(other.m_runNumber), m_monitorCount(other.m_monitorCount),
m_row(other.m_row), m_col(other.m_col), sourcePos(other.sourcePos),
samplePos(other.samplePos), detPos(other.detPos),
m_orig_H(other.m_orig_H), m_orig_K(other.m_orig_K),
m_orig_L(other.m_orig_L), m_peakNumber(other.m_peakNumber),
m_IntHKL(other.m_IntHKL), m_IntMNP(other.m_IntMNP),
m_detIDs(other.m_detIDs), m_peakShape(other.m_peakShape->clone()),
convention(other.convention) {}
m_peakNumber(other.m_peakNumber), m_intHKL(other.m_intHKL),
m_intMNP(other.m_intMNP), m_detIDs(other.m_detIDs),
m_peakShape(other.m_peakShape->clone()), convention(other.convention) {}
//----------------------------------------------------------------------------------------------
/** Constructor making a Peak from IPeak interface
......@@ -233,9 +224,9 @@ Peak::Peak(const Geometry::IPeak &ipeak)
m_InverseGoniometerMatrix(ipeak.getGoniometerMatrix()),
m_runNumber(ipeak.getRunNumber()),
m_monitorCount(ipeak.getMonitorCount()), m_row(ipeak.getRow()),
m_col(ipeak.getCol()), m_orig_H(0.), m_orig_K(0.), m_orig_L(0.),
m_peakNumber(ipeak.getPeakNumber()), m_IntHKL(ipeak.getIntHKL()),
m_IntMNP(ipeak.getIntMNP()), m_peakShape(boost::make_shared<NoShape>()) {
m_col(ipeak.getCol()), m_peakNumber(ipeak.getPeakNumber()),
m_intHKL(ipeak.getIntHKL()), m_intMNP(ipeak.getIntMNP()),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
if (fabs(m_InverseGoniometerMatrix.Invert()) < 1e-8)
throw std::invalid_argument(
......@@ -770,7 +761,10 @@ double Peak::getL() const { return m_L; }
Mantid::Kernel::V3D Peak::getHKL() const { return V3D(m_H, m_K, m_L); }
/** Return the int HKL vector */
Mantid::Kernel::V3D Peak::getIntHKL() const { return m_IntHKL; }
Mantid::Kernel::V3D Peak::getIntHKL() const { return m_intHKL; }
/** Return the int MNP vector */
V3D Peak::getIntMNP() const { return m_intMNP; }
//----------------------------------------------------------------------------------------------
/** Set the H index of this peak
......@@ -793,35 +787,16 @@ void Peak::setBankName(std::string m_bankName) {
/** Set all three H,K,L indices of the peak */
void Peak::setHKL(double H, double K, double L) {
if (m_orig_H == 0 && m_orig_K == 0 && m_orig_L == 0) {
m_orig_H = m_H;
m_orig_K = m_K;
m_orig_L = m_L;
}
m_H = H;
m_K = K;
m_L = L;
}
/** Reset all three H,K,L indices of the peak to values before setHKL */
void Peak::resetHKL() {
if (m_orig_H == 0 && m_orig_K == 0 && m_orig_L == 0)
return;
m_H = m_orig_H;
m_K = m_orig_K;
m_L = m_orig_L;
}
/** Set all HKL
*
* @param HKL :: vector with x,y,z -> h,k,l
*/
void Peak::setHKL(const Mantid::Kernel::V3D &HKL) {
if (m_orig_H == 0 && m_orig_K == 0 && m_orig_L == 0) {
m_orig_H = m_H;
m_orig_K = m_K;
m_orig_L = m_L;
}
m_H = HKL.X();
m_K = HKL.Y();
m_L = HKL.Z();
......@@ -832,10 +807,18 @@ void Peak::setHKL(const Mantid::Kernel::V3D &HKL) {
* @param HKL :: vector with integer x,y,z -> h,k,l
*/
void Peak::setIntHKL(V3D HKL) {
m_IntHKL = V3D(boost::math::iround(HKL[0]), boost::math::iround(HKL[1]),
m_intHKL = V3D(boost::math::iround(HKL[0]), boost::math::iround(HKL[1]),
boost::math::iround(HKL[2]));
}
/** Sets the modulated peak structure number
* @param MNP :: modulated peak structure value
*/
void Peak::setIntMNP(const V3D &MNP) {
m_intMNP = V3D(boost::math::iround(MNP[0]), boost::math::iround(MNP[1]),
boost::math::iround(MNP[2]));
}
/** Set sample position
*
* @ doubles x,y,z-> samplePos(x), samplePos(y), samplePos(z)
......@@ -946,11 +929,6 @@ int Peak::getCol() const { return m_col; }
* Returns -1 if it could not find it. */
int Peak::getPeakNumber() const { return m_peakNumber; }
// -------------------------------------------------------------------------------------
/**Returns the unique peak number
* Returns -1 if it could not find it. */
V3D Peak::getIntMNP() const { return m_IntMNP; }
// -------------------------------------------------------------------------------------
/** For RectangularDetectors only, sets the row (y) of the pixel of the
* detector.
......@@ -970,14 +948,6 @@ void Peak::setPeakNumber(int m_peakNumber) {
this->m_peakNumber = m_peakNumber;
}
// -------------------------------------------------------------------------------------
/** Sets the modulated peak structure number
* @param MNP :: modulated peak structure value */
void Peak::setIntMNP(V3D MNP) {
m_IntMNP = V3D(boost::math::iround(MNP[0]), boost::math::iround(MNP[1]),
boost::math::iround(MNP[2]));
}
// -------------------------------------------------------------------------------------
/** Return the detector position vector */
Mantid::Kernel::V3D Peak::getDetPos() const { return detPos; }
......@@ -1091,12 +1061,9 @@ Peak &Peak::operator=(const Peak &other) {
sourcePos = other.sourcePos;
samplePos = other.samplePos;
detPos = other.detPos;
m_orig_H = other.m_orig_H;
m_orig_K = other.m_orig_K;
m_orig_L = other.m_orig_L;
m_detIDs = other.m_detIDs;
m_IntHKL = other.m_IntHKL;
m_IntMNP = other.m_IntMNP;
m_intHKL = other.m_intHKL;
m_intMNP = other.m_intMNP;
convention = other.convention;
m_peakShape.reset(other.m_peakShape->clone());
}
......
......@@ -94,7 +94,7 @@ public:
virtual void setPeakNumber(int m_PeakNumber) = 0;
virtual Mantid::Kernel::V3D getIntMNP() const = 0;
virtual void setIntMNP(const Mantid::Kernel::V3D MNP) = 0;
virtual void setIntMNP(const Mantid::Kernel::V3D & MNP) = 0;
virtual Mantid::Kernel::Matrix<double> getGoniometerMatrix() const = 0;
virtual void setGoniometerMatrix(
......
......@@ -76,7 +76,7 @@ public:
MOCK_CONST_METHOD0(getIntMNP, Mantid::Kernel::V3D());
MOCK_METHOD1(setRunNumber, void(int m_RunNumber));
MOCK_METHOD1(setPeakNumber, void(int m_PeakNumber));
MOCK_METHOD1(setIntMNP, void(const Mantid::Kernel::V3D m_modStru));
MOCK_METHOD1(setIntMNP, void(const Mantid::Kernel::V3D &m_modStru));
MOCK_CONST_METHOD0(getMonitorCount, double());
MOCK_METHOD1(setMonitorCount, void(double m_MonitorCount));
MOCK_CONST_METHOD0(getH, double());
......
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