Simple measure drag for volume rendering.
This commit is contained in:
@@ -45,8 +45,10 @@ void VolumeInteractorStyle::OnLeftButtonDown() {
|
|||||||
this->GrabFocus(this->EventCallbackCommand);
|
this->GrabFocus(this->EventCallbackCommand);
|
||||||
// un select last selected prop
|
// un select last selected prop
|
||||||
if (CurrentProp) {
|
if (CurrentProp) {
|
||||||
CurrentProp->InvokeEvent(DraggableActor::DraggableActorEvents::UnSelectedEvent);
|
DragStartOrigin[0] = x;
|
||||||
CurrentProp = nullptr;
|
DragStartOrigin[1] = y;
|
||||||
|
this->StartDrag();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (measure) {
|
if (measure) {
|
||||||
measure->SetPlacing(measure->onMeasureLeftButtonDown(this->Interactor));
|
measure->SetPlacing(measure->onMeasureLeftButtonDown(this->Interactor));
|
||||||
@@ -157,6 +159,10 @@ void VolumeInteractorStyle::OnMouseMove() {
|
|||||||
this->WindowLevel();
|
this->WindowLevel();
|
||||||
this->InvokeEvent(vtkCommand::InteractionEvent, nullptr);
|
this->InvokeEvent(vtkCommand::InteractionEvent, nullptr);
|
||||||
break;
|
break;
|
||||||
|
case VTKIS_DRAG:
|
||||||
|
Drag();
|
||||||
|
this->InvokeEvent(vtkCommand::InteractionEvent, nullptr);
|
||||||
|
break;
|
||||||
case VTKIS_MEASURE:
|
case VTKIS_MEASURE:
|
||||||
MeasurePlace();
|
MeasurePlace();
|
||||||
// this->InvokeEvent(vtkCommand::InteractionEvent, nullptr);
|
// this->InvokeEvent(vtkCommand::InteractionEvent, nullptr);
|
||||||
@@ -321,7 +327,7 @@ void VolumeInteractorStyle::GetCurrentVolumeProperty() {
|
|||||||
void VolumeInteractorStyle::Drag() {
|
void VolumeInteractorStyle::Drag() {
|
||||||
int *pos = this->Interactor->GetEventPosition();
|
int *pos = this->Interactor->GetEventPosition();
|
||||||
this->FindPokedRenderer(pos[0], pos[1]);
|
this->FindPokedRenderer(pos[0], pos[1]);
|
||||||
DraggableActor::SafeDownCast(dragProp)->Transform(pos[0] - DragStartOrigin[0], pos[1] - DragStartOrigin[1]);
|
DraggableActor::SafeDownCast(CurrentProp)->Transform(pos[0] - DragStartOrigin[0], pos[1] - DragStartOrigin[1]);
|
||||||
this->Interactor->Render();
|
this->Interactor->Render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user