VGM Version 5.3
Loading...
Searching...
No Matches
IMaterialFactory.h
Go to the documentation of this file.
1// $Id$
2
3// -----------------------------------------------------------------------
4// The VGM 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 VGM_I_MATERIAL_FACTORY_H
22#define VGM_I_MATERIAL_FACTORY_H
23
26
27#include <vector>
28
29namespace VGM {
30
31class IIsotope;
32class IElement;
33class IMedium;
34
35typedef std::vector<IIsotope*> IsotopeStore;
36typedef std::vector<IElement*> ElementStore;
37typedef std::vector<IMaterial*> MaterialStore;
38typedef std::vector<IMedium*> MediumStore;
39
41{
42 public:
43 virtual ~IMaterialFactory() {}
44
45 //
46 // methods
47 //
56 const std::string& name, int z, int n, double a = 0.) = 0;
57
66 const std::string& name, const std::string& symbol, double z, double a) = 0;
67
77 virtual IElement* CreateElement(const std::string& name,
78 const std::string& symbol, const VGM::IsotopeVector& isotopes,
79 const VGM::RelAbundanceVector& relAbundances) = 0;
80
85 virtual IElement* CreateElement(int z, bool isotopes = true) = 0;
86
95 virtual IMaterial* CreateMaterial(const std::string& name, double density,
96 VGM::IElement* element, double radlen, double intlen) = 0;
97
109 virtual IMaterial* CreateMaterial(const std::string& name, double density,
110 VGM::IElement* element, double radlen, double intlen,
111 VGM::MaterialState state, double temperature, double pressure) = 0;
112
122 virtual IMaterial* CreateMaterial(const std::string& name, double density,
123 const VGM::ElementVector& elements,
124 const VGM::MassFractionVector& fractions) = 0;
125
138 virtual IMaterial* CreateMaterial(const std::string& name, double density,
139 const VGM::ElementVector& elements,
140 const VGM::MassFractionVector& fractions, VGM::MaterialState state,
141 double temperature, double pressure) = 0;
142
152 virtual IMaterial* CreateMaterial(const std::string& name, double density,
153 const VGM::ElementVector& elements,
154 const VGM::AtomCountVector& atomCounts) = 0;
155
168 virtual IMaterial* CreateMaterial(const std::string& name, double density,
169 const VGM::ElementVector& elements, const VGM::AtomCountVector& atomCounts,
170 VGM::MaterialState state, double temperature, double pressure) = 0;
171
180 virtual IMedium* CreateMedium(const std::string& name, int mediumId,
181 VGM::IMaterial* material, int nofParameters, double* parameters) = 0;
182
183 //
184 // access
185 //
188 virtual std::string Name() const = 0;
191 virtual const IsotopeStore& Isotopes() const = 0;
194 virtual const ElementStore& Elements() const = 0;
197 virtual const MaterialStore& Materials() const = 0;
200 virtual const MediumStore& Media() const = 0;
201
204 virtual const IIsotope* Isotope(const std::string& name) const = 0;
207 virtual const IElement* Element(const std::string& name) const = 0;
210 virtual const IMaterial* Material(const std::string& name) const = 0;
213 virtual const IMedium* Medium(const std::string& name) const = 0;
214
215 //
216 // import/export
217 //
220 virtual bool Import() = 0;
223 virtual bool Export(IMaterialFactory* factory) const = 0;
224
225 //
226 // listings
227 //
230 virtual void PrintIsotopes() const = 0;
233 virtual void PrintElements() const = 0;
236 virtual void PrintMaterials() const = 0;
239 virtual void PrintMedia() const = 0;
240
241 //
242 // debug
243 //
246 virtual void SetDebug(int debug) = 0;
249 virtual int Debug() const = 0;
250};
251} // namespace VGM
252
253#endif // VGM_I_MATERIAL_FACTORY_H
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.
virtual IMaterial * CreateMaterial(const std::string &name, double density, const VGM::ElementVector &elements, const VGM::MassFractionVector &fractions)=0
Create a compound material.
virtual const IMaterial * Material(const std::string &name) const =0
Return material specified by name.
virtual const IElement * Element(const std::string &name) const =0
Return element specified by name.
virtual const IsotopeStore & Isotopes() const =0
Return the store of isotopes.
virtual void PrintMedia() const =0
Print all media.
virtual bool Export(IMaterialFactory *factory) const =0
Export materials to the specified material factory.
virtual IElement * CreateElement(const std::string &name, const std::string &symbol, double z, double a)=0
Create a chemical element.
virtual int Debug() const =0
Return the debug level.
virtual IElement * CreateElement(const std::string &name, const std::string &symbol, const VGM::IsotopeVector &isotopes, const VGM::RelAbundanceVector &relAbundances)=0
Create a chemical element.
virtual IElement * CreateElement(int z, bool isotopes=true)=0
Create a chemical element.
virtual const ElementStore & Elements() const =0
Return the store of elements.
virtual const MediumStore & Media() const =0
Return the store of media.
virtual const IMedium * Medium(const std::string &name) const =0
Return medium specified by name.
virtual IMedium * CreateMedium(const std::string &name, int mediumId, VGM::IMaterial *material, int nofParameters, double *parameters)=0
Create a tracking medium.
virtual IMaterial * CreateMaterial(const std::string &name, double density, const VGM::ElementVector &elements, const VGM::AtomCountVector &atomCounts)=0
Create a compound material.
virtual void PrintElements() const =0
Print all elements.
virtual std::string Name() const =0
Return the name of this factory.
virtual IMaterial * CreateMaterial(const std::string &name, double density, VGM::IElement *element, double radlen, double intlen)=0
Create a material.
virtual void PrintMaterials() const =0
Print all materials.
virtual bool Import()=0
Import native materials.
virtual const MaterialStore & Materials() const =0
Return the store of materials.
virtual IMaterial * CreateMaterial(const std::string &name, double density, const VGM::ElementVector &elements, const VGM::AtomCountVector &atomCounts, VGM::MaterialState state, double temperature, double pressure)=0
Create a compound material.
virtual IMaterial * CreateMaterial(const std::string &name, double density, const VGM::ElementVector &elements, const VGM::MassFractionVector &fractions, VGM::MaterialState state, double temperature, double pressure)=0
Create a compound material.
virtual void PrintIsotopes() const =0
Print all isotopes.
virtual const IIsotope * Isotope(const std::string &name) const =0
Return isotope specified by name.
virtual void SetDebug(int debug)=0
Set the debug level.
virtual IIsotope * CreateIsotope(const std::string &name, int z, int n, double a=0.)=0
Create a chemical isotope.
virtual IMaterial * CreateMaterial(const std::string &name, double density, VGM::IElement *element, double radlen, double intlen, VGM::MaterialState state, double temperature, double pressure)=0
Create a compound material.
The VGM interface to materials.
Definition IMaterial.h:44
The VGM interface to tracking medium.
Definition IMedium.h:31
VGM interfaces.
Definition VMedium.h:28
std::vector< IMaterial * > MaterialStore
std::vector< double > RelAbundanceVector
Definition IElement.h:31
std::vector< int > AtomCountVector
Definition IMaterial.h:33
std::vector< double > MassFractionVector
Definition IMaterial.h:32
std::vector< IElement * > ElementVector
Definition IMaterial.h:31
std::vector< IMedium * > MediumStore
std::vector< IIsotope * > IsotopeStore
std::vector< IIsotope * > IsotopeVector
Definition IElement.h:30
MaterialState
Definition IMaterial.h:36
std::vector< IElement * > ElementStore