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"
11#include "MantidKernel/Logger.h"
12#include "MantidKernel/Quat.h"
13#include "MantidKernel/V2D.h"
14#include "MantidKernel/V3D.h"
15
16#include <functional>
17#include <optional>
18#include <vector>
19
22
23namespace Mantid {
24namespace API {
25class MANTID_API_DLL PanelsSurfaceCalculator {
26public:
27 void setupBasisAxes(const V3D &zaxis, V3D &xaxis, V3D &yaxis) const;
28 std::vector<V3D> retrievePanelCorners(const ComponentInfo &componentInfo, const size_t rootIndex) const;
29 V3D calculatePanelNormal(const std::vector<V3D> &panelCorners) const;
30 bool isBankFlat(const ComponentInfo &componentInfo, size_t bankIndex, const std::vector<size_t> &tubes,
31 const V3D &normal);
32 V3D calculateBankNormal(const ComponentInfo &componentInfo, const std::vector<size_t> &tubes);
33 void setBankVisited(const ComponentInfo &componentInfo, size_t bankIndex, std::vector<bool> &visitedComponents) const;
34 size_t findNumDetectors(const ComponentInfo &componentInfo, const std::vector<size_t> &components) const;
35 Mantid::Kernel::Quat calcBankRotation(const V3D &detPos, V3D normal, const V3D &zAxis, const V3D &yAxis,
36 const V3D &samplePosition) const;
37 std::vector<Mantid::Kernel::V2D> transformedBoundingBoxPoints(const ComponentInfo &componentInfo,
38 size_t detectorIndex, const V3D &refPos,
39 const Mantid::Kernel::Quat &rotation, const V3D &xaxis,
40 const V3D &yaxis) const;
41 std::vector<size_t> tubeDetectorParentIDs(const ComponentInfo &componentInfo, size_t rootIndex,
42 std::vector<bool> &visited);
43 std::vector<std::vector<size_t>> examineAllComponents(
44 const ComponentInfo &componentInfo,
45 std::function<std::vector<size_t>(const ComponentInfo &, size_t, std::vector<bool> &)> operation);
46 std::optional<Kernel::V2D> getSideBySideViewPos(const ComponentInfo &componentInfo,
47 const size_t componentIndex) const;
48
49private:
50 Mantid::Kernel::Logger g_log = Mantid::Kernel::Logger("PanelsSurfaceCalculator");
51};
52} // namespace API
53} // namespace Mantid
IntArray detectorIndex
Mantid::Kernel::Quat(ComponentInfo::* rotation)(const size_t) const
ComponentInfo : Provides a component centric view on to the instrument.
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
Helper class which provides the Collimation Length for SANS instruments.