41 EGS_RectangularRing::EGS_RectangularRing(EGS_Float xmin, EGS_Float xmax,
42 EGS_Float ymin, EGS_Float ymax, EGS_Float xmin_i, EGS_Float xmax_i,
43 EGS_Float ymin_i, EGS_Float ymax_i,
const string &Name,
56 if (xmin_i > xmax_i) {
61 if (ymin_i > ymax_i) {
66 if (xmin_i < xmin || ymin_i < ymin || xmax_i > xmax || ymax_i > ymax) {
74 p[0] = (xmin_i - xmin)*(ymax - ymin);
75 p[1] = (xmax - xmax_i)*(ymax - ymin);
76 p[2] = (xmax_i - xmin_i)*(ymin_i - ymin);
77 p[3] = (xmax_i - xmin_i)*(ymax - ymax_i);
78 A = p[0] + p[1] + p[2] + p[3];
84 otype =
"rectangular ring";
88 EGS_RectangularRing::~EGS_RectangularRing() {
103 egsWarning(
"createShape(rectangle): null input?\n");
106 vector<EGS_Float> pos;
107 int err = input->
getInput(
"rectangle",pos);
109 egsWarning(
"createShape(rectangle): no 'rectangle' input\n");
112 if (pos.size() != 4) {
113 egsWarning(
"createShape(rectangle): found only %d inputs instead"
118 vector<EGS_Float> posi;
119 err = input->
getInput(
"inner rectangle",posi);
120 if (!err && posi.size() == 4) {
122 pos[3],posi[0],posi[2],posi[1],posi[3],
"",f);
124 egsWarning(
"createShape(rectangle): your input did not result in"
125 " a valid \"rectangular ring\"\n");
void setTransformation(EGS_Input *inp)
Set the transformation attached to this shape.
Global egspp functions header file.
Base shape class. All shapes in the EGSnrc C++ class library are derived from EGS_BaseShape.
A "rectangular ring".
void setName(EGS_Input *inp)
Set the name of the object from the information provided by inp.
string otype
The object type.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.