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

@@ -1006,8 +1006,7 @@ void SoFCIndexedFaceSet::stopSelection(SoAction * action)
GLint index=0;
for (GLint ii=0;ii<hits && index<bufSize;ii++) {
GLint ct = (GLint)selectBuf[index];
hit.push_back(std::pair<double,unsigned int>
(selectBuf[index+1]/4294967295.0,selectBuf[index+3]));
hit.emplace_back(selectBuf[index+1]/4294967295.0,selectBuf[index+3]);
index = index+ct+3;
}

View File

@@ -1046,8 +1046,7 @@ void SoFCMeshObjectShape::stopSelection(SoAction * action, const Mesh::MeshObjec
GLuint index=0;
for (GLint ii=0;ii<hits && index<bufSize;ii++) {
GLint ct = (GLint)selectBuf[index];
hit.push_back(std::pair<double,unsigned int>
(selectBuf[index+1]/4294967295.0,selectBuf[index+3]));
hit.emplace_back(selectBuf[index+1]/4294967295.0,selectBuf[index+3]);
index = index+ct+3;
}

View File

@@ -709,7 +709,7 @@ void ViewProviderMesh::exportMesh(const char* filename, const char* fmt) const
mat.diffuseColor.reserve(numColors);
for (int i=0; i<numColors; i++) {
const SbColor& c = colors[i];
mat.diffuseColor.push_back(App::Color(c[0], c[1], c[2]));
mat.diffuseColor.emplace_back(c[0], c[1], c[2]);
}
Mesh::MeshObject mesh = static_cast<Mesh::Feature*>(getObject())->Mesh.getValue();
@@ -801,12 +801,12 @@ bool ViewProviderMesh::createToolMesh(const std::vector<SbVec2f>& rclPoly, const
if (it+1 < rclPoly.end()) {
pt1.getValue(fX, fY, fZ);
top.push_back( Base::Vector3f(fX, fY, fZ) );
top.emplace_back(fX, fY, fZ );
pt2.getValue(fX, fY, fZ);
bottom.push_back( Base::Vector3f(fX, fY, fZ) );
bottom.emplace_back(fX, fY, fZ );
// polygon we need to triangulate (in x,y-plane)
it->getValue(fX, fY);
polygon.push_back( Base::Vector3f(fX, fY, 0.0f) );
polygon.emplace_back(fX, fY, 0.0f );
}
}

View File

@@ -646,7 +646,7 @@ void ViewProviderMeshSelfIntersections::showDefects(const std::vector<unsigned l
for (it = indices.begin(); it != indices.end(); ) {
unsigned long id1 = *it; ++it;
unsigned long id2 = *it; ++it;
intersection.push_back(std::make_pair(id1,id2));
intersection.emplace_back(id1,id2);
}
std::vector<std::pair<Base::Vector3f, Base::Vector3f> > lines;

View File

@@ -141,7 +141,7 @@ void ViewProviderMeshTransformDemolding::calcNormalVector(void)
const MeshGeomFacet& rFace = *cFIt;
Base::Vector3f norm(rFace.GetNormal());
normalVector.push_back(SbVec3f(norm.x,norm.y,norm.z));
normalVector.emplace_back(norm.x,norm.y,norm.z);
}
}