Mantid
Loading...
Searching...
No Matches
PanelsSurfaceCalculator.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2025 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 "MantidAPI/DllConfig.h"
12#include "MantidKernel/Logger.h"
13#include "MantidKernel/Quat.h"
14#include "MantidKernel/V2D.h"
15#include "MantidKernel/V3D.h"
16
17#include <functional>
18#include <optional>
19#include <vector>
20
25
26namespace Mantid {
27namespace API {
28class MANTID_API_DLL PanelsSurfaceCalculator {
29public:
30 void setupBasisAxes(const V3D &zaxis, V3D &xaxis, V3D &yaxis) const;
31 std::vector<V3D> retrievePanelCorners(const ComponentInfo &componentInfo, const size_t rootIndex) const;
32 V3D calculatePanelNormal(const std::vector<V3D> &panelCorners) const;
33 bool isBankFlat(const ComponentInfo &componentInfo, size_t bankIndex, const std::vector<size_t> &tubes,
34 const V3D &normal);
35 V3D calculateBankNormal(const ComponentInfo &componentInfo, const std::vector<size_t> &tubes);
36 void setBankVisited(const ComponentInfo &componentInfo, size_t bankIndex, std::vector<bool> &visitedComponents) const;
37 size_t findNumDetectors(const ComponentInfo &componentInfo, const std::vector<size_t> &components) const;
38 Mantid::Kernel::Quat calcBankRotation(const V3D &detPos, V3D normal, const V3D &zAxis, const V3D &yAxis,
39 const V3D &samplePosition) const;
40 std::vector<Mantid::Kernel::V2D> transformedBoundingBoxPoints(const ComponentInfo &componentInfo,
41 size_t detectorIndex, const V3D &refPos,
42 const Mantid::Kernel::Quat &rotation, const V3D &xaxis,
43 const V3D &yaxis) const;
44 std::vector<size_t> tubeDetectorParentIDs(const ComponentInfo &componentInfo, size_t rootIndex,
45 std::vector<bool> &visited);
46 std::vector<std::vector<size_t>> examineAllComponents(
47 const ComponentInfo &componentInfo,
48 std::function<std::vector<size_t>(const ComponentInfo &, size_t, std::vector<bool> &)> operation);
49 std::optional<Kernel::V2D> getSideBySideViewPos(const ComponentInfo &componentInfo,
50 const Instrument_const_sptr &instrument,
51 const size_t componentIndex) const;
52
53private:
54 Mantid::Kernel::Logger g_log = Mantid::Kernel::Logger("PanelsSurfaceCalculator");
55};
56} // namespace API
57} // namespace Mantid
IntArray detectorIndex
Mantid::Kernel::Quat(ComponentInfo::* rotation)(const size_t) const
ComponentInfo : Provides a component centric view on to the instrument.
Base Instrument Class.
Definition Instrument.h:47
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition Logger.h:51
Class for quaternions.
Definition Quat.h:39
Class for 3D vectors.
Definition V3D.h:34
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
Helper class which provides the Collimation Length for SANS instruments.