VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
XmlVGM
include
XmlVGM
VExporter.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
//
22
23
#ifndef XML_VGM_V_EXPORTER_H
24
#define XML_VGM_V_EXPORTER_H
25
26
#include "
XmlVGM/Maps.h
"
27
28
#include <fstream>
29
#include <map>
30
#include <set>
31
#include <string>
32
33
namespace
VGM
{
34
class
IElement
;
35
class
IMaterial
;
36
class
ISolid
;
37
class
IFactory
;
38
class
IVolume
;
39
}
// namespace VGM
40
41
namespace
XmlVGM
{
42
43
typedef
std::vector<double>
ThreeVector
;
44
45
class
IWriter
;
46
47
class
VExporter
48
{
49
public
:
50
typedef
std::set<std::string, std::less<std::string> >
StringSet
;
51
52
public
:
53
VExporter
(
const
VGM::IFactory
* factory,
IWriter
* writer);
54
// --> protected
55
// VExporter();
56
// VExporter(const VExporter& right);
57
virtual
~VExporter
();
58
59
// methods
60
void
GenerateXMLGeometry
();
61
void
GenerateXMLGeometry
(
const
std::string& volumeName);
62
63
// set methods
64
void
SetFileName
(
const
std::string& fileName);
65
void
SetDebug
(
int
debug);
66
void
SetNumWidth
(
int
width);
67
void
SetNumPrecision
(
int
precision);
68
69
// get methods
70
std::string
FileName
()
const
;
71
int
Debug
()
const
;
72
73
protected
:
74
VExporter
();
75
VExporter
(
const
VExporter
& right);
76
77
// operators
78
VExporter
&
operator=
(
const
VExporter
&
/*right*/
);
79
80
// abstract methods
81
// specific to XML definition
82
//
85
virtual
void
GenerateGeometry
(
VGM::IVolume
* volume) = 0;
86
87
// methods
88
//
89
void
GeneratePositions
(
VGM::IVolume
* volume);
90
void
GenerateRotations
(
VGM::IVolume
* volume);
91
void
GenerateScale
();
92
void
GenerateMaterials
(
VGM::IVolume
* volume);
93
void
GenerateMedia
(
VGM::IVolume
* volume);
94
void
GenerateSolids
(
VGM::IVolume
* volume);
95
96
void
ClearVolumeNames
();
97
98
// static data members
99
static
const
std::string
fgkUndefinedFileName
;
// default value of file name
100
101
// data members
102
//
103
const
VGM::IFactory
*
fFactory
;
// VGM factory
104
IWriter
*
fWriter
;
// interface to XML writer
105
std::string
fFileName
;
// output file name
106
StringSet
fVolumeNames
;
// set of volume names
107
int
fDebug
;
// debug level
108
Maps
fMaps
;
// maps between XML elements and their names
109
110
private
:
111
// methods
112
//
113
void
ProcessPositions(
VGM::IVolume
* volume);
114
void
ProcessPositionsInBoolean(
VGM::ISolid
* solid);
115
void
ProcessPositionsInTessellated(
VGM::ISolid
* solid);
116
void
ProcessPositionsInMultiUnion(
VGM::ISolid
* solid);
117
118
void
ProcessRotations(
VGM::IVolume
* volume);
119
void
ProcessRotationsInBoolean(
VGM::ISolid
* solid);
120
void
ProcessRotationsInMultiUnion(
VGM::ISolid
* solid);
121
122
void
ProcessMaterials(
VGM::IVolume
* volume);
123
void
ProcessMedia(
VGM::IVolume
* volume);
124
void
ProcessSolids(
VGM::IVolume
* volume);
125
};
126
}
// namespace XmlVGM
127
128
// inline methods
129
130
inline
void
XmlVGM::VExporter::SetFileName
(
const
std::string& fileName)
131
{
132
fFileName
= fileName;
133
}
134
135
inline
void
XmlVGM::VExporter::SetDebug
(
int
debug)
136
{
137
fDebug
= debug;
138
}
139
140
inline
std::string
XmlVGM::VExporter::FileName
()
const
141
{
142
return
fFileName
;
143
}
144
145
inline
int
XmlVGM::VExporter::Debug
()
const
146
{
147
return
fDebug
;
148
}
149
150
#endif
// XML_VGM_V_EXPORTER_H
Maps.h
VGM::IElement
The VGM interface to elements.
Definition
IElement.h:34
VGM::IFactory
The VGM interface to geometry factory providing functions for geometry construction and conversions.
Definition
IFactory.h:50
VGM::IMaterial
The VGM interface to materials.
Definition
IMaterial.h:44
VGM::ISolid
The VGM interface to solids.
Definition
ISolid.h:58
VGM::IVolume
The VGM interface to volumes.
Definition
IVolume.h:32
XmlVGM::IWriter
The interface for the XML writer that writes VGM geometry objects to XML:
Definition
IWriter.h:43
XmlVGM::Maps
Utility class for mapping XML element values to their names within the XML exporter precision.
Definition
Maps.h:42
XmlVGM::VExporter::GenerateXMLGeometry
void GenerateXMLGeometry()
Definition
VExporter.cxx:646
XmlVGM::VExporter::StringSet
std::set< std::string, std::less< std::string > > StringSet
Definition
VExporter.h:50
XmlVGM::VExporter::GenerateMedia
void GenerateMedia(VGM::IVolume *volume)
Definition
VExporter.cxx:591
XmlVGM::VExporter::fDebug
int fDebug
Definition
VExporter.h:107
XmlVGM::VExporter::VExporter
VExporter(const VGM::IFactory *factory, IWriter *writer)
Definition
VExporter.cxx:44
XmlVGM::VExporter::fWriter
IWriter * fWriter
Definition
VExporter.h:104
XmlVGM::VExporter::GeneratePositions
void GeneratePositions(VGM::IVolume *volume)
Definition
VExporter.cxx:507
XmlVGM::VExporter::SetNumPrecision
void SetNumPrecision(int precision)
Definition
VExporter.cxx:690
XmlVGM::VExporter::GenerateMaterials
void GenerateMaterials(VGM::IVolume *volume)
Definition
VExporter.cxx:556
XmlVGM::VExporter::SetNumWidth
void SetNumWidth(int width)
Definition
VExporter.cxx:682
XmlVGM::VExporter::fFactory
const VGM::IFactory * fFactory
Definition
VExporter.h:103
XmlVGM::VExporter::SetFileName
void SetFileName(const std::string &fileName)
Definition
VExporter.h:130
XmlVGM::VExporter::operator=
VExporter & operator=(const VExporter &)
Definition
VExporter.cxx:102
XmlVGM::VExporter::GenerateRotations
void GenerateRotations(VGM::IVolume *volume)
Definition
VExporter.cxx:529
XmlVGM::VExporter::fMaps
Maps fMaps
Definition
VExporter.h:108
XmlVGM::VExporter::SetDebug
void SetDebug(int debug)
Definition
VExporter.h:135
XmlVGM::VExporter::VExporter
VExporter()
Definition
VExporter.cxx:58
XmlVGM::VExporter::GenerateScale
void GenerateScale()
XmlVGM::VExporter::fVolumeNames
StringSet fVolumeNames
Definition
VExporter.h:106
XmlVGM::VExporter::ClearVolumeNames
void ClearVolumeNames()
Definition
VExporter.cxx:634
XmlVGM::VExporter::fFileName
std::string fFileName
Definition
VExporter.h:105
XmlVGM::VExporter::Debug
int Debug() const
Definition
VExporter.h:145
XmlVGM::VExporter::FileName
std::string FileName() const
Definition
VExporter.h:140
XmlVGM::VExporter::GenerateGeometry
virtual void GenerateGeometry(VGM::IVolume *volume)=0
Generate XML geometry file for the geometry tree starting from the specified VGM volume.
XmlVGM::VExporter::GenerateSolids
void GenerateSolids(VGM::IVolume *volume)
Definition
VExporter.cxx:621
XmlVGM::VExporter::fgkUndefinedFileName
static const std::string fgkUndefinedFileName
Definition
VExporter.h:99
XmlVGM::VExporter::~VExporter
virtual ~VExporter()
Definition
VExporter.cxx:91
VGM
VGM interfaces.
Definition
VMedium.h:28
XmlVGM
XmlVGM utilities.
Definition
AGDDExporter.h:31
XmlVGM::ThreeVector
std::vector< double > ThreeVector
Definition
VExporter.h:43
Generated on
for VGM by
1.17.0