Mantid
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
Mantid::Kernel::MaterialXMLParser Class Reference

Read an XML definition of a Material and produce a new Material object. More...

#include <MaterialXMLParser.h>

Public Member Functions

Material parse (Poco::XML::Element *node, const std::string &XMLFilePath="") const
 Takes a pointer to an XML node that is assumed to point at a "material" tag. More...
 
Material parse (std::istream &istr) const
 Takes a stream that is assumed to contain a single complete material definition, reads the definition and produces a new Material object. More...
 

Static Public Attributes

static constexpr const char * MATERIAL_TAG = "material"
 

Detailed Description

Read an XML definition of a Material and produce a new Material object.

Definition at line 25 of file MaterialXMLParser.h.

Member Function Documentation

◆ parse() [1/2]

Material Mantid::Kernel::MaterialXMLParser::parse ( Poco::XML::Element *  element,
const std::string &  XMLFilePath = "" 
) const

Takes a pointer to an XML node that is assumed to point at a "material" tag.

It reads the definition and produces a new Material object.

Parameters
elementA pointer to an Element node that is a "material" tag
XMLFilePathpath of the sample environment file where the material specification was read from (if any)
Returns
A new Material object

Definition at line 194 of file MaterialXMLParser.cpp.

References Mantid::Kernel::MaterialBuilder::build(), Mantid::Kernel::MaterialBuilder::setAttenuationSearchPath(), and Mantid::Kernel::MaterialBuilder::setName().

◆ parse() [2/2]

Material Mantid::Kernel::MaterialXMLParser::parse ( std::istream &  istr) const

Takes a stream that is assumed to contain a single complete material definition, reads the definition and produces a new Material object.

If many definitions are present then the first one is read

Parameters
istrA reference to a stream
Returns
A new Material object

Definition at line 147 of file MaterialXMLParser.cpp.

References MATERIAL_TAG, and parse().

Referenced by Mantid::DataHandling::Mantid3MFFileIO::loadMeshObject(), parse(), and Mantid::DataHandling::SampleEnvironmentSpecParser::parseMaterials().

Member Data Documentation

◆ MATERIAL_TAG

constexpr const char* Mantid::Kernel::MaterialXMLParser::MATERIAL_TAG = "material"
staticconstexpr

Definition at line 27 of file MaterialXMLParser.h.

Referenced by parse().


The documentation for this class was generated from the following files: