fisx
fisx_material.h
1 #/*##########################################################################
2 #
3 # The fisx library for X-Ray Fluorescence
4 #
5 # Copyright (c) 2014-2016 European Synchrotron Radiation Facility
6 #
7 # This file is part of the fisx X-ray developed by V.A. Sole
8 #
9 # Permission is hereby granted, free of charge, to any person obtaining a copy
10 # of this software and associated documentation files (the "Software"), to deal
11 # in the Software without restriction, including without limitation the rights
12 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 # copies of the Software, and to permit persons to whom the Software is
14 # furnished to do so, subject to the following conditions:
15 #
16 # The above copyright notice and this permission notice shall be included in
17 # all copies or substantial portions of the Software.
18 #
19 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 # THE SOFTWARE.
26 #
27 #############################################################################*/
28 #ifndef FISX_MATERIAL_H
29 #define FISX_MATERIAL_H
30 #include <string>
31 #include <vector>
32 #include <map>
33 
34 namespace fisx
35 {
36 
45 class Material
46 {
47 public:
51  Material();
52 
56  Material(const std::string & materialName, const double & density = 1.0, \
57  const double & thickness = 1.0, const std::string & comment = "");
58 
59  void setName(const std::string & name);
60  void initialize(const std::string & materialName, const double & density = 1.0,\
61  const double & thickness = 1.0, const std::string & comment="");
62 
67  void setComposition(const std::map<std::string, double> &);
68 
73  void setComposition(const std::vector<std::string> &, const std::vector<double> &);
74 
78  std::map<std::string, double> getComposition() const;
79  std::string getName() const;
80  std::string getComment() const;
81  double getDefaultDensity(){return this->defaultDensity;};
82  double getDefaultThickness(){return this->defaultThickness;};
83 
84 private:
85  std::string name;
86  bool initialized;
87  std::map<std::string, double> composition;
88  double defaultDensity;
89  double defaultThickness;
90  std::string comment;
91 };
92 
93 } // namespace fisx
94 
95 #endif //FISX_MATERIAL_H
void setComposition(const std::map< std::string, double > &)
Definition: fisx_material.cpp:95
Material()
Definition: fisx_material.cpp:35
Class containing the composition of a material.
Definition: fisx_material.h:45
Definition: fisx_element.cpp:34
std::map< std::string, double > getComposition() const
Definition: fisx_material.cpp:148