feat: add mouse right button gesture
This commit is contained in:
@@ -204,6 +204,41 @@ void ActorDraggableInteractorStyle::OnRightButtonDown() {
|
|||||||
if (dragProp) {
|
if (dragProp) {
|
||||||
dragProp->InvokeEvent(DraggableStyleEvents::RightButtonClickEvent, this->Interactor);
|
dragProp->InvokeEvent(DraggableStyleEvents::RightButtonClickEvent, this->Interactor);
|
||||||
}
|
}
|
||||||
|
if (this->InteractionMode == VTKIS_IMAGE_WINDOWLEVEL) {
|
||||||
|
this->DollyStartScale = this->CurrentRenderer->GetActiveCamera()->GetParallelScale();
|
||||||
|
this->StartDolly();
|
||||||
|
} else if (this->InteractionMode == VTKIS_IMAGE_ZOOM) {
|
||||||
|
this->StartPan();
|
||||||
|
} else if (this->InteractionMode == VTKIS_IMAGE_PAN) {
|
||||||
|
this->DollyStartScale = this->CurrentRenderer->GetActiveCamera()->GetParallelScale();
|
||||||
|
this->StartDolly();
|
||||||
|
} else if (this->InteractionMode == VTKIS_IMAGE_SLICING) {
|
||||||
|
this->WindowLevelStartPosition[0] = x;
|
||||||
|
this->WindowLevelStartPosition[1] = y;
|
||||||
|
this->StartWindowLevel();
|
||||||
|
}
|
||||||
|
else if(this->InteractionMode == VTKIS_SYNCPOINT){
|
||||||
|
this->WindowLevelStartPosition[0] = x;
|
||||||
|
this->WindowLevelStartPosition[1] = y;
|
||||||
|
this->StartWindowLevel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActorDraggableInteractorStyle::OnRightButtonUp() {
|
||||||
|
switch (this->State) {
|
||||||
|
case VTKIS_IMAGE_WINDOWLEVEL:
|
||||||
|
case VTKIS_IMAGE_PAN:
|
||||||
|
this->EndDolly();
|
||||||
|
break;
|
||||||
|
case VTKIS_IMAGE_ZOOM:
|
||||||
|
this->EndPan();
|
||||||
|
break;
|
||||||
|
case VTKIS_IMAGE_SLICING:
|
||||||
|
case VTKIS_SYNCPOINT:
|
||||||
|
this->EndWindowLevel();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
vtkInteractorStyleImage::OnLeftButtonUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActorDraggableInteractorStyle::OnMouseMove() {
|
void ActorDraggableInteractorStyle::OnMouseMove() {
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ vtkTypeMacro(ActorDraggableInteractorStyle, vtkInteractorStyleImage);
|
|||||||
*/
|
*/
|
||||||
void OnRightButtonDown() override;
|
void OnRightButtonDown() override;
|
||||||
|
|
||||||
|
void OnRightButtonUp() override;
|
||||||
|
|
||||||
|
|
||||||
#if VTK_MAJOR_VERSION>=9
|
#if VTK_MAJOR_VERSION>=9
|
||||||
void OnLeftButtonDoubleClick() override;
|
void OnLeftButtonDoubleClick() override;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user