59 auto center =
bounds.getCenter();
60 auto size =
bounds.getSize() / 2;
61 for (
int i = 0; i <
rings.size(); i++) {
63 bool isLast = i ==
rings.size() - 1;
65 double maxRx = isLast ? DBL_MAX : minR +
ringSize;
66 double maxRy = isLast ? DBL_MAX : minR +
ringSize;
69 ring->setInnerRx(innerRx);
70 ring->setInnerRy(innerRy);
71 double outerRx = isLast ? size.x :
std::min(size.x, maxRx);
72 double outerRy = isLast ? size.y :
std::min(size.y, maxRy);
73 ring->setBounds(cFigure::Rectangle(center.x - outerRx, center.y - outerRy, 2 * outerRx, 2 * outerRy));
74 ring->setVisible(innerRx < outerRx && innerRy < outerRy);
76 for (
int i = 0; i <
waves.size(); i++) {
78 bool isLast = i ==
waves.size() - 1;
80 double outerRx = isLast ? size.x :
std::min(size.x, radius);
81 double outerRy = isLast ? size.y :
std::min(size.y, radius);
83 wave->setBounds(cFigure::Rectangle(center.x - outerRx, center.y - outerRy, 2 * outerRx, 2 * outerRy));
84 wave->setVisible(innerRx < radius && innerRy < radius && radius < size.x && radius < size.y);
86 for (
int i = 0; i <
rings.size(); i++)
88 for (
int i = 0; i <
waves.size(); i++)
double min(const double a, const double b)
Returns the minimum of a and b.
Definition: SCTPAssociation.h:270
double max(double a, double b)
Returns the greater of the given parameters.
Definition: INETMath.h:161