Gui: PR6497 move return statement to new line
This commit is contained in:
@@ -325,7 +325,8 @@ void NavigationStyle::seekToPoint(const SbVec3f& scenepos)
|
||||
SbBool NavigationStyle::lookAtPoint(const SbVec2s screenpos)
|
||||
{
|
||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||
if (cam == nullptr) return false;
|
||||
if (cam == nullptr)
|
||||
return false;
|
||||
|
||||
SoRayPickAction rpaction(viewer->getSoRenderManager()->getViewportRegion());
|
||||
rpaction.setPoint(screenpos);
|
||||
@@ -347,7 +348,8 @@ SbBool NavigationStyle::lookAtPoint(const SbVec2s screenpos)
|
||||
void NavigationStyle::lookAtPoint(const SbVec3f& pos)
|
||||
{
|
||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||
if (cam == nullptr) return;
|
||||
if (cam == nullptr)
|
||||
return;
|
||||
PRIVATE(this)->rotationCenterFound = false;
|
||||
|
||||
// Find global coordinates of focal point.
|
||||
@@ -405,7 +407,8 @@ void NavigationStyle::lookAtPoint(const SbVec3f& pos)
|
||||
void NavigationStyle::setCameraOrientation(const SbRotation& rot, SbBool moveToCenter)
|
||||
{
|
||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||
if (cam == nullptr) return;
|
||||
if (cam == nullptr)
|
||||
return;
|
||||
|
||||
// Find global coordinates of focal point.
|
||||
SbVec3f direction;
|
||||
@@ -484,7 +487,8 @@ void NavigationStyleP::viewAnimationCB(void * data, SoSensor * sensor)
|
||||
SbRotation slerp = SbRotation::slerp(that->spinRotation, PRIVATE(that)->endRotation, step);
|
||||
SbVec3f focalpoint = (1.0f-step)*PRIVATE(that)->focal1 + step*PRIVATE(that)->focal2;
|
||||
SoCamera* cam = that->viewer->getSoRenderManager()->getCamera();
|
||||
if (!cam) return; // no camera
|
||||
if (!cam) // no camera
|
||||
return;
|
||||
|
||||
SbVec3f direction;
|
||||
cam->orientation.setValue(slerp);
|
||||
@@ -508,7 +512,8 @@ void NavigationStyleP::viewAnimationCB(void * data, SoSensor * sensor)
|
||||
void NavigationStyle::boxZoom(const SbBox2s& box)
|
||||
{
|
||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||
if (!cam) return; // no camera
|
||||
if (!cam) // no camera
|
||||
return;
|
||||
const SbViewportRegion & vp = viewer->getSoRenderManager()->getViewportRegion();
|
||||
SbViewVolume vv = cam->getViewVolume(vp.getViewportAspectRatio());
|
||||
|
||||
@@ -551,7 +556,8 @@ void NavigationStyle::viewAll()
|
||||
SoGetBoundingBoxAction action(viewer->getSoRenderManager()->getViewportRegion());
|
||||
action.apply(viewer->getSceneGraph());
|
||||
SbBox3f box = action.getBoundingBox();
|
||||
if (box.isEmpty()) return;
|
||||
if (box.isEmpty())
|
||||
return;
|
||||
|
||||
#if 0
|
||||
// check whether the box is very wide or tall, if not do nothing
|
||||
@@ -564,7 +570,8 @@ void NavigationStyle::viewAll()
|
||||
#endif
|
||||
|
||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||
if (!cam) return;
|
||||
if (!cam)
|
||||
return;
|
||||
|
||||
SbViewVolume vol = cam->getViewVolume();
|
||||
if (vol.ulf == vol.llf)
|
||||
@@ -615,7 +622,8 @@ void NavigationStyle::viewAll()
|
||||
*/
|
||||
void NavigationStyle::reorientCamera(SoCamera * cam, const SbRotation & rot)
|
||||
{
|
||||
if (cam == nullptr) return;
|
||||
if (cam == nullptr)
|
||||
return;
|
||||
|
||||
// Find global coordinates of focal point.
|
||||
SbVec3f direction;
|
||||
@@ -634,8 +642,10 @@ void NavigationStyle::reorientCamera(SoCamera * cam, const SbRotation & rot)
|
||||
void NavigationStyle::panCamera(SoCamera * cam, float aspectratio, const SbPlane & panplane,
|
||||
const SbVec2f & currpos, const SbVec2f & prevpos)
|
||||
{
|
||||
if (cam == nullptr) return; // can happen for empty scenegraph
|
||||
if (currpos == prevpos) return; // useless invocation
|
||||
if (cam == nullptr) // can happen for empty scenegraph
|
||||
return;
|
||||
if (currpos == prevpos) // useless invocation
|
||||
return;
|
||||
|
||||
|
||||
// Find projection points for the last and current mouse coordinates.
|
||||
@@ -693,7 +703,8 @@ void NavigationStyle::panToCenter(const SbPlane & pplane, const SbVec2f & currpo
|
||||
*/
|
||||
void NavigationStyle::zoom(SoCamera * cam, float diffvalue)
|
||||
{
|
||||
if (cam == nullptr) return; // can happen for empty scenegraph
|
||||
if (cam == nullptr) // can happen for empty scenegraph
|
||||
return;
|
||||
SoType t = cam->getTypeId();
|
||||
SbName tname = t.getName();
|
||||
|
||||
@@ -890,7 +901,8 @@ SbVec3f NavigationStyle::getFocalPoint() const
|
||||
*/
|
||||
void NavigationStyle::spin(const SbVec2f & pointerpos)
|
||||
{
|
||||
if (this->log.historysize < 2) return;
|
||||
if (this->log.historysize < 2)
|
||||
return;
|
||||
assert(this->spinprojector != nullptr);
|
||||
|
||||
const SbViewportRegion & vp = viewer->getSoRenderManager()->getViewportRegion();
|
||||
@@ -1050,7 +1062,8 @@ void NavigationStyle::saveCursorPosition(const SoEvent * const ev)
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
|
||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||
if (!cam) return; // no camera
|
||||
if (!cam) // no camera
|
||||
return;
|
||||
SbViewVolume vv = cam->getViewVolume(ratio);
|
||||
|
||||
SbLine line;
|
||||
@@ -1069,7 +1082,8 @@ void NavigationStyle::saveCursorPosition(const SoEvent * const ev)
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
|
||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||
if (!cam) return; // no camera
|
||||
if (!cam) // no camera
|
||||
return;
|
||||
|
||||
SoGetBoundingBoxAction action(viewer->getSoRenderManager()->getViewportRegion());
|
||||
action.apply(viewer->getSceneGraph());
|
||||
@@ -1187,7 +1201,8 @@ SbBool NavigationStyle::isAnimating() const
|
||||
*/
|
||||
void NavigationStyle::startAnimating(const SbVec3f& axis, float velocity)
|
||||
{
|
||||
if (!isAnimationEnabled()) return;
|
||||
if (!isAnimationEnabled())
|
||||
return;
|
||||
|
||||
this->prevRedrawTime = SbTime::getTimeOfDay();
|
||||
this->spinincrement = SbRotation::identity();
|
||||
@@ -1396,7 +1411,9 @@ void NavigationStyle::syncModifierKeys(const SoEvent * const ev)
|
||||
void NavigationStyle::setViewingMode(const ViewerMode newmode)
|
||||
{
|
||||
const ViewerMode oldmode = this->currentmode;
|
||||
if (newmode == oldmode) { return; }
|
||||
if (newmode == oldmode) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (newmode) {
|
||||
case DRAGGING:
|
||||
@@ -1522,7 +1539,9 @@ void NavigationStyle::syncWithEvent(const SoEvent * const ev)
|
||||
// Events when in "ready-to-seek" mode are ignored, except those
|
||||
// which influence the seek mode itself -- these are handled further
|
||||
// up the inheritance hierarchy.
|
||||
if (this->isSeekMode()) { return; }
|
||||
if (this->isSeekMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const SoType type(ev->getTypeId());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user