EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
egs_rz.h
Go to the documentation of this file.
1 /*
2 ###############################################################################
3 #
4 # EGSnrc egs++ rz geometry headers
5 # Copyright (C) 2016 Randle E. P. Taylor, Rowan M. Thomson,
6 # Marc J. P. Chamberland, Dave W. O. Rogers
7 #
8 # This file is part of EGSnrc.
9 #
10 # EGSnrc is free software: you can redistribute it and/or modify it under
11 # the terms of the GNU Affero General Public License as published by the
12 # Free Software Foundation, either version 3 of the License, or (at your
13 # option) any later version.
14 #
15 # EGSnrc is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 # FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
18 # more details.
19 #
20 # You should have received a copy of the GNU Affero General Public License
21 # along with EGSnrc. If not, see <http://www.gnu.org/licenses/>.
22 #
23 ###############################################################################
24 #
25 # Author: Randle Taylor, 2016
26 #
27 # Contributors: Marc Chamberland
28 # Rowan Thomson
29 # Dave Rogers
30 # Martin Martinov
31 #
32 ###############################################################################
33 #
34 # egs_rz was developed for the Carleton Laboratory for Radiotherapy Physics.
35 #
36 ###############################################################################
37 */
38 
39 
45 #include <string>
46 #include <algorithm>
47 #include <fstream>
48 #include "../egs_nd_geometry/egs_nd_geometry.h"
49 
50 #ifndef EGS_RZ_
51 #define EGS_RZ_
52 
53 #ifdef WIN32
54 
55  #define EGS_RZ_EXPORT __declspec(dllexport)
56  #define EGS_RZ_LOCAL
57 
58 #else
59 
60  #ifdef HAVE_VISIBILITY
61  #define EGS_RZ_EXPORT __attribute__ ((visibility ("default")))
62  #define EGS_RZ_LOCAL __attribute__ ((visibility ("hidden")))
63  #else
64  #define EGS_RZ_EXPORT
65  #define EGS_RZ_LOCAL
66  #endif
67 
68 #endif
69 
116 class EGS_RZ_EXPORT EGS_RZGeometry: public EGS_NDGeometry {
117 
118 private:
119 
120  vector<EGS_Float> radii;
121  vector<EGS_Float> zbounds;
122  vector<EGS_Float> reg_vol; /* calculated vol of each region */
123  static string RZType;
124 
125 public:
126 
128  enum DIRS {ZDIR, RDIR};
129 
135  EGS_RZGeometry(vector<EGS_BaseGeometry *> geoms,
136  vector<EGS_Float> rads, vector<EGS_Float> zbs, const string &name = "");
137 
138  ~EGS_RZGeometry() {};
139 
141  const string &getType() const {
142  return RZType;
143  };
144 
148  EGS_Float getBound(int idir, int ind);
149 
150 
154  int getNRegDir(int dir);
155 
157  EGS_Float getVolume(int ireg);
158 
159 };
160 
161 
162 #endif
virtual EGS_Float getVolume(int ireg)
Calculates the volume of region ireg.
virtual int getNRegDir(int idir)
virtual EGS_Float getBound(int idir, int ind)
Returns region boundaries in direction determined by idir.
A class modeling a N-dimensional geometry.
a subclass of EGS_NDGeometry for conveniently defining an RZ geometry
Definition: egs_rz.h:116
const string & getType() const
return RZ geometry type
Definition: egs_rz.h:141