32 :
CoordTransform(inD, outD), m_dimensionToBinFrom(outD), m_origin(outD), m_scaling(outD) {
33 if (!origin || !scaling || !dimensionToBinFrom)
34 throw std::runtime_error(
"CoordTransformAligned::ctor(): at least one of "
35 "the input arrays is a NULL pointer.");
36 for (
size_t d = 0;
d <
outD;
d++) {
39 throw std::runtime_error(
"CoordTransformAligned::ctor(): invalid entry in "
40 "dimensionToBinFrom[" +
64 std::vector<size_t> dimensionToBinFrom, std::vector<coord_t> origin,
65 std::vector<coord_t> scaling)
66 :
CoordTransform(inD, outD), m_dimensionToBinFrom(
std::move(dimensionToBinFrom)), m_origin(
std::move(origin)),
67 m_scaling(
std::move(scaling)) {
69 throw std::runtime_error(
"CoordTransformAligned::ctor(): at least one of "
70 "the input vectors is the wrong size.");
71 for (
size_t d = 0;
d <
outD;
d++) {
73 throw std::runtime_error(
"CoordTransformAligned::ctor(): invalid entry in "
74 "dimensionToBinFrom[" +
95 for (
size_t out = 0; out <
outD; ++out) {
118 for (
size_t out = 0; out <
outD; ++out) {
139 AutoPtr<Document> pDoc =
new Document;
140 AutoPtr<Element> coordTransformElement = pDoc->createElement(
"CoordTransform");
141 pDoc->appendChild(coordTransformElement);
143 AutoPtr<Element> coordTransformTypeElement = pDoc->createElement(
"Type");
144 coordTransformTypeElement->appendChild(pDoc->createTextNode(
"CoordTransformAffine"));
145 coordTransformElement->appendChild(coordTransformTypeElement);
147 AutoPtr<Element> paramListElement = pDoc->createElement(
"ParameterList");
149 AutoPtr<Text> formatText = pDoc->createTextNode(
"%s%s%s");
150 paramListElement->appendChild(formatText);
152 coordTransformElement->appendChild(paramListElement);
154 std::stringstream xmlstream;
157 writer.writeNode(xmlstream, pDoc);
160 InDimParameter inD_param(
inD);
161 OutDimParameter outD_param(
outD);
163 std::string formattedXMLString = boost::str(boost::format(xmlstream.str().c_str()) % inD_param.toXMLString().c_str() %
164 outD_param.toXMLString().c_str());
165 return formattedXMLString;
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...
std::string to_string(const wide_integer< Bits, Signed > &n)