Mantid
Loading...
Searching...
No Matches
ComponentInfo.cpp
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 +
8#include "MantidBeamline/ComponentInfo.h"
9#include "MantidBeamline/ComponentType.h"
15
16#include <Eigen/Geometry>
17#include <exception>
18#include <iterator>
19#include <string>
20
21namespace Mantid::Geometry {
22
23namespace {
27const Eigen::Vector3d undoRotation(const Eigen::Vector3d &point, const Beamline::ComponentInfo &compInfo,
28 const size_t componentIndex) {
29 auto unRotateTransform = Eigen::Affine3d(compInfo.rotation(componentIndex).inverse());
30 return unRotateTransform * point;
31}
39const Kernel::V3D toShapeFrame(const Kernel::V3D &point, const Beamline::ComponentInfo &compInfo,
40 const size_t componentIndex) {
41 return Kernel::toV3D(
42 undoRotation(Kernel::toVector3d(point) - compInfo.position(componentIndex), compInfo, componentIndex));
43}
44
45} // namespace
46
55 std::unique_ptr<Beamline::ComponentInfo> componentInfo,
56 std::shared_ptr<const std::vector<Mantid::Geometry::IComponent *>> componentIds,
57 std::shared_ptr<const std::unordered_map<Geometry::IComponent const *, size_t>> componentIdToIndexMap,
58 std::shared_ptr<std::vector<std::shared_ptr<const Geometry::IObject>>> shapes)
59 : m_componentInfo(std::move(componentInfo)), m_componentIds(std::move(componentIds)),
60 m_compIDToIndex(std::move(componentIdToIndexMap)), m_shapes(std::move(shapes)) {
61
62 if (m_componentIds->size() != m_compIDToIndex->size()) {
63 throw std::invalid_argument("Inconsistent ID and Mapping input containers "
64 "for Geometry::ComponentInfo");
65 }
66 if (m_componentIds->size() != m_componentInfo->size()) {
67 throw std::invalid_argument("Inconsistent ID and base "
68 "Beamline::ComponentInfo sizes for "
69 "Geometry::ComponentInfo");
70 }
71}
72
77std::unique_ptr<Geometry::ComponentInfo> ComponentInfo::cloneWithoutDetectorInfo() const {
78
79 return std::unique_ptr<Geometry::ComponentInfo>(new Geometry::ComponentInfo(*this));
80}
81
87 : m_componentInfo(other.m_componentInfo->cloneWithoutDetectorInfo()), m_componentIds(other.m_componentIds),
88 m_compIDToIndex(other.m_compIDToIndex), m_shapes(other.m_shapes) {}
89
90// Defined as default in source for forward declaration with std::unique_ptr.
92
93std::vector<size_t> ComponentInfo::detectorsInSubtree(size_t componentIndex) const {
94 return m_componentInfo->detectorsInSubtree(componentIndex);
95}
96
97std::vector<size_t> ComponentInfo::componentsInSubtree(size_t componentIndex) const {
98 return m_componentInfo->componentsInSubtree(componentIndex);
99}
100
101const std::vector<size_t> &ComponentInfo::children(size_t componentIndex) const {
102 return m_componentInfo->children(componentIndex);
103}
104
105size_t ComponentInfo::size() const { return m_componentInfo->size(); }
106
108 auto type = componentType(componentIndex);
109 auto parentType = componentType(parent(componentIndex));
110 if (!(type == Beamline::ComponentType::Structured || type == Beamline::ComponentType::Rectangular ||
111 parentType == Beamline::ComponentType::Grid))
112 throw std::runtime_error("ComponentType is not Structured or Rectangular "
113 "in ComponentInfo::quadrilateralComponent.");
114
116 const auto &innerRangeComp = m_componentInfo->children(componentIndex);
117 corners.nX = innerRangeComp.size();
118 const auto &firstCol = m_componentInfo->children(innerRangeComp[0]);
119 const auto &lastCol = m_componentInfo->children(innerRangeComp[corners.nX - 1]);
120 corners.nY = firstCol.size();
121 corners.bottomLeft = firstCol.front();
122 corners.topRight = lastCol.back();
123 corners.topLeft = firstCol.back();
124 corners.bottomRight = lastCol.front();
125
126 return corners;
127}
128
129size_t ComponentInfo::indexOf(Geometry::IComponent const *id) const { return m_compIDToIndex->at(id); }
130
131size_t ComponentInfo::indexOfAny(const std::string &name) const { return m_componentInfo->indexOfAny(name); }
132
133bool ComponentInfo::uniqueName(const std::string &name) const { return m_componentInfo->uniqueName(name); }
134
135bool ComponentInfo::isDetector(const size_t componentIndex) const {
136 return m_componentInfo->isDetector(componentIndex);
137}
138
139bool ComponentInfo::hasValidShape(const size_t componentIndex) const {
140 const auto *shapeAtIndex = (*m_shapes)[componentIndex].get();
141 return shapeAtIndex != nullptr && shapeAtIndex->hasValidShape();
142}
143
144Kernel::V3D ComponentInfo::position(const size_t componentIndex) const {
145 return Kernel::toV3D(m_componentInfo->position(componentIndex));
146}
147
148Kernel::V3D ComponentInfo::position(const std::pair<size_t, size_t> &index) const {
149 return Kernel::toV3D(m_componentInfo->position(index));
150}
151
152Kernel::Quat ComponentInfo::rotation(const size_t componentIndex) const {
153 return Kernel::toQuat(m_componentInfo->rotation(componentIndex));
154}
155
156Kernel::Quat ComponentInfo::rotation(const std::pair<size_t, size_t> &index) const {
157 return Kernel::toQuat(m_componentInfo->rotation(index));
158}
159
160Kernel::V3D ComponentInfo::relativePosition(const size_t componentIndex) const {
161 return Kernel::toV3D(m_componentInfo->relativePosition(componentIndex));
162}
163
164Kernel::Quat ComponentInfo::relativeRotation(const size_t componentIndex) const {
165 return Kernel::toQuat(m_componentInfo->relativeRotation(componentIndex));
166}
167
168void ComponentInfo::setPosition(const std::pair<size_t, size_t> &index, const Kernel::V3D &newPosition) {
169 m_componentInfo->setPosition(index, Kernel::toVector3d(newPosition));
170}
171
172void ComponentInfo::setRotation(const std::pair<size_t, size_t> &index, const Kernel::Quat &newRotation) {
173 m_componentInfo->setRotation(index, Kernel::toQuaterniond(newRotation));
174}
175
176void ComponentInfo::scaleComponent(const size_t componentIndex, const Kernel::V3D &newScaling) {
177 m_componentInfo->scaleComponent(componentIndex, Kernel::toVector3d(newScaling));
178}
179
180void ComponentInfo::scaleComponent(const std::pair<size_t, size_t> &index, const Kernel::V3D &newScaling) {
181 m_componentInfo->scaleComponent(index, Kernel::toVector3d(newScaling));
182}
183
184size_t ComponentInfo::parent(const size_t componentIndex) const { return m_componentInfo->parent(componentIndex); }
185
186bool ComponentInfo::hasParent(const size_t componentIndex) const { return m_componentInfo->hasParent(componentIndex); }
187
188bool ComponentInfo::hasDetectorInfo() const { return m_componentInfo->hasDetectorInfo(); }
189
191
193
194bool ComponentInfo::hasSource() const { return m_componentInfo->hasSource(); }
195
196/*
197 * @brief Check the sources of two componentInfo objects coincide
198 *
199 * @details check both objects either lack or have a source. If the latter,
200 * check their positions differ by less than 1 nm = 1e-9 m.
201 *
202 * @returns true if sources are equivalent
203 */
205 return m_componentInfo->hasEquivalentSource(*(other.m_componentInfo));
206}
207
208bool ComponentInfo::hasSample() const { return m_componentInfo->hasSample(); }
209
210/*
211 * @brief Check the samples of two componentInfo objects coincide
212 *
213 * @details check both objects either lack or have a sample. If the latter,
214 * check their positions differ by less than 1 nm = 1e-9 m.
215 *
216 * @returns true if sources are equivalent
217 */
219 return m_componentInfo->hasEquivalentSample(*(other.m_componentInfo));
220}
221
222bool ComponentInfo::hasDetectors(const size_t componentIndex) const {
223 if (isDetector(componentIndex))
224 return false;
225 const auto range = m_componentInfo->detectorRangeInSubtree(componentIndex);
226 return range.begin() < range.end();
227}
228
229size_t ComponentInfo::source() const { return m_componentInfo->source(); }
230
231size_t ComponentInfo::sample() const { return m_componentInfo->sample(); }
232
233double ComponentInfo::l1() const { return m_componentInfo->l1(); }
234
235size_t ComponentInfo::root() const { return m_componentInfo->root(); }
236
237void ComponentInfo::setPosition(const size_t componentIndex, const Kernel::V3D &newPosition) {
238 m_componentInfo->setPosition(componentIndex, Kernel::toVector3d(newPosition));
239}
240
241void ComponentInfo::setRotation(const size_t componentIndex, const Kernel::Quat &newRotation) {
242 m_componentInfo->setRotation(componentIndex, Kernel::toQuaterniond(newRotation));
243}
244
245const IObject &ComponentInfo::shape(const size_t componentIndex) const { return *(*m_shapes)[componentIndex]; }
246
253std::unordered_map<std::shared_ptr<const IObject>, std::vector<size_t>> ComponentInfo::shapeToComponentIndices() const {
254 std::unordered_map<std::shared_ptr<const IObject>, std::vector<size_t>> result;
255 const auto &shapes = *m_shapes;
256 for (size_t i = 0; i < shapes.size(); ++i) {
257 const auto &currentShape = shapes[i];
258 if (currentShape != nullptr && currentShape->hasValidShape())
259 result[currentShape].emplace_back(i);
260 }
261 return result;
262}
263
264Kernel::V3D ComponentInfo::scaleFactor(const size_t componentIndex) const {
265 return Kernel::toV3D(m_componentInfo->scaleFactor(componentIndex));
266}
267
268const std::string &ComponentInfo::name(const size_t componentIndex) const {
269 return m_componentInfo->name(componentIndex);
270}
271
272void ComponentInfo::setScaleFactor(const size_t componentIndex, const Kernel::V3D &scaleFactor) {
273 m_componentInfo->setScaleFactor(componentIndex, Kernel::toVector3d(scaleFactor));
274}
275
276double ComponentInfo::solidAngle(const size_t componentIndex, const Geometry::SolidAngleParams &params) const {
277 if (!hasValidShape(componentIndex))
278 throw Kernel::Exception::NullPointerException("ComponentInfo::solidAngle", "shape");
279 // This is the observer position in the shape's coordinate system.
280 const Kernel::V3D relativeObserver = toShapeFrame(params.observer(), *m_componentInfo, componentIndex);
281 const Kernel::V3D scaleFactorAtIndex = this->scaleFactor(componentIndex);
282 const auto paramsWithRelativeObserver = params.copyWithNewObserver(relativeObserver);
283 if ((scaleFactorAtIndex - Kernel::V3D(1.0, 1.0, 1.0)).norm() < 1e-12)
284 return shape(componentIndex).solidAngle(paramsWithRelativeObserver);
285 else {
286 // This function will scale the object shape when calculating the solid
287 // angle.
288 return shape(componentIndex).solidAngle(paramsWithRelativeObserver, scaleFactorAtIndex);
289 }
290}
291
310 Geometry::BoundingBox &mutableBB,
311 const bool excludeMonitors) const {
312
313 auto panel = quadrilateralComponent(index);
314 mutableBB.grow(componentBoundingBox(panel.bottomLeft, reference, excludeMonitors));
315 mutableBB.grow(componentBoundingBox(panel.topRight, reference, excludeMonitors));
316 mutableBB.grow(componentBoundingBox(panel.topLeft, reference, excludeMonitors));
317 mutableBB.grow(componentBoundingBox(panel.bottomRight, reference, excludeMonitors));
318}
319
331 const bool excludeMonitors) const {
332 mutableBB.grow(componentBoundingBox(index, reference, excludeMonitors));
333}
334
345 const bool excludeMonitors) const {
346 // Check that we have a valid shape here
347 if (componentType(index) == Beamline::ComponentType::Infinite) {
348 return BoundingBox(); // Return null bounding box
349 }
350 if (excludeMonitors) {
351 // skip monitors
352 if (isDetector(index) && m_componentInfo->isMonitor(index)) {
353 return BoundingBox();
354 }
355 // skip other components such as choppers, etc
356 if (componentType(index) == Beamline::ComponentType::Generic) {
357 return BoundingBox();
358 }
359 }
360 if (!hasValidShape(index)) {
361 return BoundingBox(this->position(index).X(), this->position(index).Y(), this->position(index).Z(),
362 this->position(index).X(), this->position(index).Y(), this->position(index).Z());
363 } else {
364 const auto &s = this->shape(index);
365 BoundingBox absoluteBB = s.getBoundingBox();
366
367 // modify in place for speed
368 const Eigen::Vector3d scaleFactorAtIndex = m_componentInfo->scaleFactor(index);
369 // Scale
370 absoluteBB.xMin() *= scaleFactorAtIndex[0];
371 absoluteBB.xMax() *= scaleFactorAtIndex[0];
372 absoluteBB.yMin() *= scaleFactorAtIndex[1];
373 absoluteBB.yMax() *= scaleFactorAtIndex[1];
374 absoluteBB.zMin() *= scaleFactorAtIndex[2];
375 absoluteBB.zMax() *= scaleFactorAtIndex[2];
376 // Rotate
377 (this->rotation(index))
378 .rotateBB(absoluteBB.xMin(), absoluteBB.yMin(), absoluteBB.zMin(), absoluteBB.xMax(), absoluteBB.yMax(),
379 absoluteBB.zMax());
380
381 // Shift
382 const Eigen::Vector3d localPos = m_componentInfo->position(index);
383 absoluteBB.xMin() += localPos[0];
384 absoluteBB.xMax() += localPos[0];
385 absoluteBB.yMin() += localPos[1];
386 absoluteBB.yMax() += localPos[1];
387 absoluteBB.zMin() += localPos[2];
388 absoluteBB.zMax() += localPos[2];
389
390 if (reference && !reference->isAxisAligned()) { // copy coordinate system
391
392 std::vector<Kernel::V3D> coordSystem;
393 coordSystem.assign(reference->getCoordSystem().begin(), reference->getCoordSystem().end());
394
395 // realign to reference coordinate system
396 absoluteBB.realign(&coordSystem);
397 }
398 return absoluteBB;
399 }
400}
401
413BoundingBox ComponentInfo::boundingBox(const size_t componentIndex, const BoundingBox *reference,
414 const bool excludeMonitors) const {
415 if (isDetector(componentIndex) || componentType(componentIndex) == Beamline::ComponentType::Infinite) {
416 return componentBoundingBox(componentIndex, reference, excludeMonitors);
417 }
418
419 BoundingBox absoluteBB;
420 const auto compFlag = componentType(componentIndex);
421
422 auto parentFlag = Beamline::ComponentType::Generic;
423 if (size() > 1)
424 parentFlag = componentType(parent(componentIndex));
425
426 if (hasSource() && componentIndex == source()) {
427 // Do nothing. Source is not considered part of the beamline for bounding
428 // box calculations.
429 } else if (compFlag == Beamline::ComponentType::Unstructured) {
430 for (const auto &childIndex : this->children(componentIndex)) {
431 absoluteBB.grow(boundingBox(childIndex, reference, excludeMonitors));
432 }
433 } else if (compFlag == Beamline::ComponentType::Grid) {
434 for (const auto &childIndex : this->children(componentIndex)) {
435 growBoundingBoxAsRectuangularBank(childIndex, reference, absoluteBB, excludeMonitors);
436 }
437 } else if (compFlag == Beamline::ComponentType::Rectangular || compFlag == Beamline::ComponentType::Structured ||
438 parentFlag == Beamline::ComponentType::Grid) {
439 growBoundingBoxAsRectuangularBank(componentIndex, reference, absoluteBB, excludeMonitors);
440 } else if (compFlag == Beamline::ComponentType::OutlineComposite) {
441 growBoundingBoxAsOutline(componentIndex, reference, absoluteBB, excludeMonitors);
442 } else {
443 // General case
444 absoluteBB.grow(componentBoundingBox(componentIndex, reference, excludeMonitors));
445 }
446 return absoluteBB;
447}
448
449Beamline::ComponentType ComponentInfo::componentType(const size_t componentIndex) const {
450 return m_componentInfo->componentType(componentIndex);
451}
452
453void ComponentInfo::setScanInterval(const std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime> &interval) {
454 m_componentInfo->setScanInterval({interval.first.totalNanoseconds(), interval.second.totalNanoseconds()});
455}
456
457size_t ComponentInfo::scanCount() const { return m_componentInfo->scanCount(); }
458
459void ComponentInfo::merge(const ComponentInfo &other) { m_componentInfo->merge(*other.m_componentInfo); }
460
462
464
466
468
469size_t ComponentInfo::findBankParent(size_t index, const std::string &bankPart) const {
470 constexpr size_t invalidIndex{0}; // index 0 will always be a dectector and never a bank
471 // if this component is a bank, return the parent
472 if (name(index).starts_with(bankPart)) {
473 return parent(index);
474 }
475 // check if the children components begin with bankPart
476 auto indexChildren = children(index);
477 if (indexChildren.empty()) {
478 return invalidIndex;
479 }
480 // if they do, we found the bank parent
481 if (name(indexChildren[0]).starts_with(bankPart)) {
482 return index;
483 }
484 // if not, check the grandchildren
485 for (size_t const child : indexChildren) {
486 size_t j = findBankParent(child, bankPart);
487 if (j != invalidIndex) {
488 return j;
489 }
490 }
491 return invalidIndex;
492}
493
498 const size_t n = size();
499 // Beamline::ComponentInfo holds all the per-component arrays
500 const size_t beamlineMem = m_componentInfo->getMemorySize();
501 // m_componentIds: shared_ptr<const vector<IComponent*>> — count the heap-allocated vector object + its buffer
502 const size_t componentIdsMem = sizeof(std::vector<Geometry::IComponent *>) + n * sizeof(Geometry::IComponent *);
503 // m_compIDToIndex: shared_ptr<const unordered_map<IComponent const*, size_t>>
504 // Count the heap-allocated map object + each node (key + value + ~2 pointers for bucket/chain overhead)
505 const size_t compIDToIndexMem = sizeof(std::unordered_map<Geometry::IComponent const *, size_t>) +
506 n * (sizeof(Geometry::IComponent const *) + sizeof(size_t) + 2 * sizeof(void *));
507 // m_shapes: shared_ptr<vector<shared_ptr<const IObject>>>
508 // IObject shapes are shared; count the vector object + buffer of shared_ptrs, not the shapes themselves
509 const size_t shapesMem =
510 m_shapes ? sizeof(*m_shapes) + m_shapes->capacity() * sizeof(std::shared_ptr<const Geometry::IObject>) : 0;
511 return sizeof(*this) + beamlineMem + componentIdsMem + compIDToIndexMem + shapesMem;
512}
513
514} // namespace Mantid::Geometry
std::string name
Definition Run.cpp:60
double position
Definition GetAllEi.cpp:154
std::map< DeltaEMode::Type, std::string > index
Mantid::Kernel::Quat(ComponentInfo::* rotation)(const size_t) const
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
Definition BoundingBox.h:33
double xMax() const
Return the maximum value of X.
Definition BoundingBox.h:79
double zMin() const
Return the minimum value of Z.
Definition BoundingBox.h:85
std::vector< Kernel::V3D > const & getCoordSystem() const
returns the coordinate system to which BB is alighned to;
double zMax() const
Return the maximum value of Z.
Definition BoundingBox.h:87
double yMax() const
Return the maximum value of Y.
Definition BoundingBox.h:83
bool isAxisAligned() const
Check if it is normal axis aligned bounding box or not.
double xMin() const
Return the minimum value of X.
Definition BoundingBox.h:77
double yMin() const
Return the minimum value of Y.
Definition BoundingBox.h:81
void grow(const BoundingBox &other)
Grow the bounding box so that it also encompasses the given box.
void realign(std::vector< Kernel::V3D > const *const pCS=nullptr)
reallign the BB according to new coordinate system, provided earlier or specified as parameter;
ComponentInfo : Provides a component centric view on to the instrument.
bool hasParent(const size_t componentIndex) const
const ComponentInfoIterator< const ComponentInfo > cend()
BoundingBox componentBoundingBox(const size_t index, const BoundingBox *reference, const bool excludeMonitors=false) const
Calculates the absolute bounding box for the leaf item at index.
size_t findBankParent(size_t index, const std::string &bankPart) const
std::unordered_map< std::shared_ptr< const Geometry::IObject >, std::vector< size_t > > shapeToComponentIndices() const
Build a map from each unique shape to the list of component indices that share it.
size_t indexOfAny(const std::string &name) const
void setRotation(size_t componentIndex, const Kernel::Quat &newRotation)
bool hasDetectors(const size_t componentIndex) const
bool hasEquivalentSource(const ComponentInfo &other) const
double solidAngle(const size_t componentIndex, const Geometry::SolidAngleParams &params) const
size_t parent(const size_t componentIndex) const
Kernel::Quat rotation(const size_t componentIndex) const
void growBoundingBoxAsOutline(size_t index, const Geometry::BoundingBox *reference, Geometry::BoundingBox &mutableBB, const bool excludeMonitors=false) const
Grow the bounding box on the basis that the component described by index has an outline,...
BoundingBox boundingBox(const size_t componentIndex, const BoundingBox *reference=nullptr, const bool excludeMonitors=false) const
Compute the bounding box for the component with componentIndex taking into account all sub components...
std::shared_ptr< std::vector< std::shared_ptr< const Geometry::IObject > > > m_shapes
Shapes for each component.
void scaleComponent(const size_t componentIndex, const Kernel::V3D &newScaling)
std::shared_ptr< const std::unordered_map< Geometry::IComponent const *, size_t > > m_compIDToIndex
Map of component ids to indexes.
Kernel::V3D position(const size_t componentIndex) const
const std::vector< size_t > & children(size_t componentIndex) const
std::vector< size_t > componentsInSubtree(size_t componentIndex) const
void merge(const ComponentInfo &other)
bool hasValidShape(const size_t componentIndex) const
ComponentInfoIterator< ComponentInfo > begin()
bool hasEquivalentSample(const ComponentInfo &other) const
void setScaleFactor(const size_t componentIndex, const Kernel::V3D &scaleFactor)
ComponentInfoIterator< ComponentInfo > end()
std::unique_ptr< Beamline::ComponentInfo > m_componentInfo
Pointer to the actual ComponentInfo object (non-wrapping part).
std::vector< size_t > detectorsInSubtree(size_t componentIndex) const
bool isDetector(const size_t componentIndex) const
bool uniqueName(const std::string &name) const
void growBoundingBoxAsRectuangularBank(size_t index, const Geometry::BoundingBox *reference, Geometry::BoundingBox &mutableBB, const bool excludeMonitors=false) const
Grow the bounding box on the basis that the component described by index is a regular grid in a trape...
std::unique_ptr< ComponentInfo > cloneWithoutDetectorInfo() const
Clone current instance but not the DetectorInfo non-owned parts.
const ComponentInfoIterator< const ComponentInfo > cbegin()
std::shared_ptr< const std::vector< Geometry::IComponent * > > m_componentIds
Collection of component ids.
Kernel::V3D relativePosition(const size_t componentIndex) const
size_t indexOf(Geometry::IComponent const *id) const
const std::string & name(const size_t componentIndex) const
size_t getMemorySize() const
Return memory used by the component info, in bytes.
Kernel::Quat relativeRotation(const size_t componentIndex) const
void setPosition(size_t componentIndex, const Kernel::V3D &newPosition)
const Geometry::IObject & shape(const size_t componentIndex) const
void setScanInterval(const std::pair< Types::Core::DateAndTime, Types::Core::DateAndTime > &interval)
QuadrilateralComponent quadrilateralComponent(const size_t componentIndex) const
Beamline::ComponentType componentType(const size_t componentIndex) const
Kernel::V3D scaleFactor(const size_t componentIndex) const
ComponentInfo(const ComponentInfo &other)
Private copy constructor. Do not make public.
base class for Geometric IComponent
Definition IComponent.h:53
IObject : Interface for geometry objects.
Definition IObject.h:42
virtual double solidAngle(const SolidAngleParams &params) const =0
const SolidAngleParams copyWithNewObserver(Kernel::V3D newObserver) const
const Kernel::V3D & observer() const
Exception thrown when an attempt is made to dereference a null pointer.
Definition Exception.h:305
Class for quaternions.
Definition Quat.h:39
Class for 3D vectors.
Definition V3D.h:34
ComponentInfoIterator< const ComponentInfo > ComponentInfoConstIt
ComponentInfoIterator< ComponentInfo > ComponentInfoIt
Kernel::Quat toQuat(const Eigen::Quaterniond &quat)
Converts Eigen::Quaterniond to Kernel::Quat.
Eigen::Vector3d toVector3d(const Kernel::V3D &vec)
Converts Kernel::V3D to Eigen::Vector3d.
Kernel::V3D toV3D(const Eigen::Vector3d &vec)
This header provides conversion helpers between vector and rotation types in MantidKernel and equival...
Eigen::Quaterniond toQuaterniond(const Kernel::Quat &quat)
Converts Kernel::Quat to Eigen::Quaterniond.
STL namespace.