13#include <Poco/DOM/Element.h>
14#include <Poco/DOM/NodeList.h>
30 if (
"CoordTransform" != coordTransElement->localName()) {
31 std::string message =
"This is not a coordinate transform element: " + coordTransElement->localName();
32 throw std::invalid_argument(message);
34 if (
"CoordTransformAffine" != coordTransElement->getChildElement(
"Type")->innerText()) {
37 throw std::runtime_error(
"CoordTransformAffineParser has no successor parser.");
39 return m_successor->createTransform(coordTransElement);
42 Element *paramListElement = coordTransElement->getChildElement(
"ParameterList");
43 Poco::AutoPtr<Poco::XML::NodeList> parameters = paramListElement->getElementsByTagName(
"Parameter");
46 InDimParameterParser inDimParser;
47 auto *parameter =
dynamic_cast<Poco::XML::Element *
>(parameters->item(0));
48 std::shared_ptr<Mantid::API::InDimParameter> inDim(inDimParser.createWithoutDelegation(parameter));
51 OutDimParameterParser outDimParser;
52 parameter =
dynamic_cast<Poco::XML::Element *
>(parameters->item(1));
53 std::shared_ptr<Mantid::API::OutDimParameter> outDim(outDimParser.createWithoutDelegation(parameter));
57 parameter =
dynamic_cast<Poco::XML::Element *
>(parameters->item(2));
58 std::shared_ptr<AffineMatrixParameter> affineMatrix(affineMatrixDimParser.
createParameter(parameter));
62 transform->setMatrix(affineMatrix->getAffineMatrix());
XML Parser for single value parameter types.
Parser for a parameter of type affinematrixparameter.
AffineMatrixParameter * createParameter(Poco::XML::Element *parameterElement) override
Creates the parameter by reading the xml given.