use emplace_back instead of push_back where justified

This commit is contained in:
asapelkin
2019-10-25 00:57:12 +03:00
committed by wmayer
parent 079808b816
commit e951094af9
67 changed files with 239 additions and 241 deletions

View File

@@ -3021,7 +3021,7 @@ bool Sketch::updateGeometry()
std::vector<double *>::const_iterator it2;
for( it1 = mybsp.poles.begin(), it2 = mybsp.weights.begin(); it1 != mybsp.poles.end() && it2 != mybsp.weights.end(); ++it1, ++it2) {
poles.push_back(Vector3d( *(*it1).x , *(*it1).y , 0.0));
poles.emplace_back( *(*it1).x , *(*it1).y , 0.0);
weights.push_back(*(*it2));
}

View File

@@ -5287,7 +5287,7 @@ int SketchObject::addExternal(App::DocumentObject *Obj, const char* SubName)
// add the new ones
Objects.push_back(Obj);
SubElements.push_back(std::string(SubName));
SubElements.emplace_back(SubName);
// set the Link list.
ExternalGeometry.setValues(Objects,SubElements);

View File

@@ -3554,7 +3554,7 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer
int stdcountsegments = hGrp->GetInt("SegmentsPerGeometry", 50);
// RootPoint
Points.push_back(Base::Vector3d(0.,0.,0.));
Points.emplace_back(0.,0.,0.);
for (std::vector<Part::Geometry *>::const_iterator it = geomlist->begin(); it != geomlist->end()-2; ++it, GeoId++) {
if (GeoId >= intGeoCount)
@@ -3585,11 +3585,11 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer
double segment = (2 * M_PI) / countSegments;
for (int i=0; i < countSegments; i++) {
gp_Pnt pnt = curve->Value(i*segment);
Coords.push_back(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()));
Coords.emplace_back(pnt.X(), pnt.Y(), pnt.Z());
}
gp_Pnt pnt = curve->Value(0);
Coords.push_back(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()));
Coords.emplace_back(pnt.X(), pnt.Y(), pnt.Z());
Index.push_back(countSegments+1);
edit->CurvIdToGeoId.push_back(GeoId);
@@ -3605,11 +3605,11 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer
double segment = (2 * M_PI) / countSegments;
for (int i=0; i < countSegments; i++) {
gp_Pnt pnt = curve->Value(i*segment);
Coords.push_back(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()));
Coords.emplace_back(pnt.X(), pnt.Y(), pnt.Z());
}
gp_Pnt pnt = curve->Value(0);
Coords.push_back(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()));
Coords.emplace_back(pnt.X(), pnt.Y(), pnt.Z());
Index.push_back(countSegments+1);
edit->CurvIdToGeoId.push_back(GeoId);
@@ -3635,13 +3635,13 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer
for (int i=0; i < countSegments; i++) {
gp_Pnt pnt = curve->Value(startangle);
Coords.push_back(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()));
Coords.emplace_back(pnt.X(), pnt.Y(), pnt.Z());
startangle += segment;
}
// end point
gp_Pnt pnt = curve->Value(endangle);
Coords.push_back(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()));
Coords.emplace_back(pnt.X(), pnt.Y(), pnt.Z());
Index.push_back(countSegments+1);
edit->CurvIdToGeoId.push_back(GeoId);
@@ -3671,13 +3671,13 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer
for (int i=0; i < countSegments; i++) {
gp_Pnt pnt = curve->Value(startangle);
Coords.push_back(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()));
Coords.emplace_back(pnt.X(), pnt.Y(), pnt.Z());
startangle += segment;
}
// end point
gp_Pnt pnt = curve->Value(endangle);
Coords.push_back(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()));
Coords.emplace_back(pnt.X(), pnt.Y(), pnt.Z());
Index.push_back(countSegments+1);
edit->CurvIdToGeoId.push_back(GeoId);
@@ -3707,13 +3707,13 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer
for (int i=0; i < countSegments; i++) {
gp_Pnt pnt = curve->Value(startangle);
Coords.push_back(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()));
Coords.emplace_back(pnt.X(), pnt.Y(), pnt.Z());
startangle += segment;
}
// end point
gp_Pnt pnt = curve->Value(endangle);
Coords.push_back(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()));
Coords.emplace_back(pnt.X(), pnt.Y(), pnt.Z());
Index.push_back(countSegments+1);
edit->CurvIdToGeoId.push_back(GeoId);
@@ -3743,13 +3743,13 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer
for (int i=0; i < countSegments; i++) {
gp_Pnt pnt = curve->Value(startangle);
Coords.push_back(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()));
Coords.emplace_back(pnt.X(), pnt.Y(), pnt.Z());
startangle += segment;
}
// end point
gp_Pnt pnt = curve->Value(endangle);
Coords.push_back(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()));
Coords.emplace_back(pnt.X(), pnt.Y(), pnt.Z());
Index.push_back(countSegments+1);
edit->CurvIdToGeoId.push_back(GeoId);
@@ -3779,13 +3779,13 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer
for (int i=0; i < countSegments; i++) {
gp_Pnt pnt = curve->Value(first);
Coords.push_back(Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()));
Coords.emplace_back(pnt.X(), pnt.Y(), pnt.Z());
first += segment;
}
// end point
gp_Pnt end = curve->Value(last);
Coords.push_back(Base::Vector3d(end.X(), end.Y(), end.Z()));
Coords.emplace_back(end.X(), end.Y(), end.Z());
Index.push_back(countSegments+1);
edit->CurvIdToGeoId.push_back(GeoId);