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

@@ -61,21 +61,21 @@ void ViewProviderLine::attach ( App::DocumentObject *obj ) {
SoSeparator *sep = getOriginFeatureRoot ();
SoCoordinate3 *pCoords = new SoCoordinate3 ();
auto pCoords = new SoCoordinate3 ();
pCoords->point.setNum (2);
pCoords->point.setValues ( 0, 2, verts );
sep->addChild ( pCoords );
SoIndexedLineSet *pLines = new SoIndexedLineSet ();
auto pLines = new SoIndexedLineSet ();
pLines->coordIndex.setNum(3);
pLines->coordIndex.setValues(0, 3, lines);
sep->addChild ( pLines );
SoTranslation *textTranslation = new SoTranslation ();
auto textTranslation = new SoTranslation ();
textTranslation->translation.setValue ( SbVec3f ( -size * 49. / 50., size / 30., 0 ) );
sep->addChild ( textTranslation );
SoPickStyle *ps = new SoPickStyle();
auto ps = new SoPickStyle();
ps->style.setValue(SoPickStyle::BOUNDING_BOX);
sep->addChild(ps);