| 11 | { |
| 12 | |
| 13 | VectorFloatPoint cropPolygon(FloatPoint* _baseVerticiesPos, size_t _size, const IntCoord& _cropRectangle) |
| 14 | { |
| 15 | VectorFloatPoint resultVerticiesPos; |
| 16 | resultVerticiesPos.resize(_size); |
| 17 | for (size_t i = 0; i < _size; ++i) |
| 18 | { |
| 19 | resultVerticiesPos[i] = _baseVerticiesPos[i]; |
| 20 | } |
| 21 | |
| 22 | cropPolygonSide(resultVerticiesPos, _cropRectangle.left, Left); |
| 23 | cropPolygonSide(resultVerticiesPos, _cropRectangle.right(), Right); |
| 24 | cropPolygonSide(resultVerticiesPos, _cropRectangle.top, Top); |
| 25 | cropPolygonSide(resultVerticiesPos, _cropRectangle.bottom(), Bottom); |
| 26 | |
| 27 | return resultVerticiesPos; |
| 28 | } |
| 29 | |
| 30 | void cropPolygonSide(VectorFloatPoint& _verticies, int _sideCoord, Side _side) |
| 31 | { |
no test coverage detected