8#include "MantidBeamline/ComponentType.h"
15using Mantid::Beamline::ComponentType;
26 auto parent = compInfo.
parent(detIndex);
27 auto grandParent = compInfo.
parent(parent);
29 auto greatGrandParent = compInfo.
parent(parent);
30 auto greatGrandParentType = compInfo.
componentType(greatGrandParent);
33 (grandParentType == ComponentType::Rectangular || grandParentType == ComponentType::Structured ||
34 greatGrandParentType == ComponentType::Grid)) {
57 if (compInfo.
sample() == idx)
60 if (compInfo.
source() == idx)
69 return std::none_of(detectors.cbegin(), detectors.cend(),
70 [&detInfo](
const auto &det) { return detInfo.isMonitor(det); });
84 size_t next = current;
85 while (next != compInfo.
root()) {
86 if (next == possibleAncestor)
88 next = compInfo.
parent(next);
107 const size_t currentIdx) {
109 if ((ancestorIdx <= currentIdx)) {
110 throw std::invalid_argument(
"Index of ancestor component is not higher than current Index.");
113 if (ancestorIdx == currentIdx) {
117 auto transformation = Eigen::Affine3d(
119 transformation.translate(-ancestorPos);
ComponentInfo : Provides a component centric view on to the instrument.
bool hasDetectors(const size_t componentIndex) const
size_t parent(const size_t componentIndex) const
Kernel::Quat rotation(const size_t componentIndex) const
Kernel::V3D position(const size_t componentIndex) const
std::vector< size_t > detectorsInSubtree(size_t componentIndex) const
bool isDetector(const size_t componentIndex) const
Beamline::ComponentType componentType(const size_t componentIndex) const
Geometry::DetectorInfo is an intermediate step towards a DetectorInfo that is part of Instrument-2....
MANTID_GEOMETRY_DLL Eigen::Vector3d offsetFromAncestor(const Mantid::Geometry::ComponentInfo &compInfo, const size_t ancestorIdx, const size_t currentIdx)
Returns the position of the component at the current index relative to the ancestor component at the ...
MANTID_GEOMETRY_DLL bool isAncestorOf(const ComponentInfo &compInfo, const size_t possibleAncestor, const size_t current)
Finds all ancestors up to the root of a component index and returns true if the possible ancestor is ...
MANTID_GEOMETRY_DLL bool isSaveableBank(const ComponentInfo &compInfo, const DetectorInfo &detInfo, const size_t idx)
Function: isSaveableBank.
MANTID_GEOMETRY_DLL bool isDetectorFixedInBank(const ComponentInfo &compInfo, const size_t detIndex)
Tests whether or not the detector is within a fixed bank.
Eigen::Vector3d toVector3d(const Kernel::V3D &vec)
Converts Kernel::V3D to Eigen::Vector3d.
Eigen::Quaterniond toQuaterniond(const Kernel::Quat &quat)
Converts Kernel::Quat to Eigen::Quaterniond.