Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::DataObjects::MDBoxIterator Class Reference

MDBoxIterator: iterate through MDBoxBase hierarchy down to a given maximum depth. More...

#include <MDBoxIterator.h>

Inheritance diagram for Mantid::DataObjects::MDBoxIterator:
Mantid::API::IMDIterator

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
 
- Public Member Functions inherited from Mantid::API::IMDIterator
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

- Protected Attributes inherited from Mantid::API::IMDIterator
Mantid::API::MDNormalization m_normalization
 Normalization method for getNormalizedSignal() More...
 

Detailed Description

MDBoxIterator: iterate through MDBoxBase hierarchy down to a given maximum depth.

Author
Janik Zikovsky
Date
2011-06-03

Definition at line 28 of file MDBoxIterator.h.

Constructor & Destructor Documentation

◆ MDBoxIterator() [1/3]

Mantid::DataObjects::MDBoxIterator::MDBoxIterator ( API::IMDNode topBox,
size_t  maxDepth,
bool  leafOnly,
Mantid::Geometry::MDImplicitFunction function = nullptr 
)

◆ MDBoxIterator() [2/3]

Mantid::DataObjects::MDBoxIterator::MDBoxIterator ( API::IMDNode topBox,
size_t  maxDepth,
bool  leafOnly,
SkippingPolicy skippingPolicy,
Mantid::Geometry::MDImplicitFunction function = nullptr 
)

◆ MDBoxIterator() [3/3]

Mantid::DataObjects::MDBoxIterator::MDBoxIterator ( std::vector< API::IMDNode * > &  boxes,
size_t  begin,
size_t  end 
)

◆ ~MDBoxIterator()

Mantid::DataObjects::MDBoxIterator::~MDBoxIterator ( )
override

Member Function Documentation

◆ commonConstruct()

void Mantid::DataObjects::MDBoxIterator::commonConstruct ( API::IMDNode topBox,
size_t  maxDepth,
bool  leafOnly,
Mantid::Geometry::MDImplicitFunction function 
)
private

Common code run my a few of the constructors.

◆ findNeighbourIndexes()

std::vector< size_t > Mantid::DataObjects::MDBoxIterator::findNeighbourIndexes ( ) const
overridevirtual

Find neighbouring indexes vertex touching.

Implements Mantid::API::IMDIterator.

◆ findNeighbourIndexesFaceTouching()

std::vector< size_t > Mantid::DataObjects::MDBoxIterator::findNeighbourIndexesFaceTouching ( ) const
overridevirtual

Find neighbouring indexes face touching.

Implements Mantid::API::IMDIterator.

◆ getBox()

MDBoxBase< MDE, nd > * Mantid::DataObjects::MDBoxIterator::getBox ( ) const
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().

◆ getCenter()

Mantid::Kernel::VMD Mantid::DataObjects::MDBoxIterator::getCenter ( ) const
overridevirtual

Returns the position of the center of the box pointed to.

Implements Mantid::API::IMDIterator.

◆ getDataSize()

size_t Mantid::DataObjects::MDBoxIterator::getDataSize ( ) const
overridevirtual

---------— IMDIterator Methods ---------------------------—

Implements Mantid::API::IMDIterator.

◆ getError()

signal_t Mantid::DataObjects::MDBoxIterator::getError ( ) const
overridevirtual

Returns the total error for this box.

Implements Mantid::API::IMDIterator.

◆ getEvents()

void Mantid::DataObjects::MDBoxIterator::getEvents ( ) const
private

◆ getInnerDetectorID()

int32_t Mantid::DataObjects::MDBoxIterator::getInnerDetectorID ( size_t  index) const
overridevirtual

For a given event/point in this box, return the detector ID.

Implements Mantid::API::IMDIterator.

◆ getInnerError()

signal_t Mantid::DataObjects::MDBoxIterator::getInnerError ( size_t  index) const
overridevirtual

Returns the error of a given event.

Implements Mantid::API::IMDIterator.

◆ getInnerExpInfoIndex()

uint16_t Mantid::DataObjects::MDBoxIterator::getInnerExpInfoIndex ( size_t  index) const
overridevirtual

For a given event/point in this box, return the associated experiment-info index.

Implements Mantid::API::IMDIterator.

◆ getInnerGoniometerIndex()

uint16_t Mantid::DataObjects::MDBoxIterator::getInnerGoniometerIndex ( size_t  index) const
overridevirtual

For a given event/point in this box, return the goniometer index.

Implements Mantid::API::IMDIterator.

◆ getInnerPosition()

coord_t Mantid::DataObjects::MDBoxIterator::getInnerPosition ( size_t  index,
size_t  dimension 
) const
overridevirtual

Returns the position of a given event for a given dimension.

Implements Mantid::API::IMDIterator.

◆ getInnerSignal()

signal_t Mantid::DataObjects::MDBoxIterator::getInnerSignal ( size_t  index) const
overridevirtual

Returns the signal of a given event.

Implements Mantid::API::IMDIterator.

◆ getIsMasked()

bool Mantid::DataObjects::MDBoxIterator::getIsMasked ( ) const
overridevirtual

Returns true if masking is used.

Implements Mantid::API::IMDIterator.

◆ getLinearIndex()

size_t Mantid::DataObjects::MDBoxIterator::getLinearIndex ( ) const
overridevirtual

Get the linear index.

Implements Mantid::API::IMDIterator.

◆ getNormalizedError()

signal_t Mantid::DataObjects::MDBoxIterator::getNormalizedError ( ) const
overridevirtual

Returns the normalized error for this box.

Implements Mantid::API::IMDIterator.

◆ getNormalizedSignal()

signal_t Mantid::DataObjects::MDBoxIterator::getNormalizedSignal ( ) const
overridevirtual

Returns the normalized signal for this box.

Implements Mantid::API::IMDIterator.

◆ getNumEvents()

size_t Mantid::DataObjects::MDBoxIterator::getNumEvents ( ) const
overridevirtual

Returns the number of events/points contained in this box.

Implements Mantid::API::IMDIterator.

◆ getPosition()

size_t Mantid::DataObjects::MDBoxIterator::getPosition ( ) const
inline

Getter for the position of the iterator.

Definition at line 84 of file MDBoxIterator.h.

◆ getSignal()

signal_t Mantid::DataObjects::MDBoxIterator::getSignal ( ) const
overridevirtual

Returns the total signal for this box.

Implements Mantid::API::IMDIterator.

◆ getVertexesArray() [1/2]

std::unique_ptr< coord_t[]> Mantid::DataObjects::MDBoxIterator::getVertexesArray ( size_t &  numVertices) const
overridevirtual

Return a list of vertexes defining the volume pointed to.

Implements Mantid::API::IMDIterator.

◆ getVertexesArray() [2/2]

std::unique_ptr< coord_t[]> Mantid::DataObjects::MDBoxIterator::getVertexesArray ( size_t &  numVertices,
const size_t  outDimensions,
const bool *  maskDim 
) const
overridevirtual

Return a list of vertexes defining the volume pointed to, enable masking of dimensions.

Implements Mantid::API::IMDIterator.

◆ init()

void Mantid::DataObjects::MDBoxIterator::init ( std::vector< API::IMDNode * > &  boxes,
size_t  begin,
size_t  end 
)

◆ isWithinBounds()

bool Mantid::DataObjects::MDBoxIterator::isWithinBounds ( size_t  index) const
overridevirtual

Is index reachable by the iterator.

Implements Mantid::API::IMDIterator.

◆ jumpTo()

void Mantid::DataObjects::MDBoxIterator::jumpTo ( size_t  index)
overridevirtual

Jump to the index^th cell.

Implements Mantid::API::IMDIterator.

◆ next() [1/2]

bool Mantid::DataObjects::MDBoxIterator::next ( )
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().

◆ next() [2/2]

bool Mantid::DataObjects::MDBoxIterator::next ( size_t  skip)
overridevirtual

Advance, skipping a certain number of cells.

Implements Mantid::API::IMDIterator.

◆ releaseEvents()

void Mantid::DataObjects::MDBoxIterator::releaseEvents ( ) const
private

◆ valid()

bool Mantid::DataObjects::MDBoxIterator::valid ( ) const
overridevirtual

Is the current position of the iterator valid?

Implements Mantid::API::IMDIterator.

Member Data Documentation

◆ m_boxes

std::vector<API::IMDNode *> Mantid::DataObjects::MDBoxIterator::m_boxes
private

Vector of all the boxes that will be iterated.

Definition at line 110 of file MDBoxIterator.h.

◆ m_current

MDBoxBase<MDE, nd>* Mantid::DataObjects::MDBoxIterator::m_current
private

Box currently pointed to.

Definition at line 113 of file MDBoxIterator.h.

◆ m_currentMDBox

MDBox<MDE, nd>* Mantid::DataObjects::MDBoxIterator::m_currentMDBox
mutableprivate

MDBox currently pointed to.

Definition at line 116 of file MDBoxIterator.h.

◆ m_events

const std::vector<MDE>* Mantid::DataObjects::MDBoxIterator::m_events
mutableprivate

Pointer to the const events vector. Only initialized when needed.

Definition at line 119 of file MDBoxIterator.h.

◆ m_max

size_t Mantid::DataObjects::MDBoxIterator::m_max
private

Max pos = length of the boxes vector.

Definition at line 107 of file MDBoxIterator.h.

◆ m_pos

size_t Mantid::DataObjects::MDBoxIterator::m_pos
private

Current position in the vector of boxes.

Definition at line 104 of file MDBoxIterator.h.

◆ m_skippingPolicy

SkippingPolicy_scptr Mantid::DataObjects::MDBoxIterator::m_skippingPolicy
private

Definition at line 122 of file MDBoxIterator.h.


The documentation for this class was generated from the following file: