gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
SpectrumRecord.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (c) 2017, Dr Franck P. Vidal (franck.p.vidal@fpvidal.net),
4 http://www.fpvidal.net/
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without modification,
8 are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11 this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14 this list of conditions and the following disclaimer in the documentation and/or
15 other materials provided with the distribution.
16 
17 3. Neither the name of the Bangor University nor the names of its contributors
18 may be used to endorse or promote products derived from this software without
19 specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 
32 */
33 
34 
35 #ifndef __SpectrumRecord_h
36 #define __SpectrumRecord_h
37 
38 
68 //******************************************************************************
69 // Include
70 //******************************************************************************
71 #ifndef GVXR_CONFIG_H
73 #endif
74 
75 #include <iostream>
76 
77 #ifndef GVXR_TYPES_H
78 #include "gVirtualXRay/Types.h"
79 #endif
80 
81 
82 //******************************************************************************
83 // namespace
84 //******************************************************************************
85 namespace gVirtualXRay {
86 
87 
88 //******************************************************************************
89 // Class declaration
90 //******************************************************************************
91 class SpectrumRecord;
92 
93 
94 //******************************************************************************
95 // Function declaration
96 //******************************************************************************
97 //------------------------------------------------------------------------------
99 
104 //------------------------------------------------------------------------------
105 std::istream& operator>>(std::istream& is, SpectrumRecord& obj);
106 
107 
108 //------------------------------------------------------------------------------
110 
115 //------------------------------------------------------------------------------
116 std::ostream& operator<<(std::ostream& os, const SpectrumRecord& obj);
117 
118 
119 //==============================================================================
126 //==============================================================================
128 //------------------------------------------------------------------------------
129 {
130 //******************************************************************************
131 public:
132  //--------------------------------------------------------------------------
134 
138  //--------------------------------------------------------------------------
139  SpectrumRecord(const RATIONAL_NUMBER& aPhotonNumber = 0,
140  const RATIONAL_NUMBER& anIncidentEnergy = 0);
141 
142 
143  //--------------------------------------------------------------------------
145 
148  //--------------------------------------------------------------------------
150 
151 
152  //--------------------------------------------------------------------------
154 
157  //--------------------------------------------------------------------------
159 
160 
161  //--------------------------------------------------------------------------
163 
166  //--------------------------------------------------------------------------
167  bool operator<(const SpectrumRecord& aRecord) const;
168 
169 
170 //******************************************************************************
171 protected:
174 
175 
178 
179 
180  //**************************************************************************
181  // Friend class
182  //**************************************************************************
183  friend class XRayBeam;
184 
185 
186  //**************************************************************************
187  // Friend operators
188  //**************************************************************************
189  friend std::istream& operator>>(std::istream& is, SpectrumRecord& obj);
190  friend std::ostream& operator<<(std::ostream& os, const SpectrumRecord& obj);
191 };
192 
193 
194 } // namespace gVirtualXRay
195 
196 
197 //******************************************************************************
198 #include "SpectrumRecord.inl"
199 
200 
201 #endif // __SpectrumRecord_h
XRayBeam is a class to handle the X-Ray beam. The beam spectrum is discretised into energy channels...
Definition: XRayBeam.h:108
RATIONAL_NUMBER getPhotonEnergy() const
Accessor on the energy of photons.
Type declarations.
SpectrumRecord is a class to handle a record of the X-Ray beam, i.e. an energy bin (number of photons...
friend std::ostream & operator<<(std::ostream &os, const SpectrumRecord &obj)
operator<<
RATIONAL_NUMBER m_energy
The energy of the photons.
RATIONAL_NUMBER m_photon_number
The number of photons.
std::istream & operator>>(std::istream &anInputSream, gVirtualXRay::AtomicElement &anElement)
operator >>
bool operator<(const SpectrumRecord &aRecord) const
operator<.
float RATIONAL_NUMBER
Type of data used to store real numbers.
Definition: Types.h:107
friend std::istream & operator>>(std::istream &is, SpectrumRecord &obj)
operator>>
std::ostream & operator<<(std::ostream &anOutputSream, const gVirtualXRay::AtomicElement &anElement)
operator <<
RATIONAL_NUMBER getPhotonNumber() const
Accessor on the number of photons in the bin.
SpectrumRecord(const RATIONAL_NUMBER &aPhotonNumber=0, const RATIONAL_NUMBER &anIncidentEnergy=0)
Default constructor.
Class to manage a record of the X-Ray beam, i.e. an energy bin (number of photons, energy of the photons in the bin).