+ do not call seekToPoint() but directly panToCenter() for middle-clicks

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5087 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
wmayer 2011-11-03 12:23:33 +00:00
parent 7931687dd1
commit 5d17586dcd
3 changed files with 9 additions and 21 deletions

View File

@ -247,10 +247,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
float dci = (float)QApplication::doubleClickInterval()/1000.0f; float dci = (float)QApplication::doubleClickInterval()/1000.0f;
// is it just a middle click? // is it just a middle click?
if (tmp.getValue() < dci && !this->lockrecenter) { if (tmp.getValue() < dci && !this->lockrecenter) {
if (!this->seekToPoint(pos)) { panToCenter(panningplane, posn);
panToCenter(panningplane, posn);
this->interactiveCountDec();
}
processed = TRUE; processed = TRUE;
} }
} }

View File

@ -189,10 +189,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
float dci = (float)QApplication::doubleClickInterval()/1000.0f; float dci = (float)QApplication::doubleClickInterval()/1000.0f;
// is it just a left click? // is it just a left click?
if (tmp.getValue() < dci && !this->lockrecenter) { if (tmp.getValue() < dci && !this->lockrecenter) {
if (!this->seekToPoint(pos)) { panToCenter(panningplane, posn);
panToCenter(panningplane, posn);
this->interactiveCountDec();
}
processed = TRUE; processed = TRUE;
} }
} }
@ -276,10 +273,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
float dci = (float)QApplication::doubleClickInterval()/1000.0f; float dci = (float)QApplication::doubleClickInterval()/1000.0f;
// is it just a middle click? // is it just a middle click?
if (tmp.getValue() < dci && !this->lockrecenter) { if (tmp.getValue() < dci && !this->lockrecenter) {
if (!this->seekToPoint(pos)) { panToCenter(panningplane, posn);
panToCenter(panningplane, posn);
this->interactiveCountDec();
}
processed = TRUE; processed = TRUE;
} }
} }

View File

@ -182,10 +182,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
float dci = (float)QApplication::doubleClickInterval()/1000.0f; float dci = (float)QApplication::doubleClickInterval()/1000.0f;
// is it just a left click? // is it just a left click?
if (tmp.getValue() < dci && !this->lockrecenter) { if (tmp.getValue() < dci && !this->lockrecenter) {
if (!this->seekToPoint(pos)) { panToCenter(panningplane, posn);
panToCenter(panningplane, posn);
this->interactiveCountDec();
}
processed = TRUE; processed = TRUE;
} }
} }
@ -193,19 +190,22 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
newmode = NavigationStyle::SEEK_MODE; newmode = NavigationStyle::SEEK_MODE;
this->seekToPoint(pos); // implicitly calls interactiveCountInc() this->seekToPoint(pos); // implicitly calls interactiveCountInc()
processed = TRUE; processed = TRUE;
this->lockrecenter = TRUE;
} }
else if (press && (this->currentmode == NavigationStyle::IDLE)) { else if (press && (this->currentmode == NavigationStyle::IDLE)) {
this->setViewing(true); this->setViewing(true);
processed = TRUE; processed = TRUE;
this->lockrecenter = TRUE;
} }
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) { else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
this->setViewing(false); this->setViewing(false);
processed = TRUE; processed = TRUE;
this->lockrecenter = TRUE;
} }
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) { else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
processed = TRUE; processed = TRUE;
this->lockrecenter = TRUE;
} }
this->lockrecenter = TRUE;
break; break;
case SoMouseButtonEvent::BUTTON2: case SoMouseButtonEvent::BUTTON2:
// If we are in edit mode then simply ignore the RMB events // If we are in edit mode then simply ignore the RMB events
@ -237,10 +237,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
float dci = (float)QApplication::doubleClickInterval()/1000.0f; float dci = (float)QApplication::doubleClickInterval()/1000.0f;
// is it just a middle click? // is it just a middle click?
if (tmp.getValue() < dci && !this->lockrecenter) { if (tmp.getValue() < dci && !this->lockrecenter) {
if (!this->seekToPoint(pos)) { panToCenter(panningplane, posn);
panToCenter(panningplane, posn);
this->interactiveCountDec();
}
processed = TRUE; processed = TRUE;
} }
} }