------------------------------------------------------------------------------
| 196 | |
| 197 | //------------------------------------------------------------------------------ |
| 198 | void vtkInteractorStyleImage::OnLeftButtonDown() |
| 199 | { |
| 200 | int x = this->Interactor->GetEventPosition()[0]; |
| 201 | int y = this->Interactor->GetEventPosition()[1]; |
| 202 | |
| 203 | this->FindPokedRenderer(x, y); |
| 204 | if (this->CurrentRenderer == nullptr) |
| 205 | { |
| 206 | return; |
| 207 | } |
| 208 | |
| 209 | // Redefine this button to handle window/level |
| 210 | this->GrabFocus(this->EventCallbackCommand); |
| 211 | if (!this->Interactor->GetShiftKey() && !this->Interactor->GetControlKey()) |
| 212 | { |
| 213 | this->WindowLevelStartPosition[0] = x; |
| 214 | this->WindowLevelStartPosition[1] = y; |
| 215 | this->StartWindowLevel(); |
| 216 | } |
| 217 | |
| 218 | // If shift is held down, do a rotation |
| 219 | else if (this->InteractionMode == VTKIS_IMAGE3D && this->Interactor->GetShiftKey()) |
| 220 | { |
| 221 | this->StartRotate(); |
| 222 | } |
| 223 | |
| 224 | // If ctrl is held down in slicing mode, slice the image |
| 225 | else if (this->InteractionMode == VTKIS_IMAGE_SLICING && this->Interactor->GetControlKey()) |
| 226 | { |
| 227 | this->StartSlice(); |
| 228 | } |
| 229 | |
| 230 | // The rest of the button + key combinations remain the same |
| 231 | |
| 232 | else |
| 233 | { |
| 234 | this->Superclass::OnLeftButtonDown(); |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | //------------------------------------------------------------------------------ |
| 239 | void vtkInteractorStyleImage::OnLeftButtonUp() |
nothing calls this directly
no test coverage detected