17namespace DataObjects {
34 MDBoxIterator(std::vector<API::IMDNode *> &boxes,
size_t begin,
size_t end);
35 void init(std::vector<API::IMDNode *> &boxes,
size_t begin,
size_t end);
50 bool next(
size_t skip)
override;
60 std::unique_ptr<coord_t[]>
getVertexesArray(
size_t &numVertices,
const size_t outDimensions,
61 const bool *maskDim)
const override;
std::map< DeltaEMode::Type, std::string > index
#define TMDE_CLASS
Macro to make declaring template classes faster.
This is an interface to an iterator of an IMDWorkspace.
Templated super-class of a multi-dimensional event "box".
MDBoxIterator: iterate through MDBoxBase hierarchy down to a given maximum depth.
signal_t getInnerError(size_t index) const override
Returns the error of a given event.
bool next() override
Advance to the next cell.
MDBox< MDE, nd > * m_currentMDBox
MDBox currently pointed to.
std::unique_ptr< coord_t[]> getVertexesArray(size_t &numVertices) const override
Return a list of vertexes defining the volume pointed to.
uint16_t getInnerExpInfoIndex(size_t index) const override
For a given event/point in this box, return the associated experiment-info index.
std::vector< size_t > findNeighbourIndexes() const override
Find neighbouring indexes vertex touching.
size_t m_pos
Current position in the vector of boxes.
signal_t getInnerSignal(size_t index) const override
Returns the signal of a given event.
uint16_t getInnerGoniometerIndex(size_t index) const override
For a given event/point in this box, return the goniometer index.
MDBoxIterator(API::IMDNode *topBox, size_t maxDepth, bool leafOnly, Mantid::Geometry::MDImplicitFunction *function=nullptr)
SkippingPolicy_scptr m_skippingPolicy
size_t getPosition() const
Getter for the position of the iterator.
void releaseEvents() const
bool isWithinBounds(size_t index) const override
Is index reachable by the iterator.
std::vector< size_t > findNeighbourIndexesFaceTouching() const override
Find neighbouring indexes face touching.
void jumpTo(size_t index) override
Jump to the index^th cell.
bool next(size_t skip) override
Advance, skipping a certain number of cells.
size_t getLinearIndex() const override
Get the linear index.
coord_t getInnerPosition(size_t index, size_t dimension) const override
Returns the position of a given event for a given dimension.
int32_t getInnerDetectorID(size_t index) const override
For a given event/point in this box, return the detector ID.
bool getIsMasked() const override
Returns true if masking is used.
MDBoxBase< MDE, nd > * m_current
Box currently pointed to.
signal_t getSignal() const override
Returns the total signal for this box.
Mantid::Kernel::VMD getCenter() const override
Returns the position of the center of the box pointed to.
~MDBoxIterator() override
signal_t getError() const override
Returns the total error for this box.
size_t getDataSize() const override
---------— IMDIterator Methods ---------------------------—
signal_t getNormalizedError() const override
Returns the normalized error for this box.
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.
MDBoxBase< MDE, nd > * getBox() const
Return a pointer to the current box pointed to by the iterator.
void commonConstruct(API::IMDNode *topBox, size_t maxDepth, bool leafOnly, Mantid::Geometry::MDImplicitFunction *function)
Common code run my a few of the constructors.
MDBoxIterator(std::vector< API::IMDNode * > &boxes, size_t begin, size_t end)
const std::vector< MDE > * m_events
Pointer to the const events vector. Only initialized when needed.
signal_t getNormalizedSignal() const override
Returns the normalized signal for this box.
bool valid() const override
Is the current position of the iterator valid?
std::vector< API::IMDNode * > m_boxes
Vector of all the boxes that will be iterated.
void init(std::vector< API::IMDNode * > &boxes, size_t begin, size_t end)
MDBoxIterator(API::IMDNode *topBox, size_t maxDepth, bool leafOnly, SkippingPolicy *skippingPolicy, Mantid::Geometry::MDImplicitFunction *function=nullptr)
size_t m_max
Max pos = length of the boxes vector.
size_t getNumEvents() const override
Returns the number of events/points contained in this box.
Templated class for a multi-dimensional event "box".
SkippingPolicy : Policy types for skipping in MDiterators.
An "ImplicitFunction" defining a hyper-cuboid-shaped region in N dimensions.
boost::scoped_ptr< SkippingPolicy > SkippingPolicy_scptr
Helper class which provides the Collimation Length for SANS instruments.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...
double signal_t
Typedef for the signal recorded in a MDBox, etc.