Get the index of a point by matching a coordinate
| 164 | |
| 165 | // Get the index of a point by matching a coordinate |
| 166 | int64_t Keyframe::FindIndex(Point p) const { |
| 167 | // loop through points, and find a matching coordinate |
| 168 | for (std::vector<Point>::size_type x = 0; x < Points.size(); x++) { |
| 169 | // Get each point |
| 170 | Point existing_point = Points[x]; |
| 171 | |
| 172 | // find a match |
| 173 | if (p.co.X == existing_point.co.X && p.co.Y == existing_point.co.Y) { |
| 174 | // Remove the matching point, and break out of loop |
| 175 | return x; |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | // no matching point found |
| 180 | throw OutOfBoundsPoint("Invalid point requested", -1, Points.size()); |
| 181 | } |
| 182 | |
| 183 | // Determine if point already exists |
| 184 | bool Keyframe::Contains(Point p) const { |
nothing calls this directly
no test coverage detected