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:
berniev
2022-09-15 04:25:13 +10:00
committed by GitHub
parent d7792826b4
commit 75acacd1b7
175 changed files with 2051 additions and 2057 deletions

View File

@@ -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;