41 static bool EGS_GAUSSIAN_SHAPE_LOCAL inputSet =
false;
42 static shared_ptr<EGS_BlockInput> EGS_GAUSSIAN_SHAPE_LOCAL shapeBlockInput = make_shared<EGS_BlockInput>(
"shape");
46 static void setInputs() {
49 shapeBlockInput->addSingleInput(
"library",
true,
"The type of shape, loaded by shared library in egs++/dso.", {
"egs_gaussian_shape"});
50 shapeBlockInput->addSingleInput(
"sigma",
true,
"1 or 2 or 3 inputs, the sigma for Gaussian spread along x, y and z, respectively.");
52 auto shapePtr = shapeBlockInput->addBlockInput(
"shape");
53 setShapeInputs(shapePtr);
56 EGS_GAUSSIAN_SHAPE_EXPORT
string getExample() {
60 # Example of egs_gaussian_shape
62 library = egs_gaussian_shape
64 definition of the shape to be smeared
66 sigma = 1, 2 or 3 inputs
72 EGS_GAUSSIAN_SHAPE_EXPORT shared_ptr<EGS_BlockInput> getInputs() {
76 return shapeBlockInput;
82 egsWarning(
"createShape(circle): null input?\n");
85 vector<EGS_Float> sigma;
86 int err = input->
getInput(
"sigma",sigma);
88 egsWarning(
"createShape(gaussian shape): no 'sigma' input\n");
99 int err = input->
getInput(
"shape name",shape_name);
101 egsWarning(
"createShape(gaussian shape): no inline shape definition"
102 " and no 'shape name' keyword\n");
107 egsWarning(
"createShape(gaussian shape): no shape named %s "
108 "exists\n",shape_name.c_str());
113 if (sigma.size() == 1) {
116 else if (sigma.size() == 2) {
Base shape class. All shapes in the EGSnrc C++ class library are derived from EGS_BaseShape.
static EGS_BaseShape * getShape(const string &Name)
Get a pointer to the shape named Name.
static EGS_BaseShape * createShape(EGS_Input *inp)
Create a shape from the information pointed to by inp.
void setTransformation(EGS_Input *inp)
Set the transformation attached to this shape.
void setName(EGS_Input *inp)
Set the name of the object from the information provided by inp.
Global egspp functions header file.
A shape smeared by a Gaussian.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.