-------------------------------------------------------------vertex_dist Vertex (x, y) with the distance to the next one. The last vertex has distance between the last and the first points if the polygon is closed and 0.0 if it's a polyline.
| 129 | // distance between the last and the first points if the polygon is closed |
| 130 | // and 0.0 if it's a polyline. |
| 131 | struct vertex_dist |
| 132 | { |
| 133 | double x; |
| 134 | double y; |
| 135 | double dist; |
| 136 | |
| 137 | vertex_dist() {} |
| 138 | vertex_dist(double x_, double y_) : |
| 139 | x(x_), |
| 140 | y(y_), |
| 141 | dist(0.0) |
| 142 | { |
| 143 | } |
| 144 | |
| 145 | bool operator () (const vertex_dist& val) |
| 146 | { |
| 147 | bool ret = (dist = calc_distance(x, y, val.x, val.y)) > vertex_dist_epsilon; |
| 148 | if(!ret) dist = 1.0 / vertex_dist_epsilon; |
| 149 | return ret; |
| 150 | } |
| 151 | }; |
| 152 | |
| 153 | |
| 154 |
no outgoing calls
no test coverage detected