22#ifndef XML_VGM_AGDD_WRITER_H
23#define XML_VGM_AGDD_WRITER_H
59 AGDDWriter(
const std::string& version =
"Undefined",
60 const std::string& author =
"VGM AGGD Writer",
61 const std::string dtdVersion =
"v7");
68 virtual void OpenFile(std::string filePath);
70 virtual void OpenSection(
const std::string& topVolume);
78 const std::string& name,
const std::string& );
103 std::string lvName,
const VGM::ISolid* solid, std::string mediumName);
146 typedef std::set<std::string, std::less<std::string> > StringSet;
150 std::string ElementSymbol(
const VGM::IElement* element)
const;
151 void RegisterName(
const std::string& name,
bool warning =
true);
152 double Round2(
double number)
const;
157 void WriteBooleanSolid(std::string lvName,
160 void WriteBox(std::string lvName,
double hx,
double hy,
double hz,
161 std::string mediumName);
164 std::string lvName,
const VGM::IBox* box, std::string mediumName);
167 std::string lvName,
const VGM::ICons* cons, std::string mediumName);
170 std::string lvName,
const VGM::IPara* para, std::string mediumName);
173 std::string lvName,
const VGM::IPolycone* polycone, std::string mediumName);
175 void WritePolyhedra(std::string lvName,
const VGM::IPolyhedra* polyhedra,
176 std::string mediumName);
179 std::string lvName,
const VGM::ITrap* trap, std::string mediumName);
182 std::string lvName,
const VGM::ITrd* trd, std::string mediumName);
185 std::string lvName,
const VGM::ITubs* tubs, std::string mediumName);
187 void WriteNotSupportedSolid(std::string name, std::string mediumName);
191 virtual void WritePlacementWithRotation(std::string lvName,
194 virtual void WritePlacementWithRotationAndReflection(std::string lvName,
197 virtual void WriteMultiplePlacement(
const std::string& lvName,
VGM::Axis axis,
198 int nofReplicas,
double width,
double offset);
202 static const int fgkDefaultNumWidth;
203 static const int fgkDefaultNumPrecision;
204 static const std::string
205 fgkCompNameExtension;
206 static const std::string fgkElementNameExtension;
207 static const std::string fgkMaterialNameExtension;
208 static const double fgkCarTolerance;
209 static const double fgkAngTolerance;
213 std::ofstream fOutFile;
214 std::string fVersion;
216 std::string fDtdVersion;
217 const std::string fkBasicIndention;
218 std::string fIndention;
221 StringSet fAGDDNames;
The VGM interface to Boolean solids.
The VGM interface to box solids.
The VGM interface to cons solids.
The VGM interface to elements.
The VGM interface to elements.
The VGM interface to materials.
The VGM interface to tracking medium.
The VGM interface to para solids.
The VGM interface to positions of volumes.
The VGM interface to polycone solids.
The VGM interface to polyhedra solids.
The VGM interface to solids.
The VGM interface to trap solids.
The VGM interface to trd solids.
The VGM interface to tubs solids.
The implementation of the interface for the XML writer that writes VGM geometry objects to XML define...
virtual double LengthUnit() const
Return the default length unit.
virtual void ClosePositions()
Write positions definitions closing.
virtual void CloseMedia()
Write media definitions closing.
virtual void OpenSolids()
Write solids definitions opening.
virtual void WriteMaterial(const VGM::IMaterial *material)
Write VGM material.
virtual void CloseSection(const std::string &)
Write the section closing (if present)
virtual void CloseStructure()
Write structure definition closing (if present)
virtual void WriteMedium(const VGM::IMedium *medium)
Write VGM medium.
virtual double AtomicWeightUnit() const
Return the default atomic weight unit.
virtual void IncreaseIndention()
Increase indention.
virtual double MassDensityUnit() const
Return the default mass density unit.
virtual void OpenMaterials()
Write materials definitions opening.
virtual void OpenStructure()
Write structure definition opening (if present)
virtual void CloseSolids()
Write materials definitions closing.
virtual void CloseRotations()
Write rotations definitions closing.
virtual void CloseFile()
Close output file.
virtual void WriteSolid(std::string lvName, const VGM::ISolid *solid, std::string mediumName)
Write VGM solid.
virtual void WritePosition(const std::string &, const VGM::Transform &)
Write position (from VGM transformation)
virtual void CloseDocument()
Write XML document closing.
virtual void SetNumPrecision(int precision)
Set fixed format number precision.
virtual void WriteElement(const VGM::IElement *element)
Write VGM element.
virtual void DecreaseIndention()
Decrease indention.
virtual void WriteEmptyLine()
Write empty line.
virtual void WriteScale(const std::string &)
Write scale (from VGM transformation)
virtual void OpenMedia()
Write media definitions opening.
void WritePlacement(const std::string &lvName, const VGM::ThreeVector &position)
virtual double AngleUnit() const
Return the default angle unit.
virtual double GetNumPrecision() const
Return fixed format number precision.
virtual void CloseComposition()
Write composition definition closing (if present)
AGDDWriter(const std::string &version="Undefined", const std::string &author="VGM AGGD Writer", const std::string dtdVersion="v7")
virtual void CloseMaterials()
Write materials definitions closing.
virtual void OpenDocument()
Write XML document opening.
virtual double GetNumWidth() const
Return fixed format number width.
virtual void WriteRotation(const std::string &, const VGM::Transform &)
Write rotation (from VGM transformation)
virtual void SetNumWidth(int width)
Set fixed format number width.
virtual void OpenSection(const std::string &topVolume)
Write the section opening (if present)
virtual void OpenPositions()
Write positions definitions opening.
virtual void WriteIsotope(const VGM::IIsotope *isotope)
Write VGM isotope.
virtual void OpenComposition(const std::string &name, const std::string &)
Write composition definition opening (if present)
virtual void OpenFile(std::string filePath)
Open output file.
virtual void OpenRotations()
Write rotations definitions opening.
The interface for the XML writer that writes VGM geometry objects to XML:
std::vector< double > Transform
std::vector< double > ThreeVector