use emplace_back instead of push_back where justified
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ std::list<std::pair<int, int> > FemMesh::getVolumesByFace(const TopoDS_Face &fac
|
||||
|
||||
// For curved faces it is possible that a volume contributes more than one face
|
||||
if (element_face_nodes.size() == static_cast<std::size_t>(numNodes)) {
|
||||
result.push_back(std::make_pair(vol->GetID(), face->GetID()));
|
||||
result.emplace_back(vol->GetID(), face->GetID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user