41 static string EGS_CIRCLE_LOCAL typeStr(
"egs_circle");
42 static bool EGS_CIRCLE_LOCAL inputSet =
false;
43 static shared_ptr<EGS_BlockInput> EGS_CIRCLE_LOCAL shapeBlockInput = make_shared<EGS_BlockInput>(
"shape");
47 static void setInputs() {
50 setShapeInputs(shapeBlockInput);
51 shapeBlockInput->getSingleInput(
"library")->setValues({typeStr});
53 shapeBlockInput->addSingleInput(
"radius",
false,
"The radius of the circle.");
54 shapeBlockInput->addSingleInput(
"midpoint",
false,
"The x, y midpoint of the circle, which is in the x-y plane located at z=0. Use an EGS_AffineTransform block to translate or rotate the shape.");
55 shapeBlockInput->addSingleInput(
"inner radius",
false,
"The inner radius, to define a ring. Points will only be sampled within the ring between the 'inner radius' and 'radius'.");
58 EGS_CIRCLE_EXPORT
string getExample() {
63 radius = the circle radius
64 midpoint = Ox, Oy (optional)
65 inner radius = the inner radius (optional)
71 EGS_CIRCLE_EXPORT shared_ptr<EGS_BlockInput> getInputs() {
75 return shapeBlockInput;
81 egsWarning(
"createShape(circle): null input?\n");
85 int err = input->
getInput(
"radius",radius);
87 egsWarning(
"createShape(circle): no 'radius' input\n");
91 err = input->
getInput(
"inner radius",Ro);
95 vector<EGS_Float> pos;
96 err = input->
getInput(
"midpoint",pos);
103 if (pos.size() != 2) {
104 egsWarning(
"createShape(circle): 2 instead of %d inputs expected"
105 " for keyword 'midpoint'. Reseting midpoint to (0,0)\n",
Base shape class. All shapes in the EGSnrc C++ class library are derived from EGS_BaseShape.
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.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.