//
//
//
-// File : VTKViewer_RenderWindowInteractor.cxx
-// Author : Nicolas REJNERI
+// File :
+// Author :
// Module : SALOME
// $Header$
::~SVTK_RenderWindowInteractor()
{
if(MYDEBUG) INFOS("~SVTK_RenderWindowInteractor() - "<<this);
+
+ // Sequence of the destruction call are fixed and should be changed.
+ // vtkRenderWindow instance should be destroyed after all vtkRenderer's
+ GetDevice()->SetInteractorStyle(NULL);
+ while(!myInteractorStyles.empty()){
+ const PInteractorStyle& aStyle = myInteractorStyles.top();
+ aStyle->SetInteractor(NULL);
+ myInteractorStyles.pop();
+ }
+
+ SetRenderer(NULL);
+
+ GetDevice()->SetRenderWindow(NULL);
}
vtkRenderWindow*
if(GetRenderer()){
myRenderWindow->RemoveRenderer(getRenderer());
- theRenderer->SetInteractor(NULL);
+ myRenderer->SetInteractor(NULL);
}
myRenderer = theRenderer;
SVTK_RenderWindowInteractor
::GetInteractorStyle()
{
- return myInteractorStyles.isEmpty() ? 0 : myInteractorStyles.top().GetPointer();
+ return myInteractorStyles.empty() ? 0 : myInteractorStyles.top().GetPointer();
}
::wheelEvent( QWheelEvent* event )
{
QVTK_RenderWindowInteractor::wheelEvent(event);
+ if(event->delta() > 0)
+ GetDevice()->InvokeEvent(SVTK::ZoomInEvent,NULL);
+ else
+ GetDevice()->InvokeEvent(SVTK::ZoomOutEvent,NULL);
#ifdef GENERATE_SUIT_EVENTS
emit WheelMoved( event );
#endif
#include "SVTK.h"
#include "SVTK_Selection.h"
-#include <qwidget.h>
-#include <qvaluestack.h>
-
#include <vtkSmartPointer.h>
+#include <qwidget.h>
+#include <stack>
class vtkGenericRenderWindowInteractor;
class vtkInteractorStyle;
vtkSmartPointer<vtkRenderWindow> myRenderWindow;
typedef vtkSmartPointer<vtkInteractorStyle> PInteractorStyle;
- QValueStack<PInteractorStyle> myInteractorStyles;
+ typedef std::stack<PInteractorStyle> TInteractorStyles;
+ TInteractorStyles myInteractorStyles;
};