//
// SALOME VTKViewer : build VTK viewer into Salome desktop
-// File :
-// Author :
+// File :
+// Author :
#include "SVTK_RenderWindowInteractor.h"
#endif
#include <QMouseEvent>
-#include "SVTK_SpaceMouse.h"
-#include "SVTK_Event.h"
+#include "SVTK_SpaceMouse.h"
+#include "SVTK_Event.h"
#include "VTKViewer_Algorithm.h"
Constructor
*/
QVTK_RenderWindowInteractor
-::QVTK_RenderWindowInteractor(QWidget* theParent,
+::QVTK_RenderWindowInteractor(QWidget* theParent,
const char* theName):
QWidget(theParent),
myRenderWindow(vtkRenderWindow::New())
/*!
To initialize by vtkGenericRenderWindowInteractor instance
*/
-void
+void
QVTK_RenderWindowInteractor
::Initialize(vtkGenericRenderWindowInteractor* theDevice)
{
Destructor
*/
QVTK_RenderWindowInteractor
-::~QVTK_RenderWindowInteractor()
+::~QVTK_RenderWindowInteractor()
{
#if !defined WIN32 && !defined __APPLE__
SVTK_SpaceMouseXCB* aSpaceMouse = SVTK_SpaceMouseXCB::getInstance();
/*!
\return corresponding render window interactor
*/
-vtkGenericRenderWindowInteractor*
+vtkGenericRenderWindowInteractor*
QVTK_RenderWindowInteractor
::GetDevice()
{
*/
void
QVTK_RenderWindowInteractor
-::resize(int w, int h)
+::resize(int w, int h)
{
GetDevice()->UpdateSize(w,h);
}
*/
void
QVTK_RenderWindowInteractor
-::paintEvent( QPaintEvent* theEvent )
+::paintEvent( QPaintEvent* theEvent )
{
GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
}
}
}
- update();
+ update();
}
*/
void
QVTK_RenderWindowInteractor
-::mouseMoveEvent( QMouseEvent* event )
+::mouseMoveEvent( QMouseEvent* event )
{
- GetDevice()->SetEventInformationFlipY(event->x(),
+ GetDevice()->SetEventInformationFlipY(event->x(),
event->y(),
event->modifiers() & Qt::ControlModifier,
event->modifiers() & Qt::ShiftModifier);
*/
void
QVTK_RenderWindowInteractor
-::mousePressEvent( QMouseEvent* event )
+::mousePressEvent( QMouseEvent* event )
{
- GetDevice()->SetEventInformationFlipY(event->x(),
+ GetDevice()->SetEventInformationFlipY(event->x(),
event->y(),
event->modifiers() & Qt::ControlModifier,
event->modifiers() & Qt::ShiftModifier);
QVTK_RenderWindowInteractor
::mouseReleaseEvent( QMouseEvent *event )
{
- GetDevice()->SetEventInformationFlipY(event->x(),
+ GetDevice()->SetEventInformationFlipY(event->x(),
event->y(),
event->modifiers() & Qt::ControlModifier,
event->modifiers() & Qt::ShiftModifier);
{
activateWindow();
setFocus();
- GetDevice()->SetEventInformationFlipY(event->x(),
+ GetDevice()->SetEventInformationFlipY(event->x(),
event->y(),
event->modifiers() & Qt::ControlModifier,
event->modifiers() & Qt::ShiftModifier);
*/
void
QVTK_RenderWindowInteractor
-::keyPressEvent( QKeyEvent* event )
+::keyPressEvent( QKeyEvent* event )
{
GetDevice()->SetKeyEventInformation(event->modifiers() & Qt::ControlModifier,
event->modifiers() & Qt::ShiftModifier,
*/
void
QVTK_RenderWindowInteractor
-::keyReleaseEvent( QKeyEvent * event )
+::keyReleaseEvent( QKeyEvent * event )
{
GetDevice()->SetKeyEventInformation(event->modifiers() & Qt::ControlModifier,
event->modifiers() & Qt::ShiftModifier,
/*!
Custom enter event handler
*/
-void
+void
QVTK_RenderWindowInteractor
::enterEvent( QEvent* event )
{
/*!
Custom leave event handler
*/
-void
+void
QVTK_RenderWindowInteractor
::leaveEvent( QEvent * )
{
/*!
Reimplemented from QWidget in order to set window - receiver
- of space mouse events.
+ of space mouse events.
*/
-void
+void
QVTK_RenderWindowInteractor
::focusInEvent( QFocusEvent* event )
{
/*!
Reimplemented from QWidget in order to set window - receiver
- of space mouse events.
+ of space mouse events.
*/
-void
+void
QVTK_RenderWindowInteractor
::focusOutEvent ( QFocusEvent* event )
{
Constructor
*/
SVTK_RenderWindowInteractor
-::SVTK_RenderWindowInteractor(QWidget* theParent,
+::SVTK_RenderWindowInteractor(QWidget* theParent,
const char* theName):
QVTK_RenderWindowInteractor(theParent,theName),
myEventCallbackCommand(vtkCallbackCommand::New())
{
myEventCallbackCommand->Delete();
- myEventCallbackCommand->SetClientData(this);
+ myEventCallbackCommand->SetClientData(this);
myPriority = 0.0;
myEventCallbackCommand->SetCallback(SVTK_RenderWindowInteractor::ProcessEvents);
Destructor
*/
SVTK_RenderWindowInteractor
-::~SVTK_RenderWindowInteractor()
+::~SVTK_RenderWindowInteractor()
{
// Sequence of the destruction call are fixed and should be changed.
// vtkRenderWindow instance should be destroyed after all vtkRenderer's
- GetDevice()->SetInteractorStyle(NULL);
+ GetDevice()->SetInteractorStyle(NULL);
while(!myInteractorStyles.empty()){
const PInteractorStyle& aStyle = myInteractorStyles.top();
aStyle->SetInteractor(NULL);
/*!
To get corresponding SVTK_Renderer instance
*/
-SVTK_Renderer*
+SVTK_Renderer*
SVTK_RenderWindowInteractor
::GetRenderer()
{
/*!
To get corresponding SVTK_Renderer device (just to simplify collobaration with SVTK_Renderer)
*/
-vtkRenderer*
+vtkRenderer*
SVTK_RenderWindowInteractor
::getRenderer()
{
SVTK_RenderWindowInteractor
::InitInteractorStyle(vtkInteractorStyle* theStyle)
{
- GetDevice()->SetInteractorStyle(theStyle);
+ GetDevice()->SetInteractorStyle(theStyle);
}
/*!
{
if(GetInteractorStyle())
myInteractorStyles.pop();
-
- if(GetInteractorStyle())
+
+ if(GetInteractorStyle())
InitInteractorStyle(GetInteractorStyle());
}
/*!
To get current interactor style
*/
-vtkInteractorStyle*
+vtkInteractorStyle*
SVTK_RenderWindowInteractor
::GetInteractorStyle()
{
/*!
To get current selector
*/
-SVTK_Selector*
+SVTK_Selector*
SVTK_RenderWindowInteractor
-::GetSelector()
-{
- return mySelector.GetPointer();
+::GetSelector()
+{
+ return mySelector.GetPointer();
}
void
SVTK_RenderWindowInteractor
::SetSelector(SVTK_Selector* theSelector)
-{
+{
if(mySelector.GetPointer())
mySelector->RemoveObserver(myEventCallbackCommand.GetPointer());
- mySelector = theSelector;
+ mySelector = theSelector;
if(mySelector.GetPointer())
- mySelector->AddObserver(vtkCommand::EndPickEvent,
- myEventCallbackCommand.GetPointer(),
+ mySelector->AddObserver(vtkCommand::EndPickEvent,
+ myEventCallbackCommand.GetPointer(),
myPriority);
}
/*!
Main process VTK event method
*/
-void
+void
SVTK_RenderWindowInteractor
-::ProcessEvents(vtkObject* vtkNotUsed(theObject),
+::ProcessEvents(vtkObject* vtkNotUsed(theObject),
unsigned long theEvent,
- void* theClientData,
+ void* theClientData,
void* vtkNotUsed(theCallData))
{
SVTK_RenderWindowInteractor* self = reinterpret_cast<SVTK_RenderWindowInteractor*>(theClientData);
*/
void
SVTK_RenderWindowInteractor
-::mouseMoveEvent( QMouseEvent* event )
+::mouseMoveEvent( QMouseEvent* event )
{
QVTK_RenderWindowInteractor::mouseMoveEvent(event);
*/
void
SVTK_RenderWindowInteractor
-::mousePressEvent( QMouseEvent* event )
+::mousePressEvent( QMouseEvent* event )
{
QVTK_RenderWindowInteractor::mousePressEvent(event);
*/
void
SVTK_RenderWindowInteractor
-::keyPressEvent( QKeyEvent* event )
+::keyPressEvent( QKeyEvent* event )
{
QVTK_RenderWindowInteractor::keyPressEvent(event);
*/
void
SVTK_RenderWindowInteractor
-::keyReleaseEvent( QKeyEvent * event )
+::keyReleaseEvent( QKeyEvent * event )
{
QVTK_RenderWindowInteractor::keyReleaseEvent(event);