VGM Version 5.3
Loading...
Searching...
No Matches
VMaterialFactory.h
Go to the documentation of this file.
1// $Id$
2
3// -----------------------------------------------------------------------
4// The BaseVGM 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//
21
22#ifndef BASE_VGM_V_MATERIAL_FACTORY_H
23#define BASE_VGM_V_MATERIAL_FACTORY_H
24
26
27#include <map>
28#include <string>
29
30namespace BaseVGM {
31
33{
34 public:
35 VMaterialFactory(const std::string& name);
36 virtual ~VMaterialFactory();
37
38 //
39 // methods
40 //
41
42 // access
43 //
44 virtual std::string Name() const;
45
46 virtual const VGM::IsotopeStore& Isotopes() const;
47 virtual const VGM::ElementStore& Elements() const;
48 virtual const VGM::MaterialStore& Materials() const;
49 virtual const VGM::MediumStore& Media() const;
50
51 virtual const VGM::IIsotope* Isotope(const std::string& name) const;
52 virtual const VGM::IElement* Element(const std::string& name) const;
53 virtual const VGM::IMaterial* Material(const std::string& name) const;
54 virtual const VGM::IMedium* Medium(const std::string& name) const;
55
56 // import/export
57 //
58 virtual bool Export(VGM::IMaterialFactory* factory) const;
59
60 // listings
61 //
62 virtual void PrintIsotopes() const;
63 virtual void PrintElements() const;
64 virtual void PrintMaterials() const;
65 virtual void PrintMedia() const;
66
67 // debug
68 //
69 virtual void SetDebug(int debug);
70 virtual int Debug() const;
71
72 protected:
75
80
81 private:
82 // types
83 typedef std::map<VGM::IIsotope*, VGM::IIsotope*> IsotopeMap;
84 typedef std::map<VGM::IElement*, VGM::IElement*> ElementMap;
85 typedef std::map<VGM::IMaterial*, VGM::IMaterial*> MaterialMap;
86
87 VGM::IIsotope* ExportIsotope(
88 VGM::IIsotope* isotope, VGM::IMaterialFactory* factory) const;
89 VGM::IElement* ExportElement(VGM::IElement* element,
90 VGM::IMaterialFactory* factory, IsotopeMap* map) const;
91 VGM::IMaterial* ExportMaterial(VGM::IMaterial* material,
92 VGM::IMaterialFactory* factory, ElementMap* map) const;
93 VGM::IMedium* ExportMedium(VGM::IMedium* medium,
94 VGM::IMaterialFactory* factory, MaterialMap* map) const;
95 VGM::IMedium* GenerateMedium(VGM::IMaterial* material, int mediumId,
96 VGM::IMaterialFactory* factory, MaterialMap* map) const;
97
98 IsotopeMap* ExportIsotopes(VGM::IMaterialFactory* factory) const;
99 ElementMap* ExportElements(
100 VGM::IMaterialFactory* factory, IsotopeMap* map) const;
101 MaterialMap* ExportMaterials(
102 VGM::IMaterialFactory* factory, ElementMap* map) const;
103 void ExportMedia(VGM::IMaterialFactory* factory, MaterialMap* map) const;
104 void GenerateMedia(VGM::IMaterialFactory* factory, MaterialMap* map) const;
105
106 // data members
107 int fDebug;
108 std::string fName;
109 VGM::IsotopeStore fIsotopes;
110 VGM::ElementStore fElements;
111 VGM::MaterialStore fMaterials;
112 VGM::MediumStore fMedia;
113};
114
115} // namespace BaseVGM
116
117// inline functions
118
119inline std::string BaseVGM::VMaterialFactory::Name() const { return fName; }
120
122{
123 return fIsotopes;
124}
125
127{
128 return fElements;
129}
130
132{
133 return fMaterials;
134}
135
137{
138 return fMedia;
139}
140
142{
144 return fIsotopes;
145}
146
148{
150 return fElements;
151}
152
154{
156 return fMaterials;
157}
158
160{
162 return fMedia;
163}
164
165inline void BaseVGM::VMaterialFactory::SetDebug(int debug) { fDebug = debug; }
166
167inline int BaseVGM::VMaterialFactory::Debug() const { return fDebug; }
168
169#endif // BASE_VGM_V_FACTORY_H
The abstract base class to material factory.
virtual std::string Name() const
Return the name of this factory.
virtual void SetDebug(int debug)
Set the debug level.
virtual VGM::ElementStore & ElementStore()
virtual const VGM::IMedium * Medium(const std::string &name) const
Return medium specified by name.
virtual VGM::MediumStore & MediumStore()
virtual const VGM::MaterialStore & Materials() const
Return the store of materials.
virtual const VGM::IsotopeStore & Isotopes() const
Return the store of isotopes.
virtual VGM::MaterialStore & MaterialStore()
virtual const VGM::IMaterial * Material(const std::string &name) const
Return material specified by name.
virtual const VGM::IElement * Element(const std::string &name) const
Return element specified by name.
virtual const VGM::MediumStore & Media() const
Return the store of media.
virtual const VGM::IIsotope * Isotope(const std::string &name) const
Return isotope specified by name.
virtual VGM::IsotopeStore & IsotopeStore()
virtual void PrintMaterials() const
Print all materials.
virtual const VGM::ElementStore & Elements() const
Return the store of elements.
virtual int Debug() const
Return the debug level.
virtual bool Export(VGM::IMaterialFactory *factory) const
Export materials to the specified material factory.
virtual void PrintMedia() const
Print all media.
virtual void PrintElements() const
Print all elements.
virtual void PrintIsotopes() const
Print all isotopes.
The VGM interface to elements.
Definition IElement.h:34
The VGM interface to elements.
Definition IIsotope.h:28
The VGM interface to material factory providing functions for material conversions.
The VGM interface to materials.
Definition IMaterial.h:44
The VGM interface to tracking medium.
Definition IMedium.h:31
BaseVGM utilities.
Definition utilities.h:23
std::vector< IMaterial * > MaterialStore
std::vector< IMedium * > MediumStore
std::vector< IIsotope * > IsotopeStore
std::vector< IElement * > ElementStore