| 179 | } |
| 180 | |
| 181 | void vtkOpenVROverlay::LoadNextCameraPose() |
| 182 | { |
| 183 | if (this->SavedCameraPoses.empty()) |
| 184 | { |
| 185 | return; |
| 186 | } |
| 187 | |
| 188 | int nextValue = -1; |
| 189 | int firstValue = this->LastCameraPoseIndex; |
| 190 | // find the next pose index in the map |
| 191 | for (auto p : this->SavedCameraPoses) |
| 192 | { |
| 193 | firstValue = std::min(p.first, firstValue); |
| 194 | if (p.first > this->LastCameraPoseIndex) |
| 195 | { |
| 196 | nextValue = p.first; |
| 197 | // is there anything lower than nextValue but still larger than current |
| 198 | for (auto p2 : this->SavedCameraPoses) |
| 199 | { |
| 200 | if (p2.first > this->LastCameraPoseIndex && p2.first < nextValue) |
| 201 | { |
| 202 | nextValue = p2.first; |
| 203 | } |
| 204 | } |
| 205 | break; |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | if (nextValue == -1) |
| 210 | { |
| 211 | nextValue = firstValue; |
| 212 | } |
| 213 | |
| 214 | this->LoadCameraPose(nextValue); |
| 215 | } |
| 216 | |
| 217 | void vtkOpenVROverlay::Show() |
| 218 | { |
no test coverage detected