Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
597dc38d
Commit
597dc38d
authored
Jul 04, 2013
by
Owen Arnold
Browse files
refs #7386. Rename functions.
parent
b2d1be39
Changes
5
Hide whitespace changes
Inline
Side-by-side
Code/Mantid/Framework/API/inc/MantidAPI/IPeak.h
View file @
597dc38d
...
...
@@ -46,7 +46,7 @@ namespace API
virtual
void
setHKL
(
double
H
,
double
K
,
double
L
)
=
0
;
virtual
void
setHKL
(
Mantid
::
Kernel
::
V3D
HKL
)
=
0
;
virtual
Mantid
::
Kernel
::
V3D
getDetectorPosition
()
const
=
0
;
virtual
Mantid
::
Kernel
::
V3D
getDetectorPosition
Safe
()
const
=
0
;
virtual
Mantid
::
Kernel
::
V3D
getDetectorPosition
NoCheck
()
const
=
0
;
virtual
Mantid
::
Kernel
::
V3D
getQLabFrame
()
const
=
0
;
virtual
Mantid
::
Kernel
::
V3D
getQSampleFrame
()
const
=
0
;
...
...
Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/Peak.h
View file @
597dc38d
...
...
@@ -70,7 +70,7 @@ namespace DataObjects
Mantid
::
Kernel
::
V3D
getQLabFrame
()
const
;
Mantid
::
Kernel
::
V3D
getQSampleFrame
()
const
;
Mantid
::
Kernel
::
V3D
getDetectorPosition
()
const
;
Mantid
::
Kernel
::
V3D
getDetectorPosition
Safe
()
const
;
Mantid
::
Kernel
::
V3D
getDetectorPosition
NoCheck
()
const
;
void
setQSampleFrame
(
Mantid
::
Kernel
::
V3D
QSampleFrame
,
double
detectorDistance
=
1.0
);
void
setQLabFrame
(
Mantid
::
Kernel
::
V3D
QLabFrame
,
double
detectorDistance
=
1.0
);
...
...
Code/Mantid/Framework/DataObjects/src/Peak.cpp
View file @
597dc38d
...
...
@@ -807,7 +807,7 @@ namespace DataObjects
/**
Forwarding function. Exposes the detector position directly.
*/
Mantid
::
Kernel
::
V3D
Peak
::
getDetectorPosition
()
const
Mantid
::
Kernel
::
V3D
Peak
::
getDetectorPosition
NoCheck
()
const
{
return
getDetector
()
->
getPos
();
}
...
...
@@ -816,7 +816,7 @@ namespace DataObjects
Forwarding function. Exposes the detector position directly, but checks that the detector is not null before
accessing its position. Throws if null.
*/
Mantid
::
Kernel
::
V3D
Peak
::
getDetectorPosition
Safe
()
const
Mantid
::
Kernel
::
V3D
Peak
::
getDetectorPosition
()
const
{
auto
det
=
getDetector
();
if
(
det
==
NULL
)
...
...
Code/Mantid/Framework/DataObjects/test/PeakTest.h
View file @
597dc38d
...
...
@@ -330,14 +330,14 @@ public:
TS_ASSERT_EQUALS
(
p2
.
getDetectorID
(),
19999
);
}
void
test_getDetectorPosition
Safe
()
void
test_getDetectorPosition
()
{
const
int
detectorId
=
19999
;
const
double
wavelength
=
2
;
Peak
p
(
inst
,
detectorId
,
wavelength
);
V3D
a
=
p
.
getDetectorPosition
();
V3D
b
=
p
.
getDetectorPosition
Safe
();
V3D
b
=
p
.
getDetectorPosition
NoCheck
();
TSM_ASSERT_EQUALS
(
"Results should be the same"
,
a
,
b
);
}
...
...
@@ -347,9 +347,9 @@ public:
const
int
detectorId
=
19999
;
const
double
wavelength
=
2
;
Peak
p
(
inst
,
detectorId
,
wavelength
);
TSM_ASSERT_THROWS_NOTHING
(
"Nothing wrong here, detector is valid"
,
p
.
getDetectorPosition
Safe
());
TSM_ASSERT_THROWS_NOTHING
(
"Nothing wrong here, detector is valid"
,
p
.
getDetectorPosition
());
p
.
setQLabFrame
(
V3D
(
1
,
1
,
1
),
1
);
// This sets the detector pointer to null and detector id to -1;
TSM_ASSERT_THROWS
(
"Detector is not valid"
,
p
.
getDetectorPosition
Safe
(),
Mantid
::
Kernel
::
Exception
::
NotFoundError
&
);
TSM_ASSERT_THROWS
(
"Detector is not valid"
,
p
.
getDetectorPosition
(),
Mantid
::
Kernel
::
Exception
::
NotFoundError
&
);
}
private:
...
...
Code/Mantid/MantidQt/SliceViewer/test/MockObjects.h
View file @
597dc38d
...
...
@@ -236,7 +236,7 @@ class MockPeakTransformFactory : public PeakTransformFactory
double
());
MOCK_CONST_METHOD0
(
getDetectorPosition
,
Mantid
::
Kernel
::
V3D
());
MOCK_CONST_METHOD0
(
getDetectorPosition
Safe
,
MOCK_CONST_METHOD0
(
getDetectorPosition
NoCheck
,
Mantid
::
Kernel
::
V3D
());
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment