Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
440b6131
Commit
440b6131
authored
13 years ago
by
Nick Draper
Browse files
Options
Downloads
Patches
Plain Diff
fixes #3367
Change from using getPlottable to getDetectors
parent
05fc5b37
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Mantid/Framework/DataHandling/src/FindDetectorsInShape.cpp
+19
-9
19 additions, 9 deletions
...antid/Framework/DataHandling/src/FindDetectorsInShape.cpp
with
19 additions
and
9 deletions
Code/Mantid/Framework/DataHandling/src/FindDetectorsInShape.cpp
+
19
−
9
View file @
440b6131
...
@@ -70,21 +70,31 @@ void FindDetectorsInShape::initDocs()
...
@@ -70,21 +70,31 @@ void FindDetectorsInShape::initDocs()
//get the instrument out of the workspace
//get the instrument out of the workspace
IInstrument_sptr
instrument_sptr
=
WS
->
getInstrument
();
IInstrument_sptr
instrument_sptr
=
WS
->
getInstrument
();
IInstrument
::
plottables_const_sptr
objCmptList
=
instrument_sptr
->
getPlottable
();
//To get all the detector ID's
detid2det_map
allDetectors
;
instrument_sptr
->
getDetectors
(
allDetectors
);
std
::
vector
<
int
>
foundDets
;
std
::
vector
<
int
>
foundDets
;
//progress
//progress
IInstrument
::
plottables
::
size_type
objCmptCount
=
objCmptList
->
size
();
detid2det_map
::
size_type
objCmptCount
=
allDetectors
.
size
();
int
iprogress_step
=
static_cast
<
int
>
(
objCmptCount
/
100
);
int
iprogress_step
=
static_cast
<
int
>
(
objCmptCount
/
100
);
if
(
iprogress_step
==
0
)
iprogress_step
=
1
;
if
(
iprogress_step
==
0
)
iprogress_step
=
1
;
int
iprogress
=
0
;
//Now go through all
detid2det_map
::
iterator
it
;
detid2det_map
::
const_iterator
it_end
=
allDetectors
.
end
();
for
(
it
=
allDetectors
.
begin
();
it
!=
it_end
;
it
++
)
{
detid_t
detectorID
=
it
->
first
;
Geometry
::
IDetector_sptr
det
=
it
->
second
;
//for every plottable item
for
(
IInstrument
::
plottables
::
const_iterator
it
=
objCmptList
->
begin
();
it
!=
objCmptList
->
end
();
++
it
)
{
//attempt to dynamic cast up to an IDetector
//attempt to dynamic cast up to an IDetector
boost
::
shared_ptr
<
const
Geometry
::
IDetector
>
detector_sptr
=
boost
::
shared_ptr
<
const
Geometry
::
IDetector
>
detector_sptr
=
boost
::
dynamic_pointer_cast
<
const
Geometry
::
IDetector
>
(
(
*
it
)
);
boost
::
dynamic_pointer_cast
<
const
Geometry
::
IDetector
>
(
it
->
second
);
if
(
detector_sptr
)
if
(
detector_sptr
)
{
{
...
@@ -100,10 +110,10 @@ void FindDetectorsInShape::initDocs()
...
@@ -100,10 +110,10 @@ void FindDetectorsInShape::initDocs()
}
}
}
}
i
nt
i
=
static_cast
<
int
>
(
objCmptList
->
end
()
-
it
)
;
i
progress
++
;
if
(
i
%
iprogress_step
==
0
)
if
(
i
progress
%
iprogress_step
==
0
)
{
{
progress
(
static_cast
<
double
>
(
i
)
/
static_cast
<
double
>
(
objCmptCount
));
progress
(
static_cast
<
double
>
(
i
progress
)
/
static_cast
<
double
>
(
objCmptCount
));
interruption_point
();
interruption_point
();
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment