8#include "MantidBeamline/ComponentType.h"
9#include "MantidBeamline/PixelGridComponent.h"
19#include "MantidPythonInterface/geometry/ComponentInfoPythonIterator.h"
21#include <boost/python/class.hpp>
22#include <boost/python/copy_const_reference.hpp>
23#include <boost/python/dict.hpp>
24#include <boost/python/enum.hpp>
25#include <boost/python/errors.hpp>
26#include <boost/python/extract.hpp>
27#include <boost/python/reference_existing_object.hpp>
28#include <boost/python/return_value_policy.hpp>
29#include <boost/python/scope.hpp>
31using Mantid::Beamline::ComponentType;
32using Mantid::Beamline::PixelGridComponent;
37using Mantid::PythonInterface::ComponentInfoPythonIterator;
44 return ComponentInfoPythonIterator(componentInfo);
57template <auto Field>
auto pixelGridField(
ComponentInfo const &self,
size_t const componentIndex) {
63std::string pixelGridIdFillOrder(
ComponentInfo const &self,
size_t const componentIndex) {
65 return std::string(order.begin(), order.end());
70double pixelGridXSize(
ComponentInfo const &self,
size_t const componentIndex) {
72 throw std::runtime_error(
"ComponentInfo::pixelgridXSize: component is not a Rectangular or Grid bank");
79 return grid.nX * grid.xStep *
scalex;
84double pixelGridYSize(
ComponentInfo const &self,
size_t const componentIndex) {
86 throw std::runtime_error(
"ComponentInfo::pixelgridYSize: component is not a Rectangular or Grid bank");
93 return grid.nY * grid.yStep *
scaley;
99const std::string *descriptionOrNull(
const std::string &description) {
100 return description.empty() ? nullptr : &description;
106size_t indexOrRoot(
const ComponentInfo &self,
const object &componentIndex) {
107 if (componentIndex.is_none()) {
110 const extract<size_t>
index(componentIndex);
111 if (!
index.check()) {
112 PyErr_SetString(PyExc_TypeError,
"'index' must be a component index, or None for the root component.");
113 throw_error_already_set();
118template <auto Method>
auto readParameter(
const ComponentInfo &self,
const object &componentIndex,
bool recursive) {
119 return (self.*Method)(indexOrRoot(self, componentIndex), recursive);
123template <auto Method>
124auto readNamedParameter(
const ComponentInfo &self,
const std::string &
name,
const object &componentIndex,
126 return (self.*Method)(indexOrRoot(self, componentIndex),
name, recursive);
129double getFittingParameter(
const ComponentInfo &self,
const std::string &
name,
double xvalue,
130 const object &componentIndex) {
134void addParameter(
ComponentInfo &self,
const std::string &type,
const std::string &
name,
const std::string &
value,
135 const object &componentIndex,
const std::string &description,
const std::string &visible) {
136 self.
addParameter(indexOrRoot(self, componentIndex), type,
name,
value, descriptionOrNull(description), visible);
140template <
auto Method,
typename T,
typename... Visible>
141void insertParameter(
ComponentInfo &self,
const std::string &
name,
const T &
value,
const object &componentIndex,
142 const std::string &description,
const Visible &...visible) {
143 (self.*Method)(indexOrRoot(self, componentIndex),
name,
value, descriptionOrNull(description), visible...);
146void addFittingParameter(
ComponentInfo &self,
const std::string &
name,
const std::string &fittingFunction,
147 const std::string &
value,
const object &componentIndex,
const std::string &description,
148 const std::string &visible) {
150 descriptionOrNull(description), visible);
153void clearParameter(
ComponentInfo &self,
const std::string &
name,
const object &componentIndex) {
157template <auto Method> std::string readDescription(
const ComponentInfo &self,
const object &componentIndex) {
158 return (self.*Method)(indexOrRoot(self, componentIndex));
161void setDescription(
ComponentInfo &self,
const std::string &description,
const object &componentIndex) {
162 self.
setDescription(indexOrRoot(self, componentIndex), description);
165dict shapeToComponentIndices(
const ComponentInfo &componentInfo) {
168 for (
const auto &shape : shapeMap) {
169 const auto csgObject = std::dynamic_pointer_cast<const Mantid::Geometry::CSGObject>(shape.first);
170 if (csgObject !=
nullptr) {
171 result[csgObject->getShapeXML()] = shape.second;
190 enum_<ComponentType>(
"ComponentType")
191 .value(
"Generic", ComponentType::Generic)
192 .value(
"Infinite", ComponentType::Infinite)
193 .value(
"Grid", ComponentType::Grid)
194 .value(
"Rectangular", ComponentType::Rectangular)
195 .value(
"Structured", ComponentType::Structured)
196 .value(
"Unstructured", ComponentType::Unstructured)
197 .value(
"Detector", ComponentType::Detector)
198 .value(
"OutlineComposite", ComponentType::OutlineComposite);
200 class_<ComponentInfo, boost::noncopyable>(
"ComponentInfo", no_init)
209 "Checks if the component is a detector.")
212 (arg(
"self"), arg(
"index")),
213 "Returns a list of detectors in the subtree for the component "
214 "identified by 'index'.")
217 (arg(
"self"), arg(
"index")),
218 "Returns a list of components in the subtree for the component "
219 "identified by 'index'.")
221 .def(
"position",
position, (arg(
"self"), arg(
"index")),
222 "Returns the absolute position of the component identified by "
225 .def(
"rotation",
rotation, (arg(
"self"), arg(
"index")),
226 "Returns the absolute rotation of the component identified by "
230 "Returns the absolute relative position of the component identified "
234 "Returns the absolute relative rotation of the component identified "
237 .def(
"setPosition",
setPosition, (arg(
"self"), arg(
"index"), arg(
"newPosition")),
238 "Set the absolute position of the component identified by 'index'.")
240 .def(
"setRotation",
setRotation, (arg(
"self"), arg(
"index"), arg(
"newRotation")),
241 "Set the absolute rotation of the component identified by 'index'.")
246 "Returns True is both beamlines either lack a Source or "
247 "have a Source at the same position.")
252 "Returns True is both beamlines either lack a Sample or "
253 "have a Sample at the same position.")
264 "Returns True only if the component identified by 'index' has a "
268 "Returns the parent component of the component identified by "
273 "Returns a list of child components for the component identified by "
276 .def(
"name", &
ComponentInfo::name, (arg(
"self"), arg(
"index")), return_value_policy<copy_const_reference>(),
277 "Returns the name of the component identified by 'index'.")
282 "Returns the scale factor for the component identified by 'index'.")
285 "Set the scale factor of the component identifed by 'index'.")
288 "Returns True if the component identified by 'index' has a valid "
292 return_value_policy<reference_existing_object>(),
293 "Returns the shape of the component identified by 'index'.")
295 .def(
"solidAngle", &solidAngle, (arg(
"self"), arg(
"index"), arg(
"observer")),
296 "Returns the solid angle of the component identified by 'index' as "
297 "seen from the observer position.")
300 "Returns the ComponentType of the component identified by 'index'.")
303 "Returns True if the component identified by 'index' is a Rectangular or Grid "
304 "bank. Every pixelGrid* accessor requires this to be True.")
306 .def(
"pixelGridNX", &pixelGridField<&PixelGridComponent::nX>, (arg(
"self"), arg(
"index")),
307 "Returns the number of pixels in the X (horizontal) direction of the "
308 "Rectangular/Grid bank identified by 'index'. Raises RuntimeError if the "
309 "component is not a Rectangular or Grid bank.")
311 .def(
"pixelGridNY", &pixelGridField<&PixelGridComponent::nY>, (arg(
"self"), arg(
"index")),
312 "Returns the number of pixels in the Y (vertical) direction of the "
313 "Rectangular/Grid bank identified by 'index'. Raises RuntimeError if the "
314 "component is not a Rectangular or Grid bank.")
316 .def(
"pixelGridNZ", &pixelGridField<&PixelGridComponent::nZ>, (arg(
"self"), arg(
"index")),
317 "Returns the number of pixels in the Z (usually beam) direction of the "
318 "Rectangular/Grid bank identified by 'index', or 0 for a 2D (rectangular) "
319 "bank. Raises RuntimeError if the component is not a Rectangular or Grid bank.")
321 .def(
"pixelGridXStart", &pixelGridField<&PixelGridComponent::xStart>, (arg(
"self"), arg(
"index")),
322 "Returns the X position of pixel (0, 0, 0), in the local (unrotated, unscaled) "
323 "frame of the Rectangular/Grid bank identified by 'index'. Raises RuntimeError "
324 "if the component is not a Rectangular or Grid bank.")
326 .def(
"pixelGridYStart", &pixelGridField<&PixelGridComponent::yStart>, (arg(
"self"), arg(
"index")),
327 "Returns the Y position of pixel (0, 0, 0), in the local (unrotated, unscaled) "
328 "frame of the Rectangular/Grid bank identified by 'index'. Raises RuntimeError "
329 "if the component is not a Rectangular or Grid bank.")
331 .def(
"pixelGridZStart", &pixelGridField<&PixelGridComponent::zStart>, (arg(
"self"), arg(
"index")),
332 "Returns the Z position of pixel (0, 0, 0), in the local (unrotated, unscaled) "
333 "frame of the Rectangular/Grid bank identified by 'index'. Raises RuntimeError "
334 "if the component is not a Rectangular or Grid bank.")
336 .def(
"pixelGridXStep", &pixelGridField<&PixelGridComponent::xStep>, (arg(
"self"), arg(
"index")),
337 "Returns the step size between neighbouring pixels along X for the "
338 "Rectangular/Grid bank identified by 'index'. Raises RuntimeError if the "
339 "component is not a Rectangular or Grid bank.")
341 .def(
"pixelGridYStep", &pixelGridField<&PixelGridComponent::yStep>, (arg(
"self"), arg(
"index")),
342 "Returns the step size between neighbouring pixels along Y for the "
343 "Rectangular/Grid bank identified by 'index'. Raises RuntimeError if the "
344 "component is not a Rectangular or Grid bank.")
346 .def(
"pixelGridZStep", &pixelGridField<&PixelGridComponent::zStep>, (arg(
"self"), arg(
"index")),
347 "Returns the step size between neighbouring pixels along Z for the "
348 "Rectangular/Grid bank identified by 'index'. Raises RuntimeError if the "
349 "component is not a Rectangular or Grid bank.")
351 .def(
"pixelGridIdStart", &pixelGridField<&PixelGridComponent::idStart>, (arg(
"self"), arg(
"index")),
352 "Returns the detector ID of the first pixel of the Rectangular/Grid bank "
353 "identified by 'index'. Raises RuntimeError if the component is not a "
354 "Rectangular or Grid bank.")
356 .def(
"pixelGridIdStep", &pixelGridField<&PixelGridComponent::idStep>, (arg(
"self"), arg(
"index")),
357 "Returns the detector ID step between pixels along the first-filled axis of "
358 "the Rectangular/Grid bank identified by 'index'. Raises RuntimeError if the "
359 "component is not a Rectangular or Grid bank.")
361 .def(
"pixelGridIdStepByRow", &pixelGridField<&PixelGridComponent::idStepByRow>, (arg(
"self"), arg(
"index")),
362 "Returns the detector ID step between rows along the second-filled axis of "
363 "the Rectangular/Grid bank identified by 'index'. Raises RuntimeError if the "
364 "component is not a Rectangular or Grid bank.")
366 .def(
"pixelGridMinDetectorID", &pixelGridField<&PixelGridComponent::minDetectorID>, (arg(
"self"), arg(
"index")),
367 "Returns the minimum detector ID in the Rectangular/Grid bank identified by "
368 "'index'. Raises RuntimeError if the component is not a Rectangular or Grid bank.")
370 .def(
"pixelGridMaxDetectorID", &pixelGridField<&PixelGridComponent::maxDetectorID>, (arg(
"self"), arg(
"index")),
371 "Returns the maximum detector ID in the Rectangular/Grid bank identified by "
372 "'index'. Raises RuntimeError if the component is not a Rectangular or Grid bank.")
374 .def(
"pixelGridIdFillOrder", &pixelGridIdFillOrder, (arg(
"self"), arg(
"index")),
375 "Returns the axis order in which detector IDs are filled for the "
376 "Rectangular/Grid bank identified by 'index', as a 3-character string "
377 "permutation of 'x', 'y' and 'z'. Raises RuntimeError if the component is not "
378 "a Rectangular or Grid bank.")
380 .def(
"pixelGridXSize", &pixelGridXSize, (arg(
"self"), arg(
"index")),
381 "Returns the x-size (width) in the Rectangular/Grid bank identified "
382 "by 'index'. Raises RuntimeError if the component is not a Rectangular or Grid "
385 .def(
"pixelGridYSize", &pixelGridYSize, (arg(
"self"), arg(
"index")),
386 "Returns the y-size (height) in the Rectangular/Grid bank identified "
387 "by 'index'. Raises RuntimeError if the component is not a Rectangular or Grid "
391 (arg(
"self"), arg(
"index"), arg(
"x"), arg(
"y"), arg(
"z")),
392 "Returns the detector index of the pixel at (x, y, z) within the "
393 "Rectangular/Grid bank identified by 'index'.")
396 "Returns the index of the component matching name. Where several components share the name, "
397 "returns the one closest to the root, as Instrument.getComponentByName() did. Raises "
398 "ValueError if name not found")
401 "Returns True if the name is a unique single occurance. Zero occurances yields False.")
405 "Returns the instrument's :class:`~mantid.geometry.ReferenceFrame`, which defines the axes pointing up "
406 "and along the beam, and the handedness. A default frame (Y up, Z along the beam, right-handed) if the "
407 "instrument has none.")
409 "Return the memory footprint of the component info in bytes.")
410 .def(
"shapeToComponentIndices", &shapeToComponentIndices, arg(
"self"),
411 "Returns a mapping of shapes to the indices of components with that shape.")
414 "Returns the fully-qualified name of the component identified by 'index', "
415 "e.g. 'instrument/bank1/pixel3'.")
418 "Returns the index of the component with this fully-qualified name, or "
419 "ComponentInfo.invalidIndex if there is none.")
425 .def(
"hasParameter", &readNamedParameter<&ComponentInfo::hasParameter>,
426 (arg(
"self"), arg(
"name"), arg(
"index") =
object(), arg(
"recursive") =
true),
427 "Returns True if the component identified by 'index' (the root component by "
428 "default) has a parameter of this name.")
430 .def(
"getParameterNames", &readParameter<&ComponentInfo::getParameterNames>,
431 (arg(
"self"), arg(
"index") =
object(), arg(
"recursive") =
true),
432 "Returns the names of the parameters on the component identified by 'index' "
433 "(the root component by default).")
435 .def(
"getNumberParameter", &readNamedParameter<&ComponentInfo::getNumberParameter>,
436 (arg(
"self"), arg(
"name"), arg(
"index") =
object(), arg(
"recursive") =
true),
437 "Returns the named double parameter of the component identified by 'index' "
438 "(the root component by default), or an empty sequence if it is unset.")
440 .def(
"getIntParameter", &readNamedParameter<&ComponentInfo::getIntParameter>,
441 (arg(
"self"), arg(
"name"), arg(
"index") =
object(), arg(
"recursive") =
true),
442 "Returns the named integer parameter of the component identified by 'index' "
443 "(the root component by default), or an empty sequence if it is unset.")
445 .def(
"getBoolParameter", &readNamedParameter<&ComponentInfo::getBoolParameter>,
446 (arg(
"self"), arg(
"name"), arg(
"index") =
object(), arg(
"recursive") =
true),
447 "Returns the named boolean parameter of the component identified by 'index' "
448 "(the root component by default), or an empty sequence if it is unset.")
450 .def(
"getStringParameter", &readNamedParameter<&ComponentInfo::getStringParameter>,
451 (arg(
"self"), arg(
"name"), arg(
"index") =
object(), arg(
"recursive") =
true),
452 "Returns the named string parameter of the component identified by 'index' "
453 "(the root component by default), or an empty sequence if it is unset.")
455 .def(
"getParameterType", &readNamedParameter<&ComponentInfo::getParameterType>,
456 (arg(
"self"), arg(
"name"), arg(
"index") =
object(), arg(
"recursive") =
true),
457 "Returns the type of the named parameter of the component identified by 'index' "
458 "(the root component by default), or an empty string if it is unset.")
460 .def(
"getPositionParameter", &readNamedParameter<&ComponentInfo::getPositionParameter>,
461 (arg(
"self"), arg(
"name"), arg(
"index") =
object(), arg(
"recursive") =
true),
462 "Returns the named V3D parameter of the component identified by 'index' "
463 "(the root component by default), or an empty sequence if it is unset.")
465 .def(
"getRotationParameter", &readNamedParameter<&ComponentInfo::getRotationParameter>,
466 (arg(
"self"), arg(
"name"), arg(
"index") =
object(), arg(
"recursive") =
true),
467 "Returns the named Quat parameter of the component identified by 'index' "
468 "(the root component by default), or an empty sequence if it is unset.")
470 .def(
"getParameterAsString", &readNamedParameter<&ComponentInfo::getParameterAsString>,
471 (arg(
"self"), arg(
"name"), arg(
"index") =
object(), arg(
"recursive") =
true),
472 "Returns the value of the named parameter of the component identified by 'index' "
473 "(the root component by default) as a string, whatever its type, or an empty string if it is unset.")
475 .def(
"getParameterVisible", &readNamedParameter<&ComponentInfo::getParameterVisible>,
476 (arg(
"self"), arg(
"name"), arg(
"index") =
object(), arg(
"recursive") =
true),
477 "Returns the visibility attribute of the named parameter of the component identified by 'index' "
478 "(the root component by default), or False if it is unset.")
480 .def(
"getParamDescription", &readNamedParameter<&ComponentInfo::getParamDescription>,
481 (arg(
"self"), arg(
"name"), arg(
"index") =
object(), arg(
"recursive") =
true),
482 "Returns the description of the named parameter of the component identified by 'index' "
483 "(the root component by default), or an empty string if it is unset.")
485 .def(
"getParamShortDescription", &readNamedParameter<&ComponentInfo::getParamShortDescription>,
486 (arg(
"self"), arg(
"name"), arg(
"index") =
object(), arg(
"recursive") =
true),
487 "Returns the short description (tooltip) of the named parameter of the component identified by "
488 "'index' (the root component by default), or an empty string if it is unset.")
490 .def(
"getDescription", &readDescription<&ComponentInfo::getDescription>, (arg(
"self"), arg(
"index") =
object()),
491 "Returns the description of the component identified by 'index' (the root component by default).")
493 .def(
"getShortDescription", &readDescription<&ComponentInfo::getShortDescription>,
494 (arg(
"self"), arg(
"index") =
object()),
495 "Returns the short description (tooltip) of the component identified by 'index' "
496 "(the root component by default).")
498 .def(
"setDescription", &setDescription, (arg(
"self"), arg(
"description"), arg(
"index") =
object()),
499 "Sets the description of the component identified by 'index' (the root component by default).")
501 .def(
"getFittingParameter", &getFittingParameter,
502 (arg(
"self"), arg(
"name"), arg(
"xvalue"), arg(
"index") =
object()),
503 "Returns the named fitting parameter of the component identified by 'index' (the "
504 "root component by default), evaluated at 'xvalue' from its look-up table or formula.")
506 .def(
"addParameter", &addParameter,
507 (arg(
"self"), arg(
"type"), arg(
"name"), arg(
"value"), arg(
"index") =
object(), arg(
"description") =
"",
508 arg(
"visible") =
"true"),
509 "Adds or replaces the named parameter of this type, given its value as a string, "
510 "on the component identified by 'index' (the root component by default).")
512 .def(
"addDouble", &insertParameter<&ComponentInfo::addDouble, double, std::string>,
513 (arg(
"self"), arg(
"name"), arg(
"value"), arg(
"index") =
object(), arg(
"description") =
"",
514 arg(
"visible") =
"true"),
515 "Adds or replaces a named double parameter on the component identified by 'index' "
516 "(the root component by default).")
518 .def(
"addInt", &insertParameter<&ComponentInfo::addInt, int, std::string>,
519 (arg(
"self"), arg(
"name"), arg(
"value"), arg(
"index") =
object(), arg(
"description") =
"",
520 arg(
"visible") =
"true"),
521 "Adds or replaces a named integer parameter on the component identified by 'index' "
522 "(the root component by default).")
524 .def(
"addBool", &insertParameter<&ComponentInfo::addBool, bool, std::string>,
525 (arg(
"self"), arg(
"name"), arg(
"value"), arg(
"index") =
object(), arg(
"description") =
"",
526 arg(
"visible") =
"true"),
527 "Adds or replaces a named boolean parameter on the component identified by 'index' "
528 "(the root component by default).")
530 .def(
"addString", &insertParameter<&ComponentInfo::addString, std::string, std::string>,
531 (arg(
"self"), arg(
"name"), arg(
"value"), arg(
"index") =
object(), arg(
"description") =
"",
532 arg(
"visible") =
"true"),
533 "Adds or replaces a named string parameter on the component identified by 'index' "
534 "(the root component by default).")
536 .def(
"addV3D", &insertParameter<&ComponentInfo::addV3D, V3D>,
537 (arg(
"self"), arg(
"name"), arg(
"value"), arg(
"index") =
object(), arg(
"description") =
""),
538 "Adds or replaces a named V3D parameter on the component identified by 'index' "
539 "(the root component by default).")
541 .def(
"addQuat", &insertParameter<&ComponentInfo::addQuat, Quat>,
542 (arg(
"self"), arg(
"name"), arg(
"value"), arg(
"index") =
object(), arg(
"description") =
""),
543 "Adds or replaces a named Quat parameter on the component identified by 'index' "
544 "(the root component by default).")
546 .def(
"addFittingParameter", &addFittingParameter,
547 (arg(
"self"), arg(
"name"), arg(
"fittingFunction"), arg(
"value"), arg(
"index") =
object(),
548 arg(
"description") =
"", arg(
"visible") =
"true"),
549 "Adds a named fitting parameter, given its value as a string, on the component "
550 "identified by 'index' (the root component by default).")
552 .def(
"clearParameter", &clearParameter, (arg(
"self"), arg(
"name"), arg(
"index") =
object()),
553 "Removes every parameter of this name from the component identified by 'index' "
554 "(the root component by default).");
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
SpectrumInfoPythonIterator make_pyiterator(SpectrumInfo &spectrumInfo)
void export_ComponentInfo()
Mantid::Kernel::Quat(ComponentInfo::* rotation)(const size_t) const
void(ComponentInfo::* setPosition)(const size_t, const Mantid::Kernel::V3D &)
void(ComponentInfo::* setRotation)(const size_t, const Mantid::Kernel::Quat &)
Mantid::Kernel::V3D(ComponentInfo::* position)(const size_t) const
ComponentInfo : Provides a component centric view on to the instrument.
bool hasParent(const size_t componentIndex) const
void clearParameter(const size_t componentIndex, const std::string &name)
Remove every parameter of this name from this component.
std::string fullName(const size_t componentIndex) const
The fully-qualified name of a component ("instrument/bank1/pixel3")
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
The first component with this name in a breadth-first search, as Instrument::getComponentByName() fin...
bool hasEquivalentSource(const ComponentInfo &other) const
void setDescription(const size_t componentIndex, const std::string &description)
Set the component's description, as Component::setDescription() does: on the parameter named after th...
std::shared_ptr< const ReferenceFrame > referenceFrame() const
The instrument's reference frame: which axes point up and along the beam, and its handedness.
void addFittingParameter(const size_t componentIndex, const std::string &name, const std::string &fittingFunction, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
Add a fitting parameter.
double solidAngle(const size_t componentIndex, const Geometry::SolidAngleParams ¶ms) const
size_t parent(const size_t componentIndex) const
bool isGridDetector(size_t const componentIndex) const
const std::vector< size_t > & children(size_t componentIndex) const
std::vector< size_t > componentsInSubtree(size_t componentIndex) const
bool hasParameter(const size_t componentIndex, const std::string &name, bool recursive=true) const
Returns empty (or false) if the ComponentInfo was built without parameters or the parameter is unset.
bool hasValidShape(const size_t componentIndex) const
std::vector< double > getNumberParameter(const size_t componentIndex, const std::string &name, bool recursive=true) const
double getFittingParameter(const size_t componentIndex, const std::string &name, double xvalue) const
Beamline::PixelGridComponent pixelGridComponent(const size_t componentIndex) const
Kernel::V3D sourcePosition() const
bool hasEquivalentSample(const ComponentInfo &other) const
void setScaleFactor(const size_t componentIndex, const Kernel::V3D &scaleFactor)
std::vector< size_t > detectorsInSubtree(size_t componentIndex) const
bool isDetector(const size_t componentIndex) const
bool uniqueName(const std::string &name) const
size_t detectorIndexAtXYZ(const size_t componentIndex, const int x, const int y, const int z) const
Kernel::V3D relativePosition(const size_t componentIndex) 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
static constexpr size_t invalidIndex
Returned by indexOfOrInvalid() for a component ID that is not part of this instrument.
Kernel::V3D samplePosition() const
const Geometry::IObject & shape(const size_t componentIndex) const
size_t indexOfFullName(const std::string &fullName) const
The component with this fully-qualified name, or invalidIndex if there is none.
Beamline::ComponentType componentType(const size_t componentIndex) const
Kernel::V3D scaleFactor(const size_t componentIndex) const
void addParameter(const size_t componentIndex, const std::string &type, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
Add or replace a named parameter at a specific component index.
Helper class which provides the Collimation Length for SANS instruments.
adjust instrument component position and orientation
: detector size scale at y-direction
Implements a return value policy that returns a numpy array from a rerence to a std::vector.