11#include <boost/algorithm/string.hpp>
12#include <boost/format.hpp>
14#include <Poco/DOM/AutoPtr.h>
15#include <Poco/DOM/DOMWriter.h>
16#include <Poco/DOM/Document.h>
17#include <Poco/DOM/Element.h>
18#include <Poco/DOM/Text.h>
25 bool bSuccess =
false;
26 if (constituentFunction.get() !=
nullptr) {
27 this->
m_Functions.emplace_back(constituentFunction);
38 AutoPtr<Document> pDoc =
new Document;
39 AutoPtr<Element> functionElement = pDoc->createElement(
"Function");
40 pDoc->appendChild(functionElement);
41 AutoPtr<Element> typeElement = pDoc->createElement(
"Type");
42 AutoPtr<Text> typeText = pDoc->createTextNode(this->
getName());
43 typeElement->appendChild(typeText);
44 functionElement->appendChild(typeElement);
45 AutoPtr<Element> parameterListElement = pDoc->createElement(
"ParameterList");
46 functionElement->appendChild(parameterListElement);
48 std::string functionXML =
50 [](
const auto &lhs,
const auto &function) { return lhs + function->toXMLString(); });
51 AutoPtr<Text> functionFormatText = pDoc->createTextNode(
"%s");
52 functionElement->appendChild(functionFormatText);
54 std::stringstream xmlstream;
56 writer.writeNode(xmlstream, pDoc);
58 std::string formattedXMLString = boost::str(boost::format(xmlstream.str().c_str()) % functionXML.c_str());
59 return formattedXMLString;
67 bool evalResult =
false;
68 std::vector<std::shared_ptr<Mantid::Geometry::MDImplicitFunction>>::const_iterator it;
69 for (it = this->
m_Functions.begin(); it != this->m_Functions.end(); ++it) {
70 evalResult = (*it)->isPointContained(coords);
79 bool evalResult =
false;
80 std::vector<std::shared_ptr<Mantid::Geometry::MDImplicitFunction>>::const_iterator it;
81 for (it = this->
m_Functions.begin(); it != this->m_Functions.end(); ++it) {
82 evalResult = (*it)->isPointContained(coords);
bool addFunction(const Mantid::Geometry::MDImplicitFunction_sptr &constituentFunction)
std::string getName() const override
std::vector< Mantid::Geometry::MDImplicitFunction_sptr > m_Functions
bool isPointContained(const coord_t *coords) override
Is a point in MDimensions contained by this ImplicitFunction? If the point is bounded by ALL planes c...
static std::string functionName()
std::string toXMLString() const override
Serialize to XML.
int getNFunctions() const
Return the number of functions in this composite.
std::shared_ptr< MDImplicitFunction > MDImplicitFunction_sptr
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...