Newer
Older
#ifndef MANTID_API_IMDWORKSPACE_H_
#define MANTID_API_IMDWORKSPACE_H_
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
Alex Buts
committed
#include <stdint.h>
#include "MantidAPI/Workspace.h"
Owen Arnold
committed
#include "MantidGeometry/MDGeometry/IMDDimension.h"
Owen Arnold
committed
#include <boost/shared_ptr.hpp>
#include <vector>
Owen Arnold
committed
#include <stdarg.h>
#include "MantidAPI/MDGeometry.h"
Owen Arnold
committed
Roman Tolchenov
committed
class IMDIterator;
Janik Zikovsky
committed
/** Basic MD Workspace Abstract Class.
*
* This defines the interface that allows one to iterate through several types of workspaces:
*
* - The regularly gridded MDHistoWorkspace
* - The recursively binned MDEventWorkspace
* - The regular (2D) MatrixWorkspace.
Janik Zikovsky
committed
@author Janik Zikovsky
@date 04/10/2010
Copyright © 2007-2010 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
Owen Arnold
committed
class MANTID_API_DLL IMDWorkspace : public Workspace, public Mantid::API::MDGeometry
Owen Arnold
committed
Janik Zikovsky
committed
/// Get the number of points associated with the workspace.
/// For MDEvenWorkspace it is the number of events contributing into the workspace
/// For regularly gridded workspace (MDHistoWorkspace and MatrixWorkspace), it is
/// the number of bins.
Alex Buts
committed
virtual uint64_t getNPoints() const = 0;
Owen Arnold
committed
Roman Tolchenov
committed
/// Creates a new iterator pointing to the first cell in the workspace
virtual IMDIterator* createIterator() const;
Janik Zikovsky
committed
/// Returns the (normalized) signal at a given coordinates
virtual signal_t getSignalAtCoord(const coord_t * coords) const
{
UNUSED_ARG(coords);
throw std::runtime_error("getSignalAtCoord() not implemented.");
}
//-------------------------------------------------------------------------------------------
/// Returns the (normalized) signal at a given coordinates
/// @param coords :: coordinate as a VMD vector
signal_t getSignalAtCoord(const Mantid::Kernel::VMD & coords) const
{
return this->getSignalAtCoord(coords.getBareArray());
}
Owen Arnold
committed
virtual ~IMDWorkspace();
};
/// Shared pointer to the matrix workspace base class
typedef boost::shared_ptr<IMDWorkspace> IMDWorkspace_sptr;
/// Shared pointer to the matrix workspace base class (const version)
typedef boost::shared_ptr<const IMDWorkspace> IMDWorkspace_const_sptr;
}
}
#endif //MANTID_API_IMDWORKSPACE_H_