MCPcopy Create free account
hub / github.com/Kitware/VTK / OnLeftButtonDown

Method OnLeftButtonDown

Interaction/Style/vtkInteractorStyleImage.cxx:198–236  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

196
197//------------------------------------------------------------------------------
198void 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//------------------------------------------------------------------------------
239void vtkInteractorStyleImage::OnLeftButtonUp()

Callers

nothing calls this directly

Calls 5

StartWindowLevelMethod · 0.95
StartSliceMethod · 0.95
StartRotateMethod · 0.80
FindPokedRendererMethod · 0.45
GrabFocusMethod · 0.45

Tested by

no test coverage detected