Skip to content

Commit

Permalink
Make ContaintsRectDetectors deal with situations when instrument does
Browse files Browse the repository at this point in the history
not have sample or source.

Refs #7441
  • Loading branch information
arturbekasov committed Jul 22, 2013
1 parent a007ce8 commit 1ca1df0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Code/Mantid/Framework/Geometry/src/Instrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1241,16 +1241,20 @@ namespace Mantid

bool foundRect = false;
bool foundNonRect = false;

IComponent_const_sptr comp;

while(!compQueue.empty() && !(foundRect && foundNonRect))
{
comp = compQueue.front();
compQueue.pop();

// Skip source and sample components
if(getSource()->getComponentID() == comp->getComponentID()
|| getSample()->getComponentID() == comp->getComponentID())
// Skip source, is has one
if(m_sourceCache && m_sourceCache->getComponentID() == comp->getComponentID())
continue;

// Skip sample, if has one
if(m_sampleCache && m_sampleCache->getComponentID() == comp->getComponentID())
continue;

// Skip monitors
Expand Down

0 comments on commit 1ca1df0

Please sign in to comment.