30 for (
size_t i = 0; i < 3; ++i) {
38 throw std::runtime_error(
"u, v, and w must not be coplanar!");
43 for (
size_t i = 0; i < 3; ++i) {
51 throw std::runtime_error(
"4 columns must be provided to create a projection");
53 const size_t numRows = ws.
rowCount();
55 throw std::runtime_error(
"3 rows must be provided to create a projection");
62 for (
size_t i = 0; i < numRows; i++) {
63 const std::string name = nameCol->cell<std::string>(i);
65 const double offset = offsetCol->cell<
double>(i);
66 const std::string unitStr = unitCol->cell<std::string>(i);
72 }
else if (name ==
"v") {
74 }
else if (name ==
"w") {
77 throw std::runtime_error(
"Invalid dimension name: " + name);
84 }
else if (unitStr ==
"a") {
87 throw std::runtime_error(
"Unknown type: " + unitStr);
99 throw std::invalid_argument(
"given axis out of range");
106 throw std::invalid_argument(
"given axis out of range");
113 throw std::invalid_argument(
"given axis out of range");
120 throw std::invalid_argument(
"given axis out of range");
127 throw std::invalid_argument(
"given axis out of range");
134 throw std::invalid_argument(
"given axis out of range");
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
ITableWorkspace is an implementation of Workspace in which the data are organised in columns of same ...
virtual Column_sptr getColumn(const std::string &name)=0
Gets the shared pointer to a column by name.
virtual size_t columnCount() const =0
Number of columns in the workspace.
virtual size_t rowCount() const =0
Number of rows in the workspace.
double m_offsets[3]
The offsets for each dimension.
Kernel::V3D getAxis(size_t nd)
Retrieves the axis vector for the given dimension.
Projection()
Default constructor builds identity projection.
void setOffset(size_t nd, double offset)
Set the offset for a given dimension.
ProjectionUnit getUnit(size_t nd)
Retrives the unit of the given dimension.
Kernel::V3D m_dimensions[3]
The dimensions.
void setUnit(size_t nd, ProjectionUnit unit)
Set the unit for a given dimension.
ProjectionUnit m_units[3]
The units for each dimension.
void setAxis(size_t nd, const Kernel::V3D &axis)
Set the axis vector for a given dimension.
double getOffset(size_t nd)
Retrieves the offset for the given dimension.
constexpr double scalar_prod(const V3D &v) const noexcept
Calculates the cross product.
constexpr V3D cross_prod(const V3D &v) const noexcept
Cross product (this * argument)
std::shared_ptr< const Column > Column_const_sptr
ProjectionUnit
Represents 3 dimensional projections.