|
Mantid
|
#include <PanelsSurfaceCalculator.h>
Public Member Functions | |
| Mantid::Kernel::Quat | calcBankRotation (const V3D &detPos, V3D normal, const V3D &zAxis, const V3D &yAxis, const V3D &samplePosition) const |
| Calculate the rotation needed around the bank's local x and y axes to place a bank on the projection plane Perform the rotation in two stages to avoid any twist about the normal. | |
| V3D | calculateBankNormal (const ComponentInfo &componentInfo, const std::vector< size_t > &tubes) |
| Calculate the normal vector of a bank of detectors. | |
| V3D | calculatePanelNormal (const std::vector< V3D > &panelCorners) const |
| Calculate the normal vector to a panel. | |
| std::vector< std::vector< size_t > > | examineAllComponents (const ComponentInfo &componentInfo, std::function< std::vector< size_t >(const ComponentInfo &, size_t, std::vector< bool > &)> operation) |
| Perform a specified operation on all the components. | |
| size_t | findNumDetectors (const ComponentInfo &componentInfo, const std::vector< size_t > &components) const |
| How many detectors are there in the given list of component indices? | |
| std::optional< Kernel::V2D > | getSideBySideViewPos (const ComponentInfo &componentInfo, const Instrument_const_sptr &instrument, const size_t componentIndex) const |
| Gives the specified side-by-side view position from the IDF. | |
| bool | isBankFlat (const ComponentInfo &componentInfo, size_t bankIndex, const std::vector< size_t > &tubes, const V3D &normal) |
| Do all the detectors lie in a plane? | |
| std::vector< V3D > | retrievePanelCorners (const ComponentInfo &componentInfo, const size_t rootIndex) const |
| Returns the four corners of the specified panel. | |
| void | setBankVisited (const ComponentInfo &componentInfo, size_t bankIndex, std::vector< bool > &visitedComponents) const |
| Recursively set all detectors and subcomponents of a bank as visited. | |
| void | setupBasisAxes (const V3D &zaxis, V3D &xaxis, V3D &yaxis) const |
| Given the z axis, define the x and y ones. | |
| std::vector< Mantid::Kernel::V2D > | transformedBoundingBoxPoints (const ComponentInfo &componentInfo, size_t detectorIndex, const V3D &refPos, const Mantid::Kernel::Quat &rotation, const V3D &xaxis, const V3D &yaxis) const |
| Transforms bounding box of a detector. | |
| std::vector< size_t > | tubeDetectorParentIDs (const ComponentInfo &componentInfo, size_t rootIndex, std::vector< bool > &visited) |
| Parent indices of tubes. | |
Private Attributes | |
| Mantid::Kernel::Logger | g_log = Mantid::Kernel::Logger("PanelsSurfaceCalculator") |
Definition at line 28 of file PanelsSurfaceCalculator.h.
| Mantid::Kernel::Quat Mantid::API::PanelsSurfaceCalculator::calcBankRotation | ( | const V3D & | detPos, |
| V3D | normal, | ||
| const V3D & | zAxis, | ||
| const V3D & | yAxis, | ||
| const V3D & | samplePosition | ||
| ) | const |
Calculate the rotation needed around the bank's local x and y axes to place a bank on the projection plane Perform the rotation in two stages to avoid any twist about the normal.
| detPos | :: Position of a detector of the bank. |
| normal | :: Normal to the bank's plane. |
| zAxis | :: Direction to the viewer |
| yAxis | :: Perpendicular axis |
| samplePosition | :: Sample position |
Definition at line 226 of file PanelsSurfaceCalculator.cpp.
References Mantid::Kernel::V3D::cross_prod(), Mantid::Kernel::V3D::normalize(), Mantid::Kernel::V3D::nullVector(), Mantid::Kernel::V3D::scalar_prod(), Mantid::Kernel::V3D::X(), Mantid::Kernel::V3D::Y(), and Mantid::Kernel::V3D::Z().
| Mantid::Kernel::V3D Mantid::API::PanelsSurfaceCalculator::calculateBankNormal | ( | const ComponentInfo & | componentInfo, |
| const std::vector< size_t > & | tubes | ||
| ) |
Calculate the normal vector of a bank of detectors.
| componentInfo | :: ComponentInfo object from the workspace |
| tubes | :: Component indices of the tubes in the bank |
Definition at line 154 of file PanelsSurfaceCalculator.cpp.
References Mantid::Geometry::ComponentInfo::children(), g_log, Mantid::Kernel::V3D::normalize(), Mantid::Geometry::ComponentInfo::position(), Mantid::Kernel::Logger::warning(), Mantid::Geometry::x, and Mantid::Geometry::y.
Referenced by tubeDetectorParentIDs().
| Mantid::Kernel::V3D Mantid::API::PanelsSurfaceCalculator::calculatePanelNormal | ( | const std::vector< V3D > & | panelCorners | ) | const |
Calculate the normal vector to a panel.
| panelCorners | :: The four panel corner locations |
Definition at line 117 of file PanelsSurfaceCalculator.cpp.
References Mantid::Kernel::normalize().
| std::vector< std::vector< size_t > > Mantid::API::PanelsSurfaceCalculator::examineAllComponents | ( | const ComponentInfo & | componentInfo, |
| std::function< std::vector< size_t >(const ComponentInfo &, size_t, std::vector< bool > &)> | operation | ||
| ) |
Perform a specified operation on all the components.
| componentInfo | :: ComponentInfo object from the workspace |
| operation | :: Operation to perform on each component |
Definition at line 299 of file PanelsSurfaceCalculator.cpp.
References Mantid::Geometry::ComponentInfo::children(), Mantid::Geometry::ComponentInfo::parent(), Mantid::Geometry::ComponentInfo::root(), and Mantid::Geometry::ComponentInfo::size().
| size_t Mantid::API::PanelsSurfaceCalculator::findNumDetectors | ( | const ComponentInfo & | componentInfo, |
| const std::vector< size_t > & | components | ||
| ) | const |
How many detectors are there in the given list of component indices?
| componentInfo | :: ComponentInfo object from the workspace |
| components | :: Component indices to check |
Definition at line 208 of file PanelsSurfaceCalculator.cpp.
| std::optional< Kernel::V2D > Mantid::API::PanelsSurfaceCalculator::getSideBySideViewPos | ( | const ComponentInfo & | componentInfo, |
| const Instrument_const_sptr & | instrument, | ||
| const size_t | componentIndex | ||
| ) | const |
Gives the specified side-by-side view position from the IDF.
| componentInfo | :: ComponentInfo object from the workspace |
| instrument | :: Instrument object from the workspace |
| componentIndex | :: Component index to check |
Definition at line 393 of file PanelsSurfaceCalculator.cpp.
References Mantid::Geometry::ComponentInfo::componentID().
| bool Mantid::API::PanelsSurfaceCalculator::isBankFlat | ( | const ComponentInfo & | componentInfo, |
| size_t | bankIndex, | ||
| const std::vector< size_t > & | tubes, | ||
| const V3D & | normal | ||
| ) |
Do all the detectors lie in a plane?
| componentInfo | :: ComponentInfo object from the workspace |
| bankIndex | :: Component index of bank |
| tubes | :: Tube component indices |
| normal | :: Panel normal vector |
Definition at line 134 of file PanelsSurfaceCalculator.cpp.
References Mantid::Geometry::ComponentInfo::children(), g_log, Mantid::Geometry::ComponentInfo::name(), Mantid::Kernel::normalize(), Mantid::Geometry::ComponentInfo::position(), Mantid::Kernel::Tolerance, and Mantid::Kernel::Logger::warning().
| std::vector< Mantid::Kernel::V3D > Mantid::API::PanelsSurfaceCalculator::retrievePanelCorners | ( | const ComponentInfo & | componentInfo, |
| const size_t | rootIndex | ||
| ) | const |
Returns the four corners of the specified panel.
| componentInfo | :: ComponentInfo object from the workspace |
| rootIndex | :: Index of panel |
Definition at line 55 of file PanelsSurfaceCalculator.cpp.
References Mantid::Geometry::ComponentInfo::children(), Mantid::Geometry::IObject::getGeometryHandler(), Mantid::Geometry::ComponentInfo::isDetector(), Mantid::Geometry::ComponentInfo::position(), Mantid::Geometry::ComponentInfo::quadrilateralComponent(), Mantid::Geometry::ComponentInfo::shape(), Mantid::Geometry::X, Mantid::Geometry::x, Mantid::Kernel::V3D::X(), Mantid::Geometry::Y, and Mantid::Geometry::y.
| void Mantid::API::PanelsSurfaceCalculator::setBankVisited | ( | const ComponentInfo & | componentInfo, |
| size_t | bankIndex, | ||
| std::vector< bool > & | visitedComponents | ||
| ) | const |
Recursively set all detectors and subcomponents of a bank as visited.
| componentInfo | :: ComponentInfo object from the workspace |
| bankIndex | :: Component index of the bank |
| visitedComponents | :: Vector keeping track of which components have been visited |
Definition at line 188 of file PanelsSurfaceCalculator.cpp.
References Mantid::Geometry::ComponentInfo::children(), and setBankVisited().
Referenced by setBankVisited(), and tubeDetectorParentIDs().
| void Mantid::API::PanelsSurfaceCalculator::setupBasisAxes | ( | const V3D & | zaxis, |
| V3D & | xaxis, | ||
| V3D & | yaxis | ||
| ) | const |
Given the z axis, define the x and y ones.
| zaxis | :: A given vector in 3d space to become the z axis of a coordinate system. |
| xaxis | :: An output arbitrary vector perpendicular to zaxis. |
| yaxis | :: An output arbitrary vector perpendicular to both zaxis and xaxis. |
Definition at line 31 of file PanelsSurfaceCalculator.cpp.
References Mantid::Kernel::V3D::cross_prod(), Mantid::Kernel::V3D::getSpherical(), and Mantid::Kernel::V3D::normalize().
| std::vector< Mantid::Kernel::V2D > Mantid::API::PanelsSurfaceCalculator::transformedBoundingBoxPoints | ( | const ComponentInfo & | componentInfo, |
| size_t | detectorIndex, | ||
| const V3D & | refPos, | ||
| const Mantid::Kernel::Quat & | rotation, | ||
| const V3D & | xaxis, | ||
| const V3D & | yaxis | ||
| ) | const |
Transforms bounding box of a detector.
| componentInfo | :: ComponentInfo object from the workspace |
| detectorIndex | :: Component index of the detector |
| refPos | :: Reference position |
| rotation | :: Rotation to apply |
| xaxis | :: X axis |
| yaxis | :: Y axis |
Definition at line 277 of file PanelsSurfaceCalculator.cpp.
References Mantid::Geometry::ComponentInfo::boundingBox(), detectorIndex, Mantid::Geometry::BoundingBox::minPoint(), Mantid::Kernel::Quat::rotate(), rotation, and Mantid::Kernel::V3D::scalar_prod().
| std::vector< size_t > Mantid::API::PanelsSurfaceCalculator::tubeDetectorParentIDs | ( | const ComponentInfo & | componentInfo, |
| size_t | rootIndex, | ||
| std::vector< bool > & | visited | ||
| ) |
Parent indices of tubes.
| componentInfo | :: ComponentInfo object from the workspace |
| rootIndex | :: Component index to check |
| visited | :: Vector tracking which components have been checked |
Definition at line 326 of file PanelsSurfaceCalculator.cpp.
References calculateBankNormal(), Mantid::Geometry::ComponentInfo::children(), Mantid::Geometry::ComponentInfo::componentType(), Mantid::Geometry::ComponentInfo::hasParent(), index, Mantid::Kernel::V3D::nullVector(), Mantid::Geometry::ComponentInfo::parent(), setBankVisited(), and Mantid::Kernel::V3D::size().
|
private |
Definition at line 54 of file PanelsSurfaceCalculator.h.
Referenced by calculateBankNormal(), and isBankFlat().