21#ifndef XML_VGM_GDML_WRITER_H
22#define XML_VGM_GDML_WRITER_H
48class ITessellatedSolid;
67 const std::string& unitName =
"unit1",
const std::string& version =
"1.0");
74 virtual void OpenFile(std::string filePath);
76 virtual void OpenSection(
const std::string& topVolume);
84 const std::string& name,
const std::string& materialName);
109 std::string lvName,
const VGM::ISolid* solid, std::string );
117 virtual void WriteScale(
const std::string& name);
153 typedef std::set<std::string, std::less<std::string> > StringSet;
157 double UpdateAngle(
double angle)
const;
158 void RegisterName(
const std::string& name,
bool warning =
true);
163 void WriteBox(std::string lvName,
double hx,
double hy,
double hz);
164 void WriteArb8(std::string name,
const VGM::IArb8* arb8);
165 void WriteBox(std::string name,
const VGM::IBox* box);
166 void WriteCons(std::string name,
const VGM::ICons* cons);
167 void WriteCtubs(std::string name,
const VGM::ICtubs* ctubs);
168 void WriteEllipsoid(std::string name,
const VGM::IEllipsoid* ellipsoid);
170 void WriteExtrudedSolid(
172 void WriteHype(std::string name,
const VGM::IHype* hype);
174 void WritePara(std::string name,
const VGM::IPara* para);
176 void WritePolycone(std::string name,
const VGM::IPolycone* polycone);
177 void WritePolyhedra(std::string name,
const VGM::IPolyhedra* polyhedra);
178 void WriteSphere(std::string name,
const VGM::ISphere* sphere);
179 void WriteTessellatedSolid(
181 void WriteTorus(std::string name,
const VGM::ITorus* torus);
182 void WriteTrap(std::string name,
const VGM::ITrap* trap);
183 void WriteTrd(std::string name,
const VGM::ITrd* trd);
184 void WriteTubs(std::string name,
const VGM::ITubs* tubs);
185 void WriteNotSupportedSolid(std::string name);
189 virtual void WriteSimplePlacement(
const std::string& lvName,
190 const std::string& positionRef,
const std::string& rotationRef,
193 virtual void WriteMultiplePlacement(
const std::string& lvName,
VGM::Axis axis,
194 int nofReplicas,
double width,
double offset);
198 static const int fgkDefaultNumWidth;
199 static const int fgkDefaultNumPrecision;
200 static const std::string fgkSolidNameExtension;
201 static const std::string fgkIsotopeNameExtension;
202 static const std::string fgkElementNameExtension;
203 static const char fgkCharReplacement;
204 static const std::string fgkNotAllowedChars;
205 static const std::string fgkNotAllowedChars1;
207 static const double fgkSTPTemperature;
208 static const double fgkSTPPressure;
209 static const double fgkCarTolerance;
210 static const double fgkAngTolerance;
214 std::ofstream fOutFile;
215 std::string fUnitName;
216 std::string fVersion;
217 const std::string fkBasicIndention;
218 std::string fIndention;
221 StringSet fGDMLNames;
249 return 1. / 101325.0;
The VGM interface to Arb8 solids.
The VGM interface to Boolean solids.
The VGM interface to box solids.
The VGM interface to cons solids.
The VGM interface to cut tubs solids.
The VGM interface to elements.
The VGM interface to ellipsoid solids.
The VGM interface to elliptical tube solids.
The VGM interface to extruded solids.
The VGM interface to hyperboloid solids.
The VGM interface to elements.
The VGM interface to materials.
The VGM interface to tracking medium.
The VGM interface to Boolean solids.
The VGM interface to para solids.
The VGM interface to paraboloid 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 sphere solids.
The VGM interface to extruded solids.
The VGM interface to torus 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 void CloseMaterials()
Write materials definitions closing.
virtual double MassDensityUnit() const
Return the default mass density unit.
virtual void WriteRotation(const std::string &name, const VGM::Transform &transform)
Write rotation (from VGM transformation)
virtual void CloseStructure()
Write structure definition closing (if present)
virtual void SetNumWidth(int width)
Set fixed format number width.
virtual void OpenSolids()
Write solids definitions opening.
virtual void OpenPositions()
Write positions definitions opening.
virtual double GetNumPrecision() const
Return fixed format number precision.
virtual void WriteEmptyLine()
Write empty line.
virtual void CloseSolids()
Write materials definitions closing.
virtual void CloseFile()
Close output file.
virtual double LengthUnit() const
Return the default length unit.
virtual void OpenStructure()
Write structure definition opening (if present)
virtual void SetNumPrecision(int precision)
Set fixed format number precision.
GDMLWriter(const std::string &unitName="unit1", const std::string &version="1.0")
virtual void CloseMedia()
Write media definitions closing.
virtual double GetNumWidth() const
Return fixed format number width.
virtual void SetMaps(Maps *maps)
virtual void WriteMaterial(const VGM::IMaterial *material)
Write VGM material.
virtual double TemperatureUnit() const
virtual void WritePosition(const std::string &name, const VGM::Transform &transform)
Write position (from VGM transformation)
virtual void OpenMaterials()
Write materials definitions opening.
virtual double PressureUnit() const
virtual void OpenComposition(const std::string &name, const std::string &materialName)
Write composition definition opening (if present)
virtual void IncreaseIndention()
Increase indention.
virtual void OpenRotations()
Write rotations definitions opening.
virtual void WritePlacement(const VGM::IPlacement &placement)
Write VGM placement.
virtual void OpenMedia()
Write media definitions opening.
virtual void WriteMedium(const VGM::IMaterial *)
Write medium element from material.
virtual void DecreaseIndention()
Decrease indention.
virtual void WriteMedium(const VGM::IMedium *)
Write VGM medium.
virtual void CloseComposition()
Write composition definition closing (if present)
virtual double AtomicWeightUnit() const
Return the default atomic weight unit.
virtual void OpenSection(const std::string &topVolume)
Write the section opening (if present)
virtual void ClosePositions()
Write positions definitions closing.
virtual void OpenFile(std::string filePath)
Open output file.
virtual void WriteSolid(std::string lvName, const VGM::ISolid *solid, std::string)
Write VGM solid.
virtual void WriteScale(const std::string &name)
Write scale (from VGM transformation)
virtual void CloseDocument()
Write XML document closing.
virtual void OpenDocument()
Write XML document opening.
virtual void WriteElement(const VGM::IElement *element)
Write VGM element.
virtual double AngleUnit() const
Return the default angle unit.
virtual void CloseSection(const std::string &topVolume)
Write the section closing (if present)
virtual void CloseRotations()
Write rotations definitions closing.
virtual void WriteIsotope(const VGM::IIsotope *isotope)
Write VGM isotope.
The interface for the XML writer that writes VGM geometry objects to XML:
Utility class for mapping XML element values to their names within the XML exporter precision.
std::vector< double > Transform