Commit 14b91fb2 authored by Clinton Stimpson's avatar Clinton Stimpson
Browse files

Move event type enum to QVTKInteractor.

parent f0c5bd81
......@@ -38,6 +38,7 @@
#include "QVTKWin32Header.h"
#include <vtkRenderWindowInteractor.h>
#include <vtkCommand.h>
#include <QtCore/QObject>
#include "vtkTDxConfigure.h" // defines VTK_USE_TDX
......@@ -65,6 +66,19 @@ public:
static QVTKInteractor* New();
vtkTypeMacro(QVTKInteractor,vtkRenderWindowInteractor);
// Description:
// Enum for additional event types supported.
// These events can be picked up by command observers on the interactor
enum vtkCustomEvents
{
ContextMenuEvent = vtkCommand::UserEvent + 100,
DragEnterEvent,
DragMoveEvent,
DragLeaveEvent,
DropEvent
};
// Description:
// Overloaded terminiate app, which does nothing in Qt.
// Use qApp->exit() instead.
......
/*=========================================================================
Program: Visualization Toolkit
Module: QVTKWidget.cxx
Module: QVTKInteractorAdapter.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
......@@ -34,7 +34,6 @@
#include "QVTKInteractorAdapter.h"
#include "QVTKInteractor.h"
#include "QVTKWidget.h" // for event types. needs change?
#include <QEvent>
#include <QSignalMapper>
......@@ -245,7 +244,7 @@ bool QVTKInteractorAdapter::ProcessEvent(QEvent* e, vtkRenderWindowInteractor* i
(e2->modifiers() & Qt::ShiftModifier ) > 0 ? 1 : 0);
// invoke event and pass qt event for additional data as well
iren->InvokeEvent(QVTKWidget::ContextMenuEvent, e2);
iren->InvokeEvent(QVTKInteractor::ContextMenuEvent, e2);
return true;
}
......@@ -255,7 +254,7 @@ bool QVTKInteractorAdapter::ProcessEvent(QEvent* e, vtkRenderWindowInteractor* i
QDragEnterEvent* e2 = static_cast<QDragEnterEvent*>(e);
// invoke event and pass qt event for additional data as well
iren->InvokeEvent(QVTKWidget::DragEnterEvent, e2);
iren->InvokeEvent(QVTKInteractor::DragEnterEvent, e2);
return true;
}
......@@ -265,7 +264,7 @@ bool QVTKInteractorAdapter::ProcessEvent(QEvent* e, vtkRenderWindowInteractor* i
QDragLeaveEvent* e2 = static_cast<QDragLeaveEvent*>(e);
// invoke event and pass qt event for additional data as well
iren->InvokeEvent(QVTKWidget::DragLeaveEvent, e2);
iren->InvokeEvent(QVTKInteractor::DragLeaveEvent, e2);
return true;
}
......@@ -278,7 +277,7 @@ bool QVTKInteractorAdapter::ProcessEvent(QEvent* e, vtkRenderWindowInteractor* i
iren->SetEventInformationFlipY(e2->pos().x(), e2->pos().y());
// invoke event and pass qt event for additional data as well
iren->InvokeEvent(QVTKWidget::DragMoveEvent, e2);
iren->InvokeEvent(QVTKInteractor::DragMoveEvent, e2);
return true;
}
......@@ -290,7 +289,7 @@ bool QVTKInteractorAdapter::ProcessEvent(QEvent* e, vtkRenderWindowInteractor* i
iren->SetEventInformationFlipY(e2->pos().x(), e2->pos().y());
// invoke event and pass qt event for additional data as well
iren->InvokeEvent(QVTKWidget::DropEvent, e2);
iren->InvokeEvent(QVTKInteractor::DropEvent, e2);
return true;
}
......
......@@ -42,7 +42,6 @@
class QVTKInteractorAdapter;
class vtkRenderWindow;
#include <vtkCommand.h>
#include <vtkConfigure.h>
#include <vtkToolkits.h>
class vtkImageData;
......@@ -106,11 +105,11 @@ public:
// These events can be picked up by command observers on the interactor
enum vtkCustomEvents
{
ContextMenuEvent = vtkCommand::UserEvent + 100,
DragEnterEvent,
DragMoveEvent,
DragLeaveEvent,
DropEvent
ContextMenuEvent = QVTKInteractor::ContextMenuEvent,
DragEnterEvent = QVTKInteractor::DragEnterEvent,
DragMoveEvent = QVTKInteractor::DragMoveEvent,
DragLeaveEvent = QVTKInteractor::DragLeaveEvent,
DropEvent = QVTKInteractor::DropEvent
};
// Description:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment