19 TiXmlDocument xmlDoc(file);
20 bool success = xmlDoc.LoadFile(TIXML_ENCODING_UTF8);
23 std::cout <<
"reading of document was " << (success ?
"" :
"not ") <<
"successful" << std::endl;
24 std::cout <<
"Content of the Xml file:" << std::endl;
35 std::cerr <<
"Could not load xml file" << std::endl;
45 const char* success = xmlDoc.Parse(fileStream,
nullptr, TIXML_ENCODING_UTF8);
48 std::cout <<
"reading document was " << (success ==
nullptr ?
"" :
"not ") <<
"successful (" << (success ==
nullptr ?
"NULL" : success) <<
")" << std::endl;
49 std::cout <<
"Content of the Xml file:" << std::endl;
52 if (success ==
nullptr || atoi(success) == 0)
60 std::cerr <<
"Could not load xml file" << std::endl;
70 double rnd3,
double rnd4,
double rnd5,
71 double rnd6,
double rnd7,
double rnd8)
74 double currentEnergy = 0;
77 currentEnergy += lightSource->GetEnergy();
78 if (currentEnergy >= rng1)
79 return lightSource->GetNextPhoton(rnd2, rnd3, rnd4, rnd5, rnd6, rnd7, rnd8);
83 return m_LightSources[0]->GetNextPhoton(rnd2, rnd3, rnd4, rnd5, rnd6, rnd7, rnd8);
102 if (lightSource.IsNotNull() && lightSource->IsValid())
120 std::cerr <<
"Creation of a valid Photoacoustic Probe failed." << std::endl;
126 std::cout <<
"Successfully created Photoacoustic Probe." << std::endl;
void InitProbe(TiXmlDocument document)
std::vector< LightSource::Pointer > m_LightSources
LightSource::PhotonInformation GetNextPhoton(double rng1, double rnd2, double rnd3, double rnd4, double rnd5, double rnd6, double rnd7, double rnd8)
const std::string XML_TAG_LIGHT_SOURCE
const std::string XML_TAG_PROBE
Probe(std::string xmlFile, bool verbose)