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 #
31 ###############################################################################
32 #
33 # egs_rz was developed for the Carleton Laboratory for Radiotherapy Physics.
34 #
35 ###############################################################################
36 */
37 
38 
44 #include <string>
45 #include <algorithm>
46 #include <fstream>
47 #include "../egs_nd_geometry/egs_nd_geometry.h"
48 
49 #ifndef EGS_RZ_
50 #define EGS_RZ_
51 
52 #ifdef WIN32
53 
54  #define EGS_RZ_EXPORT __declspec(dllexport)
55  #define EGS_RZ_LOCAL
56 
57 #else
58 
59  #ifdef HAVE_VISIBILITY
60  #define EGS_RZ_EXPORT __attribute__ ((visibility ("default")))
61  #define EGS_RZ_LOCAL __attribute__ ((visibility ("hidden")))
62  #else
63  #define EGS_RZ_EXPORT
64  #define EGS_RZ_LOCAL
65  #endif
66 
67 #endif
68 
115 class EGS_RZ_EXPORT EGS_RZGeometry: public EGS_NDGeometry {
116 
117 private:
118 
119  vector<EGS_Float> radii;
120  vector<EGS_Float> zbounds;
121  vector<EGS_Float> reg_vol; /* calculated vol of each region */
122  static string RZType;
123 
124 public:
125 
127  enum DIRS {ZDIR, RDIR};
128 
134  EGS_RZGeometry(vector<EGS_BaseGeometry *> geoms,
135  vector<EGS_Float> rads, vector<EGS_Float> zbs, const string &name = "");
136 
137  ~EGS_RZGeometry() {};
138 
140  const string &getType() const {
141  return RZType;
142  };
143 
147  EGS_Float getBound(int idir, int ind);
148 
149 
153  int getNRegDir(int dir);
154 
156  EGS_Float getVolume(int ireg);
157 
158 };
159 
160 
161 #endif
virtual int getNRegDir(int idir)
a subclass of EGS_NDGeometry for conveniently defining an RZ geometry
Definition: egs_rz.h:115
virtual EGS_Float getVolume(int ireg)
Calculates the volume of region ireg.
virtual EGS_Float getBound(int idir, int ind)
Returns region boundaries in direction determined by idir.
const string & getType() const
return RZ geometry type
Definition: egs_rz.h:140
A class modeling a N-dimensional geometry.