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. More... | |
std::vector< size_t > | findNeighbourIndexesFaceTouching () const override |
Find neighbouring indexes face touching. More... | |
MDBoxBase< MDE, nd > * | getBox () const |
Return a pointer to the current box pointed to by the iterator. More... | |
Mantid::Kernel::VMD | getCenter () const override |
Returns the position of the center of the box pointed to. More... | |
size_t | getDataSize () const override |
---------— IMDIterator Methods ---------------------------— More... | |
signal_t | getError () const override |
Returns the total error for this box. More... | |
int32_t | getInnerDetectorID (size_t index) const override |
For a given event/point in this box, return the detector ID. More... | |
signal_t | getInnerError (size_t index) const override |
Returns the error of a given event. More... | |
uint16_t | getInnerExpInfoIndex (size_t index) const override |
For a given event/point in this box, return the associated experiment-info index. More... | |
uint16_t | getInnerGoniometerIndex (size_t index) const override |
For a given event/point in this box, return the goniometer index. More... | |
coord_t | getInnerPosition (size_t index, size_t dimension) const override |
Returns the position of a given event for a given dimension. More... | |
signal_t | getInnerSignal (size_t index) const override |
Returns the signal of a given event. More... | |
bool | getIsMasked () const override |
Returns true if masking is used. More... | |
size_t | getLinearIndex () const override |
Get the linear index. More... | |
signal_t | getNormalizedError () const override |
Returns the normalized error for this box. More... | |
signal_t | getNormalizedSignal () const override |
Returns the normalized signal for this box. More... | |
size_t | getNumEvents () const override |
Returns the number of events/points contained in this box. More... | |
size_t | getPosition () const |
Getter for the position of the iterator. More... | |
signal_t | getSignal () const override |
Returns the total signal for this box. More... | |
std::unique_ptr< coord_t[]> | getVertexesArray (size_t &numVertices) const override |
Return a list of vertexes defining the volume pointed to. More... | |
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. More... | |
void | init (std::vector< API::IMDNode * > &boxes, size_t begin, size_t end) |
bool | isWithinBounds (size_t index) const override |
Is index reachable by the iterator. More... | |
void | jumpTo (size_t index) override |
Jump to the index^th cell. More... | |
MDBoxIterator (API::IMDNode *topBox, size_t maxDepth, bool leafOnly, Mantid::Geometry::MDImplicitFunction *function=nullptr) | |
MDBoxIterator (API::IMDNode *topBox, size_t maxDepth, bool leafOnly, SkippingPolicy *skippingPolicy, Mantid::Geometry::MDImplicitFunction *function=nullptr) | |
MDBoxIterator (std::vector< API::IMDNode * > &boxes, size_t begin, size_t end) | |
bool | next () override |
Advance to the next cell. More... | |
bool | next (size_t skip) override |
Advance, skipping a certain number of cells. More... | |
bool | valid () const override |
Is the current position of the iterator valid? More... | |
~MDBoxIterator () override | |
![]() | |
virtual std::vector< size_t > | findNeighbourIndexes () const =0 |
Find neighbouring indexes vertex touching. More... | |
virtual std::vector< size_t > | findNeighbourIndexesFaceTouching () const =0 |
Find neighbouring indexes face touching. More... | |
virtual Mantid::Kernel::VMD | getCenter () const =0 |
Returns the position of the center of the box pointed to. More... | |
virtual size_t | getDataSize () const =0 |
Get the size of the data (number of entries that will be iterated through) More... | |
virtual signal_t | getError () const =0 |
Returns the total error for this box. More... | |
virtual int32_t | getInnerDetectorID (size_t index) const =0 |
For a given event/point in this box, return the detector ID. More... | |
virtual signal_t | getInnerError (size_t index) const =0 |
Returns the error of a given event. More... | |
virtual uint16_t | getInnerExpInfoIndex (size_t index) const =0 |
For a given event/point in this box, return the associated experiment-info index. More... | |
virtual uint16_t | getInnerGoniometerIndex (size_t index) const =0 |
For a given event/point in this box, return the goniometer index. More... | |
virtual coord_t | getInnerPosition (size_t index, size_t dimension) const =0 |
Returns the position of a given event for a given dimension. More... | |
virtual signal_t | getInnerSignal (size_t index) const =0 |
Returns the signal of a given event. More... | |
virtual bool | getIsMasked () const =0 |
Returns true if masking is used. More... | |
virtual size_t | getLinearIndex () const =0 |
Get the linear index. More... | |
Mantid::API::MDNormalization | getNormalization () const |
virtual signal_t | getNormalizedError () const =0 |
Returns the normalized error for this box. More... | |
virtual signal_t | getNormalizedSignal () const =0 |
Returns the normalized signal for this box. More... | |
virtual size_t | getNumEvents () const =0 |
Returns the number of events/points contained in this box. More... | |
virtual signal_t | getSignal () const =0 |
Returns the total signal for this box. More... | |
virtual std::unique_ptr< coord_t[]> | getVertexesArray (size_t &numVertices) const =0 |
Return a list of vertexes defining the volume pointed to. More... | |
virtual std::unique_ptr< coord_t[]> | getVertexesArray (size_t &numVertices, const size_t outDimensions, const bool *maskDim) const =0 |
Return a list of vertexes defining the volume pointed to, enable masking of dimensions. More... | |
IMDIterator () | |
Default constructor. More... | |
virtual bool | isWithinBounds (size_t index) const =0 |
Is index reachable by the iterator. More... | |
virtual void | jumpTo (size_t index)=0 |
Jump to the index^th cell. More... | |
virtual bool | next ()=0 |
Advance to the next cell. More... | |
virtual bool | next (size_t skip)=0 |
Advance, skipping a certain number of cells. More... | |
void | setNormalization (Mantid::API::MDNormalization normalization) |
Set how the signal will be normalized when calling getNormalizedSignal() More... | |
virtual bool | valid () const =0 |
Is the current position of the iterator valid? More... | |
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. More... | |
void | getEvents () const |
void | releaseEvents () const |
Private Attributes | |
std::vector< API::IMDNode * > | m_boxes |
Vector of all the boxes that will be iterated. More... | |
MDBoxBase< MDE, nd > * | m_current |
Box currently pointed to. More... | |
MDBox< MDE, nd > * | m_currentMDBox |
MDBox currently pointed to. More... | |
const std::vector< MDE > * | m_events |
Pointer to the const events vector. Only initialized when needed. More... | |
size_t | m_max |
Max pos = length of the boxes vector. More... | |
size_t | m_pos |
Current position in the vector of boxes. More... | |
SkippingPolicy_scptr | m_skippingPolicy |
Additional Inherited Members | |
![]() | |
Mantid::API::MDNormalization | m_normalization |
Normalization method for getNormalizedSignal() More... | |
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 |
||
) |
Mantid::DataObjects::MDBoxIterator::MDBoxIterator | ( | API::IMDNode * | topBox, |
size_t | maxDepth, | ||
bool | leafOnly, | ||
SkippingPolicy * | skippingPolicy, | ||
Mantid::Geometry::MDImplicitFunction * | function = nullptr |
||
) |
Mantid::DataObjects::MDBoxIterator::MDBoxIterator | ( | std::vector< API::IMDNode * > & | boxes, |
size_t | begin, | ||
size_t | end | ||
) |
|
override |
|
private |
Common code run my a few of the constructors.
|
overridevirtual |
Find neighbouring indexes vertex touching.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
Find neighbouring indexes face touching.
Implements Mantid::API::IMDIterator.
|
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.
|
overridevirtual |
---------— IMDIterator Methods ---------------------------—
Implements Mantid::API::IMDIterator.
|
overridevirtual |
Returns the total error for this box.
Implements Mantid::API::IMDIterator.
|
private |
|
overridevirtual |
For a given event/point in this box, return the detector ID.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
Returns the error of a given event.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
For a given event/point in this box, return the associated experiment-info index.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
For a given event/point in this box, return the goniometer index.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
Returns the position of a given event for a given dimension.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
Returns the signal of a given event.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
Returns true if masking is used.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
Get the linear index.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
Returns the normalized error for this box.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
Returns the normalized signal for this box.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
Returns the number of events/points contained in this box.
Implements Mantid::API::IMDIterator.
|
inline |
Getter for the position of the iterator.
Definition at line 84 of file MDBoxIterator.h.
|
overridevirtual |
Returns the total signal for this box.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
Return a list of vertexes defining the volume pointed to.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
Return a list of vertexes defining the volume pointed to, enable masking of dimensions.
Implements Mantid::API::IMDIterator.
void Mantid::DataObjects::MDBoxIterator::init | ( | std::vector< API::IMDNode * > & | boxes, |
size_t | begin, | ||
size_t | end | ||
) |
|
overridevirtual |
Is index reachable by the iterator.
Implements Mantid::API::IMDIterator.
|
overridevirtual |
Jump to the index^th cell.
Implements Mantid::API::IMDIterator.
|
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.
Referenced by Mantid::MDAlgorithms::MinusMD::doMinus(), Mantid::MDAlgorithms::PlusMD::doPlus(), and Mantid::MDAlgorithms::IntegratePeaksMD2::findEllipsoid().
|
overridevirtual |
Advance, skipping a certain number of cells.
Implements Mantid::API::IMDIterator.
|
private |
|
overridevirtual |
Is the current position of the iterator valid?
Implements Mantid::API::IMDIterator.
|
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.