VGM Version 5.3
Loading...
Searching...
No Matches
IWriter.h
Go to the documentation of this file.
1// $Id$
2
3// -----------------------------------------------------------------------
4// The XmlVGM package of the Virtual Geometry Model
5// Copyright (C) 2007, Ivana Hrivnacova
6// All rights reserved.
7//
8// For the licensing terms see vgm/LICENSE.
9// Contact: ivana@ipno.in2p3.fr
10// -----------------------------------------------------------------------
11
13//
20
21#ifndef XML_VGM_WRITER_H
22#define XML_VGM_WRITER_H
23
24#include "VGM/common/Axis.h"
26
27#include <string>
28
29namespace VGM {
30class IElement;
31class IMaterial;
32class IIsotope;
33class IElement;
34class IMaterial;
35class IMedium;
36class ISolid;
37class IPlacement;
38} // namespace VGM
39
40namespace XmlVGM {
41
43{
44 public:
45 virtual ~IWriter() {}
46
47 // methods
48
49 // XML elements
50 //
53 virtual void OpenFile(std::string filePath) = 0;
56 virtual void OpenDocument() = 0;
59 virtual void OpenSection(const std::string& topVolume) = 0;
62 virtual void OpenPositions() = 0;
65 virtual void OpenRotations() = 0;
68 virtual void OpenMaterials() = 0;
71 virtual void OpenMedia() = 0;
74 virtual void OpenSolids() = 0;
77 virtual void OpenStructure() = 0;
80 virtual void OpenComposition(
81 const std::string& name, const std::string& materialName) = 0;
82
85 virtual void CloseFile() = 0;
88 virtual void CloseDocument() = 0;
91 virtual void CloseSection(const std::string& topVolume) = 0;
94 virtual void ClosePositions() = 0;
97 virtual void CloseRotations() = 0;
100 virtual void CloseMaterials() = 0;
103 virtual void CloseMedia() = 0;
106 virtual void CloseSolids() = 0;
109 virtual void CloseStructure() = 0;
112 virtual void CloseComposition() = 0;
113
114 // Geometry elements
115 //
118 virtual void WriteIsotope(const VGM::IIsotope* isotope) = 0;
121 virtual void WriteElement(const VGM::IElement* element) = 0;
124 virtual void WriteMaterial(const VGM::IMaterial* material) = 0;
127 virtual void WriteMedium(const VGM::IMedium* medium) = 0;
130 virtual void WriteMedium(const VGM::IMaterial* material) = 0;
133 virtual void WriteSolid(
134 std::string lvName, const VGM::ISolid* solid, std::string mediumName) = 0;
137 virtual void WritePosition(
138 const std::string& name, const VGM::Transform& position) = 0;
141 virtual void WriteRotation(
142 const std::string& name, const VGM::Transform& rotation) = 0;
145 virtual void WriteScale(const std::string& name) = 0;
148 virtual void WritePlacement(const VGM::IPlacement& placement) = 0;
151 virtual void WriteEmptyLine() = 0;
154 virtual void IncreaseIndention() = 0;
157 virtual void DecreaseIndention() = 0;
158
159 // Units
160 //
163 virtual double LengthUnit() const = 0;
166 virtual double AngleUnit() const = 0;
169 virtual double AtomicWeightUnit() const = 0;
172 virtual double MassDensityUnit() const = 0;
173
174 // Set methods
175 //
178 virtual void SetNumWidth(int width) = 0;
181 virtual void SetNumPrecision(int precision) = 0;
182
183 // Get methods
184 //
187 virtual double GetNumWidth() const = 0;
190 virtual double GetNumPrecision() const = 0;
191};
192
193} // namespace XmlVGM
194
195#endif // XML_VGM_WRITER_H
The VGM interface to elements.
Definition IElement.h:34
The VGM interface to elements.
Definition IIsotope.h:28
The VGM interface to materials.
Definition IMaterial.h:44
The VGM interface to tracking medium.
Definition IMedium.h:31
The VGM interface to positions of volumes.
Definition IPlacement.h:44
The VGM interface to solids.
Definition ISolid.h:58
The interface for the XML writer that writes VGM geometry objects to XML:
Definition IWriter.h:43
virtual void WriteEmptyLine()=0
Write empty line.
virtual void WriteIsotope(const VGM::IIsotope *isotope)=0
Write VGM isotope.
virtual double GetNumPrecision() const =0
Return fixed format number precision.
virtual void OpenSolids()=0
Write solids definitions opening.
virtual double MassDensityUnit() const =0
Return the default mass density unit.
virtual void OpenMedia()=0
Write media definitions opening.
virtual void OpenFile(std::string filePath)=0
Open output file.
virtual void WriteElement(const VGM::IElement *element)=0
Write VGM element.
virtual void CloseFile()=0
Close output file.
virtual void CloseMedia()=0
Write media definitions closing.
virtual void CloseSection(const std::string &topVolume)=0
Write the section closing (if present)
virtual void OpenRotations()=0
Write rotations definitions opening.
virtual void OpenComposition(const std::string &name, const std::string &materialName)=0
Write composition definition opening (if present)
virtual void SetNumWidth(int width)=0
Set fixed format number width.
virtual void ClosePositions()=0
Write positions definitions closing.
virtual void WriteSolid(std::string lvName, const VGM::ISolid *solid, std::string mediumName)=0
Write VGM solid.
virtual void OpenPositions()=0
Write positions definitions opening.
virtual void WriteMedium(const VGM::IMaterial *material)=0
Write medium element from material.
virtual void OpenMaterials()=0
Write materials definitions opening.
virtual void WritePlacement(const VGM::IPlacement &placement)=0
Write VGM placement.
virtual void WritePosition(const std::string &name, const VGM::Transform &position)=0
Write position (from VGM transformation)
virtual void SetNumPrecision(int precision)=0
Set fixed format number precision.
virtual void CloseDocument()=0
Write XML document closing.
virtual void CloseStructure()=0
Write structure definition closing (if present)
virtual void WriteRotation(const std::string &name, const VGM::Transform &rotation)=0
Write rotation (from VGM transformation)
virtual void CloseMaterials()=0
Write materials definitions closing.
virtual void DecreaseIndention()=0
Decrease indention.
virtual void CloseRotations()=0
Write rotations definitions closing.
virtual void WriteMaterial(const VGM::IMaterial *material)=0
Write VGM material.
virtual void OpenSection(const std::string &topVolume)=0
Write the section opening (if present)
virtual double AtomicWeightUnit() const =0
Return the default atomic weight unit.
virtual void OpenStructure()=0
Write structure definition opening (if present)
virtual void CloseComposition()=0
Write composition definition closing (if present)
virtual ~IWriter()
Definition IWriter.h:45
virtual double GetNumWidth() const =0
Return fixed format number width.
virtual void OpenDocument()=0
Write XML document opening.
virtual double AngleUnit() const =0
Return the default angle unit.
virtual void CloseSolids()=0
Write materials definitions closing.
virtual void IncreaseIndention()=0
Increase indention.
virtual void WriteScale(const std::string &name)=0
Write scale (from VGM transformation)
virtual double LengthUnit() const =0
Return the default length unit.
virtual void WriteMedium(const VGM::IMedium *medium)=0
Write VGM medium.
VGM interfaces.
Definition VMedium.h:28
std::vector< double > Transform
Definition Transform.h:40
XmlVGM utilities.