EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Coding Examples
File List
File Members
egs++
test_geometry.cpp
Go to the documentation of this file.
1
/*
2
###############################################################################
3
#
4
# EGSnrc egs++ geometry testing utility
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:
27
#
28
###############################################################################
29
*/
30
31
41
#include "
egs_base_geometry.h
"
42
#include "
egs_geometry_tester.h
"
43
#include "
egs_input.h
"
44
#include "
egs_functions.h
"
45
46
#include <iostream>
47
using namespace
std;
48
49
int
main
(
int
argc,
char
**argv) {
50
51
if
(argc < 2) {
52
egsFatal
(
"Usage: %s input_file\n"
,argv[0]);
53
}
54
55
EGS_Input
input;
56
input.
setContentFromFile
(argv[1]);
57
//input.print(0,cout);
58
EGS_BaseGeometry
*g =
EGS_BaseGeometry::createGeometry
(&input);
59
if
(!g) {
60
egsFatal
(
"\nGot a null geometry? Check your input file\n\n"
);
61
}
62
EGS_BaseGeometry::describeGeometries
();
63
64
EGS_GeometryTester
*tester =
EGS_GeometryTester::getGeometryTester
(&input);
65
66
tester->
testInside
(g);
67
tester->
testInsideTime
(g);
68
tester->
testHownear
(20,g);
69
tester->
testHownearTime
(g);
70
tester->
testHowfar
(g);
71
tester->
testHowfarTime
(g);
72
73
delete
tester;
74
75
return
0;
76
77
}
egs_geometry_tester.h
EGS_GeometryTester class header file.
EGS_GeometryTester
A class for testing geometries.
Definition:
egs_geometry_tester.h:77
main
int main(int argc, char **argv)
A main program for egspp applications.
Definition:
egspp.cpp:58
EGS_GeometryTester::testHownear
void testHownear(int ntry, EGS_BaseGeometry *g)
Performs a hownear test.
Definition:
egs_geometry_tester.cpp:136
EGS_Input::setContentFromFile
int setContentFromFile(const char *fname)
Set the property from the input file fname (which is considered to be an absolute file name) ...
Definition:
egs_input.cpp:200
EGS_GeometryTester::testInsideTime
void testInsideTime(EGS_BaseGeometry *)
Performs an inside time test.
Definition:
egs_geometry_tester.cpp:132
egs_input.h
EGS_Input class header file.
egs_functions.h
Global egspp functions header file.
EGS_BaseGeometry
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
Definition:
egs_base_geometry.h:93
EGS_GeometryTester::testHowfarTime
void testHowfarTime(EGS_BaseGeometry *)
Performs a howfar time test.
Definition:
egs_geometry_tester.cpp:148
egsFatal
EGS_InfoFunction EGS_EXPORT egsFatal
Always use this function for reporting fatal errors.
Definition:
egs_functions.cpp:136
EGS_GeometryTester::getGeometryTester
static EGS_GeometryTester * getGeometryTester(EGS_Input *i)
Creates a geometry tester object from the input i.
Definition:
egs_geometry_tester.cpp:573
EGS_BaseGeometry::describeGeometries
static void describeGeometries()
Describes all existing geometries.
Definition:
egs_base_geometry.cpp:736
EGS_GeometryTester::testHownearTime
void testHownearTime(EGS_BaseGeometry *)
Performs a hownear time test.
Definition:
egs_geometry_tester.cpp:140
EGS_BaseGeometry::createGeometry
static EGS_BaseGeometry * createGeometry(EGS_Input *)
Create a geometry (or geometries) from a given input.
Definition:
egs_base_geometry.cpp:547
EGS_Input
A class for storing information in a tree-like structure of key-value pairs. This class is used throu...
Definition:
egs_input.h:182
EGS_GeometryTester::testHowfar
void testHowfar(EGS_BaseGeometry *)
Performs a howfar test.
Definition:
egs_geometry_tester.cpp:144
egs_base_geometry.h
EGS_BaseGeometry class header file.
EGS_GeometryTester::testInside
void testInside(EGS_BaseGeometry *g)
Performs an inside test.
Definition:
egs_geometry_tester.cpp:128
Generated by
1.8.5