EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
egs_space.cpp
Go to the documentation of this file.
1 /*
2 ###############################################################################
3 #
4 # EGSnrc egs++ space geometry
5 # Copyright (C) 2015 National Research Council Canada
6 #
7 # This file is part of EGSnrc.
8 #
9 # EGSnrc is free software: you can redistribute it and/or modify it under
10 # the terms of the GNU Affero General Public License as published by the
11 # Free Software Foundation, either version 3 of the License, or (at your
12 # option) any later version.
13 #
14 # EGSnrc is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 # FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
17 # more details.
18 #
19 # You should have received a copy of the GNU Affero General Public License
20 # along with EGSnrc. If not, see <http://www.gnu.org/licenses/>.
21 #
22 ###############################################################################
23 #
24 # Author: Iwan Kawrakow, 2005
25 #
26 # Contributors: Frederic Tessier
27 # Marc Chamberland
28 # Hannah Gallop
29 #
30 ###############################################################################
31 */
32 
33 
39 #include "egs_space.h"
40 #include "egs_input.h"
41 
42 string EGS_Space::type = "EGS_Space";
43 
44 static bool EGS_SPACE_LOCAL inputSet = false;
45 
46 extern "C" {
47 
48  static void setInputs() {
49  inputSet = true;
50 
51  setBaseGeometryInputs();
52 
53  geomBlockInput->getSingleInput("library")->setValues({"egs_space"});
54  }
55 
56  EGS_SPACE_EXPORT shared_ptr<EGS_BlockInput> getInputs() {
57  if (!inputSet) {
58  setInputs();
59  }
60  return geomBlockInput;
61  }
62 
63  EGS_SPACE_EXPORT EGS_BaseGeometry *createGeometry(EGS_Input *input) {
64  EGS_Space *g = new EGS_Space("");
65  g->setName(input);
66  g->setBoundaryTolerance(input);
67  g->setMedia(input);
68  g->setLabels(input);
69  return g;
70  }
71 
72 }
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
void setMedia(EGS_Input *inp)
Set the media in the geometry from the input pointed to by inp.
void setName(EGS_Input *inp)
Set the name of the geometry from the input inp.
int setLabels(EGS_Input *input)
Set the labels from an input block.
void setBoundaryTolerance(EGS_Input *inp)
Set the value of the boundary tolerance from the input inp.
A class for storing information in a tree-like structure of key-value pairs. This class is used throu...
Definition: egs_input.h:182
The entire space as a geometry object.
Definition: egs_space.h:83
EGS_GLIB_EXPORT EGS_BaseGeometry * createGeometry(EGS_Input *input)
Definition: egs_glib.cpp:84
EGS_Input class header file.
The entire space as a geometry.