Gui: Use auto and range-based for (#7481)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. * When possible use a ranged for loop instead of begin() and end() iterators
This commit is contained in:
@@ -140,7 +140,7 @@ float DemoMode::getSpeed(int v) const
|
||||
SbVec3f DemoMode::getDirection(Gui::View3DInventor* view) const
|
||||
{
|
||||
SoCamera* cam = view->getViewer()->getSoRenderManager()->getCamera();
|
||||
if (!cam)
|
||||
if (!cam)
|
||||
return this->viewAxis;
|
||||
SbRotation rot = cam->orientation.getValue();
|
||||
SbRotation inv = rot.inverse();
|
||||
@@ -157,9 +157,9 @@ void DemoMode::on_angleSlider_valueChanged(int v)
|
||||
Gui::View3DInventor* view = activeView();
|
||||
if (view) {
|
||||
SoCamera* cam = view->getViewer()->getSoRenderManager()->getCamera();
|
||||
if (!cam)
|
||||
if (!cam)
|
||||
return;
|
||||
float angle = Base::toRadians<float>(/*90-v*/v - this->oldvalue);
|
||||
auto angle = Base::toRadians<float>(/*90-v*/v - this->oldvalue);
|
||||
SbRotation rot(SbVec3f(-1, 0, 0), angle);
|
||||
reorientCamera(cam ,rot);
|
||||
this->oldvalue = v;
|
||||
|
||||
Reference in New Issue
Block a user