Mantid
Loading...
Searching...
No Matches
ComponentInfoItem.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 "MantidKernel/Quat.h"
10#include "MantidKernel/V3D.h"
11#include <vector>
12
13namespace Mantid {
14namespace Geometry {
15
20template <typename T> class ComponentInfoItem {
21public:
22 ComponentInfoItem(T &componentInfo, const size_t index) : m_componentInfo(&componentInfo), m_index(index) {}
23
24 bool isDetector() const { return m_componentInfo->isDetector(m_index); }
25 std::vector<size_t> detectorsInSubtree() const { return m_componentInfo->detectorsInSubtree(m_index); }
26 std::vector<size_t> componentsInSubtree() const { return m_componentInfo->componentsInSubtree(m_index); }
27 const std::vector<size_t> &children() const { return m_componentInfo->children(m_index); }
28 Kernel::V3D position() const { return m_componentInfo->position(m_index); }
29 Kernel::Quat rotation() const { return m_componentInfo->rotation(m_index); }
30 size_t parent() const { return m_componentInfo->parent(m_index); }
31 bool hasParent() const { return m_componentInfo->hasParent(m_index); }
32 Kernel::V3D scaleFactor() const { return m_componentInfo->scaleFactor(m_index); }
33 std::string name() const { return m_componentInfo->name(m_index); }
34 size_t index() const { return m_index; }
35
36 // Non-owning pointer. A reference makes the class unable to define an
37 // assignment operator that we need.
39 size_t m_index;
40};
41
42} // namespace Geometry
43} // namespace Mantid
ComponentInfoItem Return type for ComponentInfoIterators.
std::vector< size_t > detectorsInSubtree() const
ComponentInfoItem(T &componentInfo, const size_t index)
std::vector< size_t > componentsInSubtree() const
const std::vector< size_t > & children() const
Class for quaternions.
Definition: Quat.h:39
Class for 3D vectors.
Definition: V3D.h:34
Helper class which provides the Collimation Length for SANS instruments.