-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
case QEvent::Wheel:
{
QWheelEvent* aEvent = (QWheelEvent*) e;
- myViewPort->startZoomAtPoint( aEvent->x(), aEvent->y() );
- double delta = (double)( aEvent->delta() ) / ( 15 * 8 );
- int x = aEvent->x();
- int y = aEvent->y();
- int x1 = (int)( aEvent->x() + width()*delta/100 );
- int y1 = (int)( aEvent->y() + height()*delta/100 );
- myViewPort->zoom( x, y, x1, y1 );
- myViewPort->getView()->ZFitAll();
+
+ if ( aEvent->modifiers().testFlag(Qt::ControlModifier) ) {
+ Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
+ if ( isPreselectionEnabled() && ic->HasOpenedContext() ) {
+ if ( aEvent->delta() > 0 ) {
+ ic->HilightNextDetected( myViewPort->getView() );
+ } else {
+ ic->HilightPreviousDetected( myViewPort->getView() );
+ }
+ }
+ } else {
+ myViewPort->startZoomAtPoint( aEvent->x(), aEvent->y() );
+ double delta = (double)( aEvent->delta() ) / ( 15 * 8 );
+ int x = aEvent->x();
+ int y = aEvent->y();
+ int x1 = (int)( aEvent->x() + width()*delta/100 );
+ int y1 = (int)( aEvent->y() + height()*delta/100 );
+ myViewPort->zoom( x, y, x1, y1 );
+ myViewPort->getView()->ZFitAll();
+ }
}
return true;
continue;
}
+#if OCC_VERSION_LARGE > 0x06070100
+ Bnd_Box aBox = aStructure->MinMaxValues();
+ aXmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X();
+ aYmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y();
+ aZmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Z();
+ aXmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().X();
+ aYmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Y();
+ aZmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Z();
+#else
aStructure->MinMaxValues( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax );
+#endif
// Infinite structures are skipped
Standard_Real aLIM = ShortRealLast() - 1.0;