Remove a point by matching a coordinate
| 428 | |
| 429 | // Remove a point by matching a coordinate |
| 430 | void Keyframe::RemovePoint(Point p) { |
| 431 | // loop through points, and find a matching coordinate |
| 432 | for (std::vector<Point>::size_type x = 0; x < Points.size(); x++) { |
| 433 | // Get each point |
| 434 | Point existing_point = Points[x]; |
| 435 | |
| 436 | // find a match |
| 437 | if (p.co.X == existing_point.co.X && p.co.Y == existing_point.co.Y) { |
| 438 | // Remove the matching point, and break out of loop |
| 439 | Points.erase(Points.begin() + x); |
| 440 | return; |
| 441 | } |
| 442 | } |
| 443 | |
| 444 | // no matching point found |
| 445 | throw OutOfBoundsPoint("Invalid point requested", -1, Points.size()); |
| 446 | } |
| 447 | |
| 448 | // Remove a point by index |
| 449 | void Keyframe::RemovePoint(int64_t index) { |
no test coverage detected