#include "VTKViewer_Algorithm.h"
#include "SVTK_Functor.h"
+#include "SUIT_Tools.h"
#include "SALOME_Actor.h"
#include <vtkObjectFactory.h>
}
myRectBand->hide();
- QRect aRect(myPoint, myOtherPoint);
+ QRect aRect = SUIT_Tools::makeRect(myPoint.x(), myPoint.y(), myOtherPoint.x(), myOtherPoint.y());
myRectBand->setGeometry( aRect );
myRectBand->setVisible( aRect.isValid() );
}
SVTK_RenderWindowInteractor
::mouseReleaseEvent( QMouseEvent *event )
{
+ bool aRightBtn = event->button() == Qt::RightButton;
+ bool isOperation = false;
+ if( aRightBtn && GetInteractorStyle()) {
+ SVTK_InteractorStyle* style = dynamic_cast<SVTK_InteractorStyle*>( GetInteractorStyle() );
+ if ( style )
+ isOperation = style->CurrentState() != VTK_INTERACTOR_STYLE_CAMERA_NONE;
+ }
+
QVTK_RenderWindowInteractor::mouseReleaseEvent(event);
+ if ( aRightBtn && !isOperation && !( event->modifiers() & Qt::ControlModifier ) &&
+ !( event->modifiers() & Qt::ShiftModifier ) ) {
+ QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
+ event->pos(), event->globalPos() );
+ emit contextMenuRequested( &aEvent );
+ }
if(GENERATE_SUIT_EVENTS)
emit MouseButtonReleased( event );
}
emit KeyReleased( event );
}
-/*!
- Custom context menu event handler
-*/
-void
-SVTK_RenderWindowInteractor
-::contextMenuEvent( QContextMenuEvent* event )
-{
- if( !( event->modifiers() & Qt::KeyboardModifierMask ) )
- emit contextMenuRequested( event );
-}
virtual void wheelEvent( QWheelEvent* );
virtual void keyPressEvent( QKeyEvent* );
virtual void keyReleaseEvent( QKeyEvent* );
- virtual void contextMenuEvent( QContextMenuEvent * e );
void
SetRenderer(SVTK_Renderer *theRenderer);