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

@@ -178,7 +178,7 @@ bool Constraint::getPoints(std::vector<Base::Vector3d> &points, std::vector<Base
if (sh.ShapeType() == TopAbs_VERTEX) {
const TopoDS_Vertex& vertex = TopoDS::Vertex(sh);
gp_Pnt p = BRep_Tool::Pnt(vertex);
points.push_back(Base::Vector3d(p.X(), p.Y(), p.Z()));
points.emplace_back(p.X(), p.Y(), p.Z());
normals.push_back(NormalDirection.getValue());
//OvG: Scale by whole object mass in case of a vertex
GProp_GProps props;
@@ -217,7 +217,7 @@ bool Constraint::getPoints(std::vector<Base::Vector3d> &points, std::vector<Base
for (int i = 0; i < steps + 1; i++) {
// Parameter values must be in the range [fp, lp] (#0003683)
gp_Pnt p = curve.Value(fp + i * step);
points.push_back(Base::Vector3d(p.X(), p.Y(), p.Z()));
points.emplace_back(p.X(), p.Y(), p.Z());
normals.push_back(NormalDirection.getValue());
}
}
@@ -331,10 +331,10 @@ bool Constraint::getPoints(std::vector<Base::Vector3d> &points, std::vector<Base
gp_Pnt p = surface.Value(u, v);
BRepClass_FaceClassifier classifier(face, p, Precision::Confusion());
if (classifier.State() != TopAbs_OUT) {
points.push_back(Base::Vector3d(p.X(), p.Y(), p.Z()));
points.emplace_back(p.X(), p.Y(), p.Z());
props.Normal(u, v,center,normal);
normal.Normalize();
normals.push_back(Base::Vector3d(normal.X(), normal.Y(), normal.Z()));
normals.emplace_back(normal.X(), normal.Y(), normal.Z());
}
}
}