23 #define numXMLRootElements 3
25 #define XML_SCENE_R0 0
26 #define XML_SCENE_NS 1
27 #define XML_SCENE_NCELLS 2
28 #define XML_SCENE_LIGHTSOURCES 3
29 #define XML_SCENE_OBJECTS 4
30 #define XML_SCENE_DETECTORS 5
32 #define numXML_LS_TYPES 4
33 #define XML_LS_TYPE_PLANE 0
34 #define XML_LS_TYPE_GAUSS 1
35 #define XML_LS_TYPE_PLANE_MC 2
36 #define XML_LS_TYPE_GAUSS_MC 3
41 const std::string
sceneXMLElements[] = {
"r0",
"ns",
"CellsPerDir",
"lightsources",
"objects",
"detectors"};
42 const std::string
LSXMLAttributes[] = {
"type",
"size",
"wavelength",
"numrays",
"numraysRT"};
43 const std::string
LSXMLTYPES[] = {
"plane",
"gaussian",
"plane_mc",
"gaussian_mc"};
44 const std::string
LSTYPES[] = {
"plane",
"gaussian",
"ring",
"tophat",
"line",
"point",
"plane_mc",
"gaussian_mc",
"ring_mc",
"line_mc",
"point_mc" };
95 void readXML(std::string fname,
bool calc_enabled=
true, std::string
path =
"");
160 std::vector<GOAT::raytracing::ObjectShape*>
Obj;
161 std::vector<GOAT::raytracing::Detector*>
Det;
162 std::vector< GOAT::raytracing::LightSrc*>
LS;
181 std::ostringstream oss;
182 oss.imbue(std::locale::classic());
183 oss << std::fixed << std::setprecision(precision) << val;
This class provides functionality to read a XML-file This function reads the XML file ....
int numObj
number of objects
tinyxml2::XMLNode * rootElement
pointer to root element of the XML
void readLightSources()
(used in readScene) read the light sources from the file
GOAT::maths::Vector< std::complex< double > > readCmplxVector(tinyxml2::XMLElement *ell, int &xmlError)
read double vector from file This method reads a complex valued 3D-Vector from the XML-file represent...
void doCalculations()
(used in readScene) read and execute the commands for calculation
void setEnableCalculation(bool enable)
bool isCalculationEnabled()
std::complex< double > readCmplx(tinyxml2::XMLElement *ell, int &xmlError)
read complex value from file This method reads a complex value from file with given default values fo...
std::vector< GOAT::raytracing::Detector * > Det
vector, which carries all detectors (as pointers)
std::vector< GOAT::raytracing::ObjectShape * > Obj
vector, which carries all objects (as pointers)
std::vector< GOAT::raytracing::LightSrc * > LS
vector, which carries all light sources (as pointers)
void doPulseCalculation(tinyxml2::XMLElement *objEll)
(used in doCalculations) to pulsed Calculation (rt + integral)
void readObjects()
(used in readScene) read the objects from the file
tinyxml2::XMLElement * calculationElement
pointer to the calculation elemeent of the XML
std::string path
path of the XML-File
void readScene()
read the entire Scene
void readDetectors()
(used in readScene) read the detectors from the file (deprecated ?)
GOAT::raytracing::Scene S
The scene that was read from the file is saved here.
void readCommands()
(used in readXML) read and execute the commands for calculation
int numDet
number of detectors
GOAT::maths::Vector< double > readVector(tinyxml2::XMLElement *ell, double x=0, double y=0, double z=0)
read double vector from file This method reads a 3D-Vector from the XML-file represented by the corre...
int numLS
number of light sources
std::complex< double > readCmplx(tinyxml2::XMLElement *ell, double defre=0.0, double defim=0.0)
read complex value from file This method reads a complex value from file with given default values fo...
void readXML(std::string fname, bool calc_enabled=true, std::string path="")
read the XML-file This methode reads the XML-file
tinyxml2::XMLElement * sceneElement
pointer to the scene element of the XML
GOAT::maths::Vector< double > readVector(tinyxml2::XMLElement *ell, int &xmlError)
read double vector from file This method reads a 3D-Vector from the XML-file represented by the corre...
void doPulseCalculation_rt(tinyxml2::XMLElement *objEll)
do pulse Calculation with raytracing only
void writeLightSrc(int i)
write the i-th light source to the file
tinyxml2::XMLElement * root
root XML Element
tinyxml2::XMLElement * writeVectorC(std::string name, maths::Vector< std::complex< double > > v)
write complex vector to file This method writes a complex 3D vector to XML-file
tinyxml2::XMLElement * writeVectorD(std::string name, maths::Vector< double > v)
write double vector to file This method writes a double 3D vector to XML-file
void writeObject(int i)
write the i-th object to the file
tinyxml2::XMLElement * objects
XML Element to the Objects section.
void write(std::string fname)
xmlWriter(const GOAT::raytracing::Scene &S)
void writeDetector(int i)
write the i-th detector to the file
const GOAT::raytracing::Scene & S
the scene
tinyxml2::XMLElement * detectors
XML Element to the Detectors section.
tinyxml2::XMLElement * lightSrcs
XML Element to the LightSources section.
tinyxml2::XMLElement * writeComplex(std::string name, std::complex< double > z)
write complex number to file This method writes a complex number to the XML-file
tinyxml2::XMLDocument doc
the xml document
std::string formatDouble(double val, int precision=17)
tinyxml2::XMLElement * scene
XML Element to the Scene section.
Template class for threedimensional vectors.
Class defining a scene with lightsources and objects. This is a container used to inform the Raytrace...
const std::string LSTYPES[]
bool findExtension(std::string fname, std::string extension)
check if the fname has a given extension This function checks if the fname ends with a given extensio...
const std::string LSXMLAttributes[]
const std::string LSXMLTYPES[]
const std::string sceneXMLElements[]
This class is used for the iray class. This class is intended for internal use only....