myPreselectionEnabled = true;
mySelectionEnabled = true;
+ myCursorIsHand = false;
clearViewAspects();
void OCCViewer_ViewWindow::activateZoom()
{
if ( !transformRequested() && !myCursorIsHand )
- myCursor = cursor(); /* save old cursor */
+ saveCursor(); /* save old cursor */
if ( myOperation != ZOOMVIEW ) {
QPixmap zoomPixmap (imageZoomCursor);
void OCCViewer_ViewWindow::activatePanning()
{
if ( !transformRequested() && !myCursorIsHand )
- myCursor = cursor(); // save old cursor
+ saveCursor(); // save old cursor
if ( myOperation != PANVIEW ) {
QCursor panCursor (Qt::SizeAllCursor);
void OCCViewer_ViewWindow::activateRotation()
{
if ( !transformRequested() && !myCursorIsHand )
- myCursor = cursor(); // save old cursor
+ saveCursor(); // save old cursor
if ( myOperation != ROTATE ) {
QPixmap rotatePixmap (imageRotateCursor);
{
QCursor handCursor (Qt::PointingHandCursor);
myCursorIsHand = true;
- myCursor = cursor();
+ saveCursor();
myViewPort->setCursor( handCursor );
}
myRotationPointSelection = true;
QCursor glPanCursor (globalPanPixmap);
myCurScale = aView3d->Scale();
aView3d->FitAll(0.01, false);
- myCursor = cursor(); // save old cursor
+ saveCursor(); // save old cursor
myViewPort->fitAll(); // fits view before selecting a new scene center
if( setTransformRequested( PANGLOBAL ) )
myViewPort->setCursor( glPanCursor );
void OCCViewer_ViewWindow::activateWindowFit()
{
if ( !transformRequested() && !myCursorIsHand )
- myCursor = cursor(); /* save old cursor */
+ saveCursor(); /* save old cursor */
if ( myOperation != WINDOWFIT ) {
QCursor handCursor (Qt::PointingHandCursor);
if ( !myCursorIsHand ) { // we are going to sketch a rectangle
QCursor handCursor (Qt::PointingHandCursor);
myCursorIsHand = true;
- myCursor = cursor();
+ saveCursor();
myViewPort->setCursor( handCursor );
}
}
}
+/*!
+ Save old cursor. [ protected ]
+*/
+void OCCViewer_ViewWindow::saveCursor()
+{
+ QCursor* aCursor = NULL;
+ if ( myViewPort )
+ aCursor = myViewPort->getDefaultCursor();
+ myCursor = ( aCursor ? *aCursor : cursor() );
+}
+
+
/*!
Creates default sketcher. [ virtual protected ]
*/