|
Mantid
|
MDBoxIterator: iterate through MDBoxBase hierarchy down to a given maximum depth. More...
#include <MDBoxIterator.h>
Public Member Functions | |
| std::vector< size_t > | findNeighbourIndexes () const override |
| Find neighbouring indexes vertex touching. | |
| std::vector< size_t > | findNeighbourIndexesFaceTouching () const override |
| Find neighbouring indexes face touching. | |
| MDBoxBase< MDE, nd > * | getBox () const |
| Return a pointer to the current box pointed to by the iterator. | |
| Mantid::Kernel::VMD | getCenter () const override |
| Returns the position of the center of the box pointed to. | |
| size_t | getDataSize () const override |
| ---------— IMDIterator Methods ---------------------------— | |
| signal_t | getError () const override |
| Returns the error for this box. | |
| int32_t | getInnerDetectorID (size_t index) const override |
| For a given event/point in this box, return the detector ID. | |
| signal_t | getInnerError (size_t index) const override |
| Returns the error of a given event. | |
| uint16_t | getInnerExpInfoIndex (size_t index) const override |
| For a given event/point in this box, return the associated experiment-info index. | |
| uint16_t | getInnerGoniometerIndex (size_t index) const override |
| For a given event/point in this box, return the goniometer index. | |
| coord_t | getInnerPosition (size_t index, size_t dimension) const override |
| Returns the position of a given event for a given dimension. | |
| signal_t | getInnerSignal (size_t index) const override |
| Returns the signal of a given event. | |
| bool | getIsMasked () const override |
| Returns the error of a given event. | |
| size_t | getLinearIndex () const override |
| Get the linear index. | |
| signal_t | getNormalizedError () const override |
| Returns the normalized error for this box. | |
| signal_t | getNormalizedSignal () const override |
| Returns the normalized signal for this box. | |
| size_t | getNumEvents () const override |
| Returns the number of events/points contained in this box. | |
| size_t | getPosition () const |
| Getter for the position of the iterator. | |
| signal_t | getSignal () const override |
| Returns the signal for this box. | |
| std::unique_ptr< coord_t[]> | getVertexesArray (size_t &numVertices) const override |
| Return a list of vertexes defining the volume pointed to. | |
| std::unique_ptr< coord_t[]> | getVertexesArray (size_t &numVertices, const size_t outDimensions, const bool *maskDim) const override |
| Return a list of vertexes defining the volume pointed to, enable masking of dimensions. | |
| void | init (std::vector< API::IMDNode * > &boxes, size_t begin, size_t end) |
| Constructor helper function. | |
| bool | isWithinBounds (size_t index) const override |
| Is index reachable by the iterator. | |
| void | jumpTo (size_t index) override |
| Jump to the index^th cell. | |
| MDBoxIterator (API::IMDNode *topBox, size_t maxDepth, bool leafOnly, Mantid::Geometry::MDImplicitFunction *function=nullptr) | |
| Constructor. | |
| MDBoxIterator (API::IMDNode *topBox, size_t maxDepth, bool leafOnly, SkippingPolicy *skippingPolicy, Mantid::Geometry::MDImplicitFunction *function=nullptr) | |
| Constructor. | |
| MDBoxIterator (std::vector< API::IMDNode * > &boxes, size_t begin, size_t end) | |
| Constructor for parallelized iterators. | |
| bool | next () override |
| Advance to the next cell. | |
| bool | next (size_t skip) override |
| Advance, skipping a certain number of cells. | |
| bool | valid () const override |
| ~MDBoxIterator () override | |
| Destructor. | |
Public Member Functions inherited from Mantid::API::IMDIterator | |
| Mantid::API::MDNormalization | getNormalization () const |
| IMDIterator () | |
| Default constructor. | |
| void | setNormalization (Mantid::API::MDNormalization normalization) |
| Set how the signal will be normalized when calling getNormalizedSignal() | |
| virtual | ~IMDIterator ()=default |
Private Member Functions | |
| void | commonConstruct (API::IMDNode *topBox, size_t maxDepth, bool leafOnly, Mantid::Geometry::MDImplicitFunction *function) |
| Common code run my a few of the constructors. | |
| void | getEvents () const |
| If needed, retrieve the events vector from the box. | |
| void | releaseEvents () const |
| After you're done with a given box, release the events list (if it was retrieved) | |
Private Attributes | |
| std::vector< API::IMDNode * > | m_boxes |
| Vector of all the boxes that will be iterated. | |
| MDBoxBase< MDE, nd > * | m_current |
| Box currently pointed to. | |
| MDBox< MDE, nd > * | m_currentMDBox |
| MDBox currently pointed to. | |
| const std::vector< MDE > * | m_events |
| Pointer to the const events vector. Only initialized when needed. | |
| size_t | m_max |
| Max pos = length of the boxes vector. | |
| size_t | m_pos |
| Current position in the vector of boxes. | |
| SkippingPolicy_scptr | m_skippingPolicy |
Additional Inherited Members | |
Protected Attributes inherited from Mantid::API::IMDIterator | |
| Mantid::API::MDNormalization | m_normalization |
| Normalization method for getNormalizedSignal() | |
MDBoxIterator: iterate through MDBoxBase hierarchy down to a given maximum depth.
Definition at line 28 of file MDBoxIterator.h.
| Mantid::DataObjects::MDBoxIterator::MDBoxIterator | ( | API::IMDNode * | topBox, |
| size_t | maxDepth, | ||
| bool | leafOnly, | ||
| Mantid::Geometry::MDImplicitFunction * | function = nullptr |
||
| ) |
Constructor.
| topBox | :: top-level parent box. |
| maxDepth | :: maximum depth to go to |
| leafOnly | :: only report "leaf" nodes, e.g. boxes that are no longer split OR are at maxDepth. |
| function | :: ImplicitFunction that limits iteration volume. NULL for don't limit this way. Note that the top level box is ALWAYS returned at least once, even if it is outside the implicit function |
Definition at line 28 of file MDBoxIterator.hxx.
| Mantid::DataObjects::MDBoxIterator::MDBoxIterator | ( | API::IMDNode * | topBox, |
| size_t | maxDepth, | ||
| bool | leafOnly, | ||
| SkippingPolicy * | skippingPolicy, | ||
| Mantid::Geometry::MDImplicitFunction * | function = nullptr |
||
| ) |
Constructor.
| topBox | :: top-level parent box. |
| maxDepth | :: maximum depth to go to |
| leafOnly | :: only report "leaf" nodes, e.g. boxes that are no longer split OR are at maxDepth. |
| skippingPolicy | :: policy for skipping boxes upon next(). |
| function | :: ImplicitFunction that limits iteration volume. NULL for don't limit this way. Note that the top level box is ALWAYS returned at least once, even if it is outside the implicit function |
Definition at line 49 of file MDBoxIterator.hxx.
| Mantid::DataObjects::MDBoxIterator::MDBoxIterator | ( | std::vector< API::IMDNode * > & | boxes, |
| size_t | begin, | ||
| size_t | end | ||
| ) |
Constructor for parallelized iterators.
| boxes | :: ref to the list of ALL boxes in the workspace |
| begin | :: start iterating at this point in the list |
| end | :: stop iterating at this point in the list |
Definition at line 98 of file MDBoxIterator.hxx.
|
override |
Destructor.
Definition at line 134 of file MDBoxIterator.hxx.
|
private |
Common code run my a few of the constructors.
Common construction code in the absense of constructor chaining.
| topBox | :: top-level parent box. |
| maxDepth | :: maximum depth to go to |
| leafOnly | :: only report "leaf" nodes, e.g. boxes that are no longer split OR are at maxDepth. |
| function | :: ImplicitFunction that limits iteration volume. NULL for don't limit this way. Note that the top level box is ALWAYS returned at least once, even if it is outside the implicit function |
Definition at line 68 of file MDBoxIterator.hxx.
References m_max.
|
overridevirtual |
Find neighbouring indexes vertex touching.
Implements Mantid::API::IMDIterator.
Definition at line 325 of file MDBoxIterator.hxx.
|
overridevirtual |
Find neighbouring indexes face touching.
Implements Mantid::API::IMDIterator.
Definition at line 329 of file MDBoxIterator.hxx.
|
inline |
Return a pointer to the current box pointed to by the iterator.
Definition at line 39 of file MDBoxIterator.h.
Referenced by Mantid::MDAlgorithms::MinusMD::doMinus(), Mantid::MDAlgorithms::PlusMD::doPlus(), and Mantid::MDAlgorithms::IntegratePeaksMD2::findEllipsoid().
|
overridevirtual |
Returns the position of the center of the box pointed to.
Implements Mantid::API::IMDIterator.
Definition at line 264 of file MDBoxIterator.hxx.
|
overridevirtual |
---------— IMDIterator Methods ---------------------------—
Returns the number of entries to be iterated against.
Implements Mantid::API::IMDIterator.
Definition at line 216 of file MDBoxIterator.hxx.
|
overridevirtual |
Returns the error for this box.
Implements Mantid::API::IMDIterator.
Definition at line 251 of file MDBoxIterator.hxx.
|
private |
If needed, retrieve the events vector from the box.
Does nothing if the events are already obtained.
| if | the box cannot have events. |
Definition at line 189 of file MDBoxIterator.hxx.
References Mantid::DataObjects::MDBox::getConstEvents().
|
overridevirtual |
For a given event/point in this box, return the detector ID.
Implements Mantid::API::IMDIterator.
Definition at line 294 of file MDBoxIterator.hxx.
|
overridevirtual |
Returns the error of a given event.
Implements Mantid::API::IMDIterator.
Definition at line 312 of file MDBoxIterator.hxx.
|
overridevirtual |
For a given event/point in this box, return the associated experiment-info index.
Implements Mantid::API::IMDIterator.
Definition at line 282 of file MDBoxIterator.hxx.
|
overridevirtual |
For a given event/point in this box, return the goniometer index.
Implements Mantid::API::IMDIterator.
Definition at line 288 of file MDBoxIterator.hxx.
|
overridevirtual |
Returns the position of a given event for a given dimension.
Implements Mantid::API::IMDIterator.
Definition at line 300 of file MDBoxIterator.hxx.
|
overridevirtual |
Returns the signal of a given event.
Implements Mantid::API::IMDIterator.
Definition at line 306 of file MDBoxIterator.hxx.
|
overridevirtual |
Returns the error of a given event.
Implements Mantid::API::IMDIterator.
Definition at line 318 of file MDBoxIterator.hxx.
|
overridevirtual |
Get the linear index.
Implements Mantid::API::IMDIterator.
Definition at line 333 of file MDBoxIterator.hxx.
|
overridevirtual |
Returns the normalized error for this box.
Implements Mantid::API::IMDIterator.
Definition at line 234 of file MDBoxIterator.hxx.
|
overridevirtual |
Returns the normalized signal for this box.
Implements Mantid::API::IMDIterator.
Definition at line 220 of file MDBoxIterator.hxx.
|
overridevirtual |
Returns the number of events/points contained in this box.
Implements Mantid::API::IMDIterator.
Definition at line 272 of file MDBoxIterator.hxx.
|
inline |
Getter for the position of the iterator.
Definition at line 84 of file MDBoxIterator.h.
|
overridevirtual |
Returns the signal for this box.
Implements Mantid::API::IMDIterator.
Definition at line 248 of file MDBoxIterator.hxx.
|
overridevirtual |
Return a list of vertexes defining the volume pointed to.
Implements Mantid::API::IMDIterator.
Definition at line 254 of file MDBoxIterator.hxx.
|
overridevirtual |
Return a list of vertexes defining the volume pointed to, enable masking of dimensions.
Implements Mantid::API::IMDIterator.
Definition at line 258 of file MDBoxIterator.hxx.
| void Mantid::DataObjects::MDBoxIterator::init | ( | std::vector< API::IMDNode * > & | boxes, |
| size_t | begin, | ||
| size_t | end | ||
| ) |
Constructor helper function.
| boxes | :: ref to the list of ALL boxes in the workspace |
| begin | :: start iterating at this point in the list |
| end | :: stop iterating at this point in the list |
Definition at line 112 of file MDBoxIterator.hxx.
References m_max.
|
overridevirtual |
Is index reachable by the iterator.
Implements Mantid::API::IMDIterator.
Definition at line 337 of file MDBoxIterator.hxx.
|
overridevirtual |
Jump to the index^th cell.
| index | :: point to jump to. Must be 0 <= index < getDataSize(). |
Implements Mantid::API::IMDIterator.
Definition at line 141 of file MDBoxIterator.hxx.
|
overridevirtual |
Advance to the next cell.
If the current cell is the last one in the workspace do nothing and return false.
Implements Mantid::API::IMDIterator.
Definition at line 158 of file MDBoxIterator.hxx.
Referenced by Mantid::MDAlgorithms::MinusMD::doMinus(), Mantid::MDAlgorithms::PlusMD::doPlus(), and Mantid::MDAlgorithms::IntegratePeaksMD2::findEllipsoid().
|
inlineoverridevirtual |
Advance, skipping a certain number of cells.
| skip | :: how many to increase. If 1, then every point will be sampled. |
Implements Mantid::API::IMDIterator.
Definition at line 172 of file MDBoxIterator.hxx.
References m_max.
|
private |
After you're done with a given box, release the events list (if it was retrieved)
Definition at line 206 of file MDBoxIterator.hxx.
|
overridevirtual |
Implements Mantid::API::IMDIterator.
Definition at line 151 of file MDBoxIterator.hxx.
|
private |
Vector of all the boxes that will be iterated.
Definition at line 110 of file MDBoxIterator.h.
|
private |
Box currently pointed to.
Definition at line 113 of file MDBoxIterator.h.
|
mutableprivate |
MDBox currently pointed to.
Definition at line 116 of file MDBoxIterator.h.
|
mutableprivate |
Pointer to the const events vector. Only initialized when needed.
Definition at line 119 of file MDBoxIterator.h.
|
private |
Max pos = length of the boxes vector.
Definition at line 107 of file MDBoxIterator.h.
|
private |
Current position in the vector of boxes.
Definition at line 104 of file MDBoxIterator.h.
|
private |
Definition at line 122 of file MDBoxIterator.h.