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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user