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

@@ -78,7 +78,7 @@ SoFCBoundingBox::SoFCBoundingBox ()
SO_NODE_ADD_FIELD(dimensionsOn, (true));
root = new SoSeparator();
SoSeparator *bboxSep = new SoSeparator();
auto bboxSep = new SoSeparator();
bboxCoords = new SoCoordinate3();
bboxCoords->point.setNum(8);
@@ -95,10 +95,10 @@ SoFCBoundingBox::SoFCBoundingBox ()
// create the text nodes, including a transform for each vertice offset
textSep = new SoSeparator();
for (int i = 0; i < 8; i++) {
SoSeparator *temp = new SoSeparator();
SoTransform *trans = new SoTransform();
auto temp = new SoSeparator();
auto trans = new SoTransform();
temp->addChild(trans);
SoText2* text = new SoText2();
auto text = new SoText2();
text->justification.setValue(SoText2::CENTER);
temp->addChild(text);
textSep->addChild(temp);
@@ -107,10 +107,10 @@ SoFCBoundingBox::SoFCBoundingBox ()
// create the text nodes, including a transform for each dimension
dimSep = new SoSeparator();
for (int i = 0; i < 3; i++) {
SoSeparator *temp = new SoSeparator();
SoTransform *trans = new SoTransform();
auto temp = new SoSeparator();
auto trans = new SoTransform();
temp->addChild(trans);
SoText2* text = new SoText2();
auto text = new SoText2();
text->justification.setValue(SoText2::CENTER);
temp->addChild(text);
dimSep->addChild(temp);