Mantid
Loading...
Searching...
No Matches
InstrumentRayTracer.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include "MantidGeometry/DllConfig.h"
12#include <boost/unordered_map.hpp>
13#include <deque>
14#include <list>
15#include <mutex>
16
17namespace Mantid {
18namespace Kernel {
19class V3D;
20}
21namespace Geometry {
22class ComponentInfo;
23class DetectorInfo;
24struct Link;
25class Track;
28
37class MANTID_GEOMETRY_DLL InstrumentRayTracer {
38public:
41 InstrumentRayTracer(ComponentInfo const &componentInfo, DetectorInfo const &detectorInfo);
44 void trace(const Kernel::V3D &dir) const;
45 void traceFromSample(const Kernel::V3D &dir) const;
48 Links getResults() const;
49
52 size_t getDetectorResult() const;
55 const ComponentInfo &componentInfo() const;
56 const DetectorInfo &detectorInfo() const;
57
58private:
60 void fireRay(Track &testRay) const;
62 void testIntersectionWithShape(size_t const index, Track &testRay) const;
64 void testIntersectionWithGrid(size_t const index, Track &testRay) const;
65
74 mutable boost::unordered_map<size_t, BoundingBox> m_boxCache;
76 mutable std::mutex m_mutex;
77};
78} // namespace Geometry
79} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
ComponentInfo : Provides a component centric view on to the instrument.
Geometry::DetectorInfo is an intermediate step towards a DetectorInfo that is part of Instrument-2....
This class is responsible for tracking rays and accumulating a list of objects that are intersected a...
Track m_resultsTrack
Accumulate results in this Track object, aids performance.
ComponentInfo const & m_componentInfo
ComponentInfo of the instrument being traced.
std::mutex m_mutex
Mutex to lock box cache.
boost::unordered_map< size_t, BoundingBox > m_boxCache
Map of component index -> bounding box.
DetectorInfo const & m_detectorInfo
DetectorInfo of the instrument being traced.
Defines a track as a start point and a direction.
Definition Track.h:165
boost::container::small_vector< Link, 5 > LType
Definition Track.h:167
Class for 3D vectors.
Definition V3D.h:35
Track::LType Links
Typedef for object intersections.
Helper class which provides the Collimation Length for SANS instruments.