43 void EGS_Box::printInfo()
const {
46 egsInformation(
"=======================================================\n");
49 static string EGS_BOX_LOCAL typeStr(
"egs_box");
50 string EGS_Box::type(typeStr);
52 static char EGS_BOX_LOCAL ebox_message1[] =
"createGeometry(box): %s\n";
53 static char EGS_BOX_LOCAL ebox_message2[] =
"null input?";
54 static char EGS_BOX_LOCAL ebox_message3[] =
"wrong/missing 'box size' input?";
55 static char EGS_BOX_LOCAL ebox_message4[] =
56 "expecting 1 or 3 float inputs for 'box size'";
57 static char EGS_BOX_LOCAL ebox_key1[] =
"box size";
59 static bool EGS_BOX_LOCAL inputSet =
false;
62 vector<EGS_Float> boxSize;
67 EGS_BOX_LOCAL
int processInputs(
EGS_Input *input) {
68 int err = input->
getInput(ebox_key1,inp.boxSize);
69 if (err && geomBlockInput->getSingleInput(ebox_key1)->getRequired()) {
79 static void setInputs() {
82 setBaseGeometryInputs();
84 geomBlockInput->getSingleInput(
"library")->setValues(vector<string>(1, typeStr));
87 geomBlockInput->addSingleInput(
"box size",
true,
"1 number defining the side-length of a cube, or 3 numbers defining the x, y, and z side-lengths.");
90 EGS_BOX_EXPORT
string getExample() {
105 EGS_BOX_EXPORT shared_ptr<EGS_BlockInput> getInputs() {
109 return geomBlockInput;
118 if(!processInputs(input)) {
119 egsWarning(
"Failed to process the inputs for %s.\n", typeStr.c_str());
131 else if (s.size() == 3) {
132 result =
new EGS_Box(s[0],s[1],s[2],t);
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.
virtual void printInfo() const
Print information about this geometry.
void setBoundaryTolerance(EGS_Input *inp)
Set the value of the boundary tolerance from the input inp.
EGS_BaseGeometry class header file.
EGS_GLIB_EXPORT EGS_BaseGeometry * createGeometry(EGS_Input *input)
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.