Mod: use emplace_back

This commit is contained in:
berniev
2022-08-05 10:36:16 +02:00
committed by wwmayer
parent 6ac4d8392e
commit 2d4c5a4cfb
65 changed files with 254 additions and 265 deletions
+2 -2
View File
@@ -469,7 +469,7 @@ DocumentObjectExecReturn* FemPostScalarClipFilter::execute(void) {
for (int i = 0; i < pd->GetNumberOfArrays(); ++i) {
if (pd->GetArray(i)->GetNumberOfComponents() == 1)
array.push_back(pd->GetArrayName(i));
array.emplace_back(pd->GetArrayName(i));
}
App::Enumeration empty;
@@ -572,7 +572,7 @@ DocumentObjectExecReturn* FemPostWarpVectorFilter::execute(void) {
for (int i = 0; i < pd->GetNumberOfArrays(); ++i) {
if (pd->GetArray(i)->GetNumberOfComponents() == 3)
array.push_back(pd->GetArrayName(i));
array.emplace_back(pd->GetArrayName(i));
}
App::Enumeration empty;
@@ -126,7 +126,7 @@ std::vector<std::string> ViewProviderFemConstraint::getDisplayModes(void) const
{
// add modes
std::vector<std::string> StrList;
StrList.push_back("Base");
StrList.emplace_back("Base");
return StrList;
}
+6 -6
View File
@@ -334,12 +334,12 @@ void ViewProviderFemMesh::setDisplayMode(const char* ModeName)
std::vector<std::string> ViewProviderFemMesh::getDisplayModes(void) const
{
std::vector<std::string> StrList;
StrList.push_back(Private::dm_face_wire);
StrList.push_back(Private::dm_face_wire_node);
StrList.push_back(Private::dm_face);
StrList.push_back(Private::dm_wire);
StrList.push_back(Private::dm_node);
StrList.push_back(Private::dm_wire_node);
StrList.emplace_back(Private::dm_face_wire);
StrList.emplace_back(Private::dm_face_wire_node);
StrList.emplace_back(Private::dm_face);
StrList.emplace_back(Private::dm_wire);
StrList.emplace_back(Private::dm_node);
StrList.emplace_back(Private::dm_wire_node);
return StrList;
}
@@ -289,7 +289,7 @@ SoTransformManip* ViewProviderFemPostFunction::setupManipulator() {
std::vector<std::string> ViewProviderFemPostFunction::getDisplayModes(void) const
{
std::vector<std::string> StrList;
StrList.push_back("Default");
StrList.emplace_back("Default");
return StrList;
}
+14 -14
View File
@@ -285,13 +285,13 @@ void ViewProviderFemPostObject::setDisplayMode(const char* ModeName)
std::vector<std::string> ViewProviderFemPostObject::getDisplayModes(void) const
{
std::vector<std::string> StrList;
StrList.push_back("Outline");
StrList.push_back("Nodes");
StrList.emplace_back("Outline");
StrList.emplace_back("Nodes");
//StrList.push_back("Nodes (surface only)"); somehow this filter does not work
StrList.push_back("Surface");
StrList.push_back("Surface with Edges");
StrList.push_back("Wireframe");
StrList.push_back("Wireframe (surface only)");
StrList.emplace_back("Surface");
StrList.emplace_back("Surface with Edges");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Wireframe (surface only)");
return StrList;
}
@@ -316,7 +316,7 @@ void ViewProviderFemPostObject::updateProperties() {
val = Field.getValueAsString();
std::vector<std::string> colorArrays;
colorArrays.push_back("None");
colorArrays.emplace_back("None");
vtkPointData* point = poly->GetPointData();
for (int i = 0; i < point->GetNumberOfArrays(); ++i) {
@@ -327,7 +327,7 @@ void ViewProviderFemPostObject::updateProperties() {
vtkCellData* cell = poly->GetCellData();
for (int i = 0; i < cell->GetNumberOfArrays(); ++i)
colorArrays.push_back(cell->GetArrayName(i));
colorArrays.emplace_back(cell->GetArrayName(i));
App::Enumeration empty;
Field.setValue(empty);
@@ -346,22 +346,22 @@ void ViewProviderFemPostObject::updateProperties() {
colorArrays.clear();
if (Field.getValue() == 0)
colorArrays.push_back("Not a vector");
colorArrays.emplace_back("Not a vector");
else {
int array = Field.getValue() - 1; //0 is none
vtkPolyData* pd = m_currentAlgorithm->GetOutput();
vtkDataArray* data = pd->GetPointData()->GetArray(array);
if (data->GetNumberOfComponents() == 1)
colorArrays.push_back("Not a vector");
colorArrays.emplace_back("Not a vector");
else {
colorArrays.push_back("Magnitude");
colorArrays.emplace_back("Magnitude");
if (data->GetNumberOfComponents() >= 2) {
colorArrays.push_back("X");
colorArrays.push_back("Y");
colorArrays.emplace_back("X");
colorArrays.emplace_back("Y");
}
if (data->GetNumberOfComponents() >= 3)
colorArrays.push_back("Z");
colorArrays.emplace_back("Z");
}
}
+1 -1
View File
@@ -111,7 +111,7 @@ void ViewProviderImagePlane::setDisplayMode(const char* ModeName)
std::vector<std::string> ViewProviderImagePlane::getDisplayModes() const
{
std::vector<std::string> StrList;
StrList.push_back("ImagePlane");
StrList.emplace_back("ImagePlane");
return StrList;
}
@@ -380,7 +380,7 @@ std::vector<std::string> ViewProviderInspection::getDisplayModes(void) const
{
// add modes
std::vector<std::string> StrList;
StrList.push_back("Visual Inspection");
StrList.emplace_back("Visual Inspection");
return StrList;
}
+1 -1
View File
@@ -90,7 +90,7 @@ int Measurement::addReference3D(App::DocumentObject *obj, const char* subName)
std::vector<std::string> subElements = References3D.getSubValues();
objects.push_back(obj);
subElements.push_back(subName);
subElements.emplace_back(subName);
References3D.setValues(objects, subElements);
+2 -2
View File
@@ -153,8 +153,8 @@ const char* ViewProviderFace::getDefaultDisplayMode() const
std::vector<std::string> ViewProviderFace::getDisplayModes() const
{
std::vector<std::string> modes;
modes.push_back("Marker");
modes.push_back("Face");
modes.emplace_back("Marker");
modes.emplace_back("Face");
return modes;
}
+5 -5
View File
@@ -180,7 +180,7 @@ ViewProviderExport::~ViewProviderExport()
std::vector<std::string> ViewProviderExport::getDisplayModes() const
{
std::vector<std::string> mode;
mode.push_back("");
mode.emplace_back("");
return mode;
}
@@ -630,10 +630,10 @@ std::vector<std::string> ViewProviderMesh::getDisplayModes() const
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Flat Lines");
StrList.push_back("Points");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Points");
return StrList;
}
+6 -6
View File
@@ -417,11 +417,11 @@ std::vector<std::string> ViewProviderMeshCurvature::getDisplayModes() const
std::vector<std::string> StrList = inherited::getDisplayModes();
// add modes
StrList.push_back("Absolute curvature");
StrList.push_back("Mean curvature");
StrList.push_back("Gaussian curvature");
StrList.push_back("Maximum curvature");
StrList.push_back("Minimum curvature");
StrList.emplace_back("Absolute curvature");
StrList.emplace_back("Mean curvature");
StrList.emplace_back("Gaussian curvature");
StrList.emplace_back("Maximum curvature");
StrList.emplace_back("Minimum curvature");
return StrList;
}
@@ -477,7 +477,7 @@ public:
QStringList lines = s.split(QLatin1String("\n"));
std::vector<std::string> text;
for (QStringList::Iterator it = lines.begin(); it != lines.end(); ++it)
text.push_back((const char*)it->toLatin1());
text.emplace_back((const char*)it->toLatin1());
anno->LabelText.setValues(text);
std::stringstream str;
str << "Curvature info (" << group->Group.getSize() << ")";
+1 -1
View File
@@ -651,7 +651,7 @@ void ViewProviderMeshSelfIntersections::showDefects(const std::vector<Mesh::Elem
for (it = indices.begin(); it != indices.end(); ) {
Mesh::ElementIndex id1 = *it; ++it;
Mesh::ElementIndex 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;
+1 -1
View File
@@ -109,7 +109,7 @@ const char* ViewProviderMeshTransform::getDefaultDisplayMode() const
std::vector<std::string> ViewProviderMeshTransform::getDisplayModes() const
{
std::vector<std::string> StrList = ViewProviderMesh::getDisplayModes();
StrList.push_back("Transform");
StrList.emplace_back("Transform");
return StrList;
}
@@ -220,6 +220,6 @@ const char* ViewProviderMeshTransformDemolding::getDefaultDisplayMode() const
std::vector<std::string> ViewProviderMeshTransformDemolding::getDisplayModes() const
{
std::vector<std::string> StrList = ViewProviderMesh::getDisplayModes();
StrList.push_back("Demold");
StrList.emplace_back("Demold");
return StrList;
}
+1 -1
View File
@@ -370,7 +370,7 @@ std::vector<App::Color> Tessellation::getUniqueColors(const std::vector<App::Col
std::vector<App::Color> unique;
for (const auto& it : col_set)
unique.push_back(App::Color(it));
unique.emplace_back(it);
return unique;
}
+1 -1
View File
@@ -69,7 +69,7 @@ void ExtrusionHelper::makeDraft(const TopoDS_Shape& shape,
TopExp_Explorer ex;
size_t i = 0;
for (ex.Init(shape, TopAbs_WIRE); ex.More(); ex.Next(), ++i) {
wiresections.push_back(std::vector<TopoDS_Shape>());
wiresections.emplace_back();
wiresections[i].push_back(TopoDS::Wire(ex.Current()));
}
return i;
+4 -4
View File
@@ -224,7 +224,7 @@ static int move_cb(const FT_Vector* pt, void* p) {
}
dc->LastVert = *pt;
if (dc->polyPoints.empty()) {
dc->polyPoints.push_back(Base::Vector3d(pt->x, pt->y, 0.0));
dc->polyPoints.emplace_back(pt->x, pt->y, 0.0);
}
return 0;
@@ -240,7 +240,7 @@ static int line_cb(const FT_Vector* pt, void* p) {
TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(lseg , dc->surf);
dc->Edges.push_back(edge);
dc->LastVert = *pt;
dc->polyPoints.push_back(Base::Vector3d(pt->x, pt->y, 0.0));
dc->polyPoints.emplace_back(pt->x, pt->y, 0.0);
}
return 0;
}
@@ -268,7 +268,7 @@ static int quad_cb(const FT_Vector* pt0, const FT_Vector* pt1, void* p) {
TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(spline , dc->surf);
dc->Edges.push_back(edge);
dc->LastVert = *pt1;
dc->polyPoints.push_back(Base::Vector3d(pt1->x, pt1->y, 0.0));
dc->polyPoints.emplace_back(pt1->x, pt1->y, 0.0);
return 0;
}
@@ -297,7 +297,7 @@ static int cubic_cb(const FT_Vector* pt0, const FT_Vector* pt1, const FT_Vector*
TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(spline , dc->surf);
dc->Edges.push_back(edge);
dc->LastVert = *pt2;
dc->polyPoints.push_back(Base::Vector3d(pt2->x, pt2->y, 0.0));
dc->polyPoints.emplace_back(pt2->x, pt2->y, 0.0);
return 0;
}
+24 -24
View File
@@ -1378,33 +1378,33 @@ namespace Part {
std::vector<std::string> buildShapeEnumVector()
{
std::vector<std::string> names;
names.push_back("Compound"); //TopAbs_COMPOUND
names.push_back("Compound Solid"); //TopAbs_COMPSOLID
names.push_back("Solid"); //TopAbs_SOLID
names.push_back("Shell"); //TopAbs_SHELL
names.push_back("Face"); //TopAbs_FACE
names.push_back("Wire"); //TopAbs_WIRE
names.push_back("Edge"); //TopAbs_EDGE
names.push_back("Vertex"); //TopAbs_VERTEX
names.push_back("Shape"); //TopAbs_SHAPE
names.emplace_back("Compound"); //TopAbs_COMPOUND
names.emplace_back("Compound Solid"); //TopAbs_COMPSOLID
names.emplace_back("Solid"); //TopAbs_SOLID
names.emplace_back("Shell"); //TopAbs_SHELL
names.emplace_back("Face"); //TopAbs_FACE
names.emplace_back("Wire"); //TopAbs_WIRE
names.emplace_back("Edge"); //TopAbs_EDGE
names.emplace_back("Vertex"); //TopAbs_VERTEX
names.emplace_back("Shape"); //TopAbs_SHAPE
return names;
}
std::vector<std::string> buildBOPCheckResultVector()
{
std::vector<std::string> results;
results.push_back("BOPAlgo CheckUnknown"); //BOPAlgo_CheckUnknown
results.push_back("BOPAlgo BadType"); //BOPAlgo_BadType
results.push_back("BOPAlgo SelfIntersect"); //BOPAlgo_SelfIntersect
results.push_back("BOPAlgo TooSmallEdge"); //BOPAlgo_TooSmallEdge
results.push_back("BOPAlgo NonRecoverableFace"); //BOPAlgo_NonRecoverableFace
results.push_back("BOPAlgo IncompatibilityOfVertex"); //BOPAlgo_IncompatibilityOfVertex
results.push_back("BOPAlgo IncompatibilityOfEdge"); //BOPAlgo_IncompatibilityOfEdge
results.push_back("BOPAlgo IncompatibilityOfFace"); //BOPAlgo_IncompatibilityOfFace
results.push_back("BOPAlgo OperationAborted"); //BOPAlgo_OperationAborted
results.push_back("BOPAlgo GeomAbs_C0"); //BOPAlgo_GeomAbs_C0
results.push_back("BOPAlgo_InvalidCurveOnSurface"); //BOPAlgo_InvalidCurveOnSurface
results.push_back("BOPAlgo NotValid"); //BOPAlgo_NotValid
results.emplace_back("BOPAlgo CheckUnknown"); //BOPAlgo_CheckUnknown
results.emplace_back("BOPAlgo BadType"); //BOPAlgo_BadType
results.emplace_back("BOPAlgo SelfIntersect"); //BOPAlgo_SelfIntersect
results.emplace_back("BOPAlgo TooSmallEdge"); //BOPAlgo_TooSmallEdge
results.emplace_back("BOPAlgo NonRecoverableFace"); //BOPAlgo_NonRecoverableFace
results.emplace_back("BOPAlgo IncompatibilityOfVertex"); //BOPAlgo_IncompatibilityOfVertex
results.emplace_back("BOPAlgo IncompatibilityOfEdge"); //BOPAlgo_IncompatibilityOfEdge
results.emplace_back("BOPAlgo IncompatibilityOfFace"); //BOPAlgo_IncompatibilityOfFace
results.emplace_back("BOPAlgo OperationAborted"); //BOPAlgo_OperationAborted
results.emplace_back("BOPAlgo GeomAbs_C0"); //BOPAlgo_GeomAbs_C0
results.emplace_back("BOPAlgo_InvalidCurveOnSurface"); //BOPAlgo_InvalidCurveOnSurface
results.emplace_back("BOPAlgo NotValid"); //BOPAlgo_NotValid
return results;
}
}
@@ -4010,7 +4010,7 @@ TopoShape &TopoShape::makeWires(const TopoShape &shape, const char *op, bool fix
TopTools_IndexedMapOfShape anIndices;
TopExp::MapShapes(shape.getShape(), TopAbs_EDGE, anIndices);
for(int i=1;i<=anIndices.Extent();++i)
edge_list.push_back(anIndices.FindKey(i));
edge_list.emplace_back(anIndices.FindKey(i));
edges.reserve(edge_list.size());
wires.reserve(edge_list.size());
@@ -4053,7 +4053,7 @@ TopoShape &TopoShape::makeWires(const TopoShape &shape, const char *op, bool fix
// Assuming FixReorder() just reorder and don't change the underlying
// edges, we get the wire and do a name mapping now, as the following
// two operations (FixConnected and FixClosed) may change the edges.
wires.push_back(aFix.Wire());
wires.emplace_back(aFix.Wire());
aFix.FixConnected();
aFix.FixClosed();
@@ -4099,7 +4099,7 @@ TopoShape &TopoShape::makeFace(const TopoShape &shape, const char *op, const cha
std::vector<TopoShape> shapes;
if(shape.shapeType() == TopAbs_COMPOUND) {
for(TopoDS_Iterator it(shape.getShape());it.More();it.Next())
shapes.push_back(it.Value());
shapes.emplace_back(it.Value());
} else
shapes.push_back(shape);
return makeFace(shapes,op,maker);
+1 -1
View File
@@ -1901,7 +1901,7 @@ void CmdPartThickness::activated(int iMsg)
topoShape = Part::Feature::getTopoShape(obj);
if (!topoShape.isNull()) {
for (std::vector<std::string>::const_iterator it = subnames.begin(); it != subnames.end(); ++it) {
subShapes.push_back(topoShape.getSubShape(subnames[0].c_str()));
subShapes.emplace_back(topoShape.getSubShape(subnames[0].c_str()));
}
for (std::vector<Part::TopoShape>::iterator it = subShapes.begin(); it != subShapes.end(); ++it) {
TopoDS_Shape dsShape = (*it).getShape();
+1 -1
View File
@@ -553,7 +553,7 @@ void DlgExtrusion::getAxisLink(App::PropertyLinkSub& lnk) const
return;
} else if (parts.size() == 2) {
std::vector<std::string> subs;
subs.push_back(std::string(parts[1].toLatin1().constData()));
subs.emplace_back(parts[1].toLatin1().constData());
lnk.setValue(obj,subs);
}
}
+1 -1
View File
@@ -167,7 +167,7 @@ public:
bool pickedPoint(const SoPickedPoint * point)
{
SbVec3f pnt = point->getPoint();
points.push_back(gp_Pnt(pnt[0],pnt[1],pnt[2]));
points.emplace_back(pnt[0],pnt[1],pnt[2]);
return points.size() == 3;
}
QString command(App::Document* doc) const
+1 -1
View File
@@ -181,7 +181,7 @@ void DlgRevolution::getAxisLink(App::PropertyLinkSub &lnk) const
return;
} else if (parts.size() == 2) {
std::vector<std::string> subs;
subs.push_back(std::string(parts[1].toLatin1().constData()));
subs.emplace_back(parts[1].toLatin1().constData());
lnk.setValue(obj,subs);
}
}
+2 -2
View File
@@ -112,7 +112,7 @@ SectionCut::SectionCut(QWidget* parent)
// now store those that are currently visible
for (auto it = ObjectsList.begin(); it != ObjectsList.end(); ++it) {
if ((*it)->Visibility.getValue())
ObjectsListVisible.push_back(*it);
ObjectsListVisible.emplace_back(*it);
}
// lambda function to set color and transparency
@@ -1532,7 +1532,7 @@ void SectionCut::onRefreshCutPBclicked()
// now store those that are currently visible
for (auto it = ObjectsList.begin(); it != ObjectsList.end(); ++it) {
if ((*it)->Visibility.getValue()) {
ObjectsListVisible.push_back(*it);
ObjectsListVisible.emplace_back(*it);
}
}
// reset defaults
+2 -2
View File
@@ -106,7 +106,7 @@ void TaskAttacher::makeRefStrings(std::vector<QString>& refstrings, std::vector<
refnames[r] = refs[r]->getNameInDocument();
} else {
refstrings.push_back(QObject::tr("No reference selected"));
refnames.push_back("");
refnames.emplace_back("");
}
}
}
@@ -661,7 +661,7 @@ void TaskAttacher::onRefName(const QString& text, unsigned idx)
refnames[idx] = subElement.c_str();
} else {
refs.push_back(obj);
refnames.push_back(subElement.c_str());
refnames.emplace_back(subElement.c_str());
}
pcAttach->Support.setValues(refs, refnames);
updateListOfModes();
+3 -3
View File
@@ -364,10 +364,10 @@ std::vector<std::string> ViewProvider2DObject::getDisplayModes(void) const
std::vector<std::string> StrList = ViewProviderGeometryObject::getDisplayModes();
// add your own modes
StrList.push_back("Flat Lines");
StrList.emplace_back("Flat Lines");
//StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
+4 -4
View File
@@ -54,10 +54,10 @@ std::vector<std::string> ViewProviderBox::getDisplayModes(void) const
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -54,8 +54,8 @@ std::vector<std::string> ViewProviderCircleParametric::getDisplayModes(void) con
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -54,10 +54,10 @@ std::vector<std::string> ViewProviderConeParametric::getDisplayModes(void) const
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
+1 -1
View File
@@ -135,7 +135,7 @@ std::vector<std::string> ViewProviderCurveNet::getDisplayModes(void) const
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Edge");
StrList.emplace_back("Edge");
return StrList;
}
@@ -54,10 +54,10 @@ std::vector<std::string> ViewProviderCylinderParametric::getDisplayModes(void) c
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -54,8 +54,8 @@ std::vector<std::string> ViewProviderEllipseParametric::getDisplayModes(void) co
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
+4 -4
View File
@@ -475,10 +475,10 @@ std::vector<std::string> ViewProviderPartExt::getDisplayModes(void) const
std::vector<std::string> StrList = ViewProviderGeometryObject::getDisplayModes();
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -50,8 +50,8 @@ std::vector<std::string> ViewProviderHelixParametric::getDisplayModes(void) cons
{
// add your own modes
std::vector<std::string> StrList;
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -81,8 +81,8 @@ std::vector<std::string> ViewProviderSpiralParametric::getDisplayModes(void) con
{
// add your own modes
std::vector<std::string> StrList;
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -54,8 +54,8 @@ std::vector<std::string> ViewProviderLineParametric::getDisplayModes(void) const
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -51,10 +51,10 @@ std::vector<std::string> ViewProviderPlaneParametric::getDisplayModes(void) cons
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -54,10 +54,10 @@ std::vector<std::string> ViewProviderPointParametric::getDisplayModes(void) cons
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
+8 -8
View File
@@ -52,10 +52,10 @@ std::vector<std::string> ViewProviderPrism::getDisplayModes(void) const
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -84,10 +84,10 @@ std::vector<std::string> ViewProviderWedge::getDisplayModes(void) const
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
+4 -4
View File
@@ -232,10 +232,10 @@ std::vector<std::string> ViewProviderPartReference::getDisplayModes(void) const
std::vector<std::string> StrList = ViewProviderGeometryObject::getDisplayModes();
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -54,8 +54,8 @@ std::vector<std::string> ViewProviderRegularPolygon::getDisplayModes(void) const
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -102,10 +102,10 @@ std::vector<std::string> ViewProviderRuledSurface::getDisplayModes(void) const
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -47,10 +47,10 @@ std::vector<std::string> ViewProviderSphereParametric::getDisplayModes(void) con
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -73,10 +73,10 @@ std::vector<std::string> ViewProviderEllipsoid::getDisplayModes(void) const
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
@@ -54,10 +54,10 @@ std::vector<std::string> ViewProviderTorusParametric::getDisplayModes(void) cons
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
StrList.emplace_back("Flat Lines");
StrList.emplace_back("Shaded");
StrList.emplace_back("Wireframe");
StrList.emplace_back("Points");
return StrList;
}
+5 -5
View File
@@ -159,7 +159,7 @@ void DressUp::getContinuousEdges(Part::TopoShape TopShape, std::vector< std::str
}
FaceNames.push_back(aSubName.c_str());
FaceNames.emplace_back(aSubName.c_str());
SubNames.erase(SubNames.begin()+i);
}
// empty name or any other sub-element
@@ -231,7 +231,7 @@ void DressUp::getAddSubShape(Part::TopoShape &addShape, Part::TopoShape &subShap
baseShape.move(base->getLocation().Inverted());
if (base->getAddSubType() == Additive) {
if(!baseShape.isNull() && baseShape.hasSubShape(TopAbs_SOLID))
shapes.push_back(shape.cut(baseShape.getShape()));
shapes.emplace_back(shape.cut(baseShape.getShape()));
else
shapes.push_back(shape);
} else {
@@ -241,15 +241,15 @@ void DressUp::getAddSubShape(Part::TopoShape &addShape, Part::TopoShape &subShap
// push an empty compound to indicate null additive shape
shapes.emplace_back(comp);
if(!baseShape.isNull() && baseShape.hasSubShape(TopAbs_SOLID))
shapes.push_back(baseShape.cut(shape.getShape()));
shapes.emplace_back(baseShape.cut(shape.getShape()));
else
shapes.push_back(shape);
}
} else {
baseShape = getBaseTopoShape();
baseShape.move(getLocation().Inverted());
shapes.push_back(shape.cut(baseShape.getShape()));
shapes.push_back(baseShape.cut(shape.getShape()));
shapes.emplace_back(shape.cut(baseShape.getShape()));
shapes.emplace_back(baseShape.cut(shape.getShape()));
}
// Make a compound to contain both additive and subtractive shape,
+2 -2
View File
@@ -444,7 +444,7 @@ void SubShapeBinder::setupCopyOnChange() {
hasCopyOnChange = App::LinkBaseExtension::setupCopyOnChange(this, linked,
BindCopyOnChange.getValue() == 1 ? &copyOnChangeConns : nullptr, hasCopyOnChange);
if (hasCopyOnChange) {
copyOnChangeConns.push_back(linked->signalChanged.connect(
copyOnChangeConns.emplace_back(linked->signalChanged.connect(
[this](const App::DocumentObject&, const App::Property& prop) {
if (!prop.testStatus(App::Property::Output)
&& !prop.testStatus(App::Property::PropOutput))
@@ -907,7 +907,7 @@ void SubShapeBinder::setLinks(std::map<App::DocumentObject*, std::vector<std::st
FC_THROWM(Base::ValueError, "Cyclic reference to " << v.first->getFullName());
if (v.second.empty()) {
v.second.push_back("");
v.second.emplace_back("");
continue;
}
@@ -144,7 +144,7 @@ bool TaskDlgDatumParameters::accept() {
if (copy) {
copyObjects.push_back(copy);
copies.push_back(copyObjects.back());
copySubValues.push_back(std::string());
copySubValues.emplace_back();
}
}
else {
@@ -486,11 +486,10 @@ bool TaskPipeParameters::accept()
for (auto &subSet : pcPipe->Sections.getSubListValues()) {
if (!pcActiveBody->hasObject(subSet.first) &&
!pcActiveBody->getOrigin()->hasObject(subSet.first)) {
subSets.push_back(
std::make_pair(
subSets.emplace_back(
PartDesignGui::TaskFeaturePick::makeCopy(
subSet.first, "", dlg.radioIndependent->isChecked()),
subSet.second));
subSet.second);
copies.push_back(subSets.back().first);
}
else {
+1 -1
View File
@@ -153,7 +153,7 @@ void Voronoi::addSegment(const Voronoi::segment_type &s) {
pil.y(low(s).y() * vd->getScale());
pih.x(high(s).x() * vd->getScale());
pih.y(high(s).y() * vd->getScale());
vd->segments.push_back(segment_type(pil, pih));
vd->segments.emplace_back(pil, pih);
}
long Voronoi::numPoints() const {
+1 -1
View File
@@ -294,7 +294,7 @@ void ViewProviderPath::setDisplayMode(const char* ModeName)
std::vector<std::string> ViewProviderPath::getDisplayModes(void) const
{
std::vector<std::string> StrList;
StrList.push_back("Waypoints");
StrList.emplace_back("Waypoints");
return StrList;
}
+47 -57
View File
@@ -1357,66 +1357,61 @@ void E57Reader::read(const std::string& filename)
if ((n.type() == e57::E57_FLOAT) || (n.type() == e57::E57_SCALED_INTEGER)) {
if (n.elementName() == "cartesianX") {
ptr_xyz[0] = cnt_xyz++;
sdb.push_back(
e57::SourceDestBuffer(
sdb.emplace_back(
imfi
, n.elementName()
, &(xyz[0])
, buf_size
, true
, true
)
);
}
else if (n.elementName() == "cartesianY") {
ptr_xyz[1] = cnt_xyz++;
sdb.push_back(
e57::SourceDestBuffer(
sdb.emplace_back(
imfi
, n.elementName()
, &(xyz[buf_size])
, buf_size
, true
, true
)
);
}
else if (n.elementName() == "cartesianZ") {
ptr_xyz[2] = cnt_xyz++;
sdb.push_back(
e57::SourceDestBuffer(
sdb.emplace_back(
imfi
, n.elementName()
, &(xyz[2 * buf_size])
, buf_size
, true
, true
)
);
}
else if (n.elementName() == "intensity") {
inty = true;
sdb.push_back(
e57::SourceDestBuffer(
sdb.emplace_back(
imfi
, n.elementName()
, &(intensity[0])
, buf_size
, true
, true
)
);
}
else {
sdb.push_back(
e57::SourceDestBuffer(
sdb.emplace_back(
imfi
, n.elementName()
, &(nil[0])
, buf_size
, true
, true
)
);
}
@@ -1424,66 +1419,61 @@ void E57Reader::read(const std::string& filename)
else if (n.type() == e57::E57_INTEGER) {
if (n.elementName() == "colorRed") {
ptr_rgb[0] = cnt_rgb++;
sdb.push_back(
e57::SourceDestBuffer(
sdb.emplace_back(
imfi
, n.elementName()
, &(rgb[0])
, buf_size
, true
, true
)
);
}
else if (n.elementName() == "colorGreen") {
ptr_rgb[1] = cnt_rgb++;
sdb.push_back(
e57::SourceDestBuffer(
sdb.emplace_back(
imfi
, n.elementName()
, &(rgb[buf_size])
, buf_size
, true
, true
)
);
}
else if (n.elementName() == "colorBlue") {
ptr_rgb[2] = cnt_rgb++;
sdb.push_back(
e57::SourceDestBuffer(
sdb.emplace_back(
imfi
, n.elementName()
, &(rgb[2 * buf_size])
, buf_size
, true
, true
)
);
}
else if (n.elementName() == "cartesianInvalidState") {
inv_state = true;
sdb.push_back(
e57::SourceDestBuffer(
sdb.emplace_back(
imfi
, n.elementName()
, &(state[0])
, buf_size
, true
, true
)
);
}
else {
sdb.push_back(
e57::SourceDestBuffer(
sdb.emplace_back(
imfi
, n.elementName()
, &(nil[0])
, buf_size
, true
, true
)
);
}
}
@@ -1619,9 +1609,9 @@ PlyWriter::~PlyWriter()
void PlyWriter::write(const std::string& filename)
{
std::list<std::string> properties;
properties.push_back("float x");
properties.push_back("float y");
properties.push_back("float z");
properties.emplace_back("float x");
properties.emplace_back("float y");
properties.emplace_back("float z");
ConverterPtr convert_float(new ConverterT<float>);
ConverterPtr convert_uint(new ConverterT<uint32_t>);
@@ -1636,19 +1626,19 @@ void PlyWriter::write(const std::string& filename)
bool hasNormals = (normals.size() == points.size());
if (hasNormals) {
properties.push_back("float nx");
properties.push_back("float ny");
properties.push_back("float nz");
properties.emplace_back("float nx");
properties.emplace_back("float ny");
properties.emplace_back("float nz");
converters.push_back(convert_float);
converters.push_back(convert_float);
converters.push_back(convert_float);
}
if (hasColors) {
properties.push_back("uchar red");
properties.push_back("uchar green");
properties.push_back("uchar blue");
properties.push_back("uchar alpha");
properties.emplace_back("uchar red");
properties.emplace_back("uchar green");
properties.emplace_back("uchar blue");
properties.emplace_back("uchar alpha");
converters.push_back(convert_uint);
converters.push_back(convert_uint);
converters.push_back(convert_uint);
@@ -1656,7 +1646,7 @@ void PlyWriter::write(const std::string& filename)
}
if (hasIntensity) {
properties.push_back("float intensity");
properties.emplace_back("float intensity");
converters.push_back(convert_float);
}
@@ -1778,14 +1768,14 @@ PcdWriter::~PcdWriter()
void PcdWriter::write(const std::string& filename)
{
std::list<std::string> fields;
fields.push_back("x");
fields.push_back("y");
fields.push_back("z");
fields.emplace_back("x");
fields.emplace_back("y");
fields.emplace_back("z");
std::list<std::string> types;
types.push_back("F");
types.push_back("F");
types.push_back("F");
types.emplace_back("F");
types.emplace_back("F");
types.emplace_back("F");
ConverterPtr convert_float(new ConverterT<float>);
ConverterPtr convert_uint(new ConverterT<uint32_t>);
@@ -1800,26 +1790,26 @@ void PcdWriter::write(const std::string& filename)
bool hasNormals = (normals.size() == points.size());
if (hasNormals) {
fields.push_back("normal_x");
fields.push_back("normal_y");
fields.push_back("normal_z");
types.push_back("F");
types.push_back("F");
types.push_back("F");
fields.emplace_back("normal_x");
fields.emplace_back("normal_y");
fields.emplace_back("normal_z");
types.emplace_back("F");
types.emplace_back("F");
types.emplace_back("F");
converters.push_back(convert_float);
converters.push_back(convert_float);
converters.push_back(convert_float);
}
if (hasColors) {
fields.push_back("rgba");
types.push_back("U");
fields.emplace_back("rgba");
types.emplace_back("U");
converters.push_back(convert_uint);
}
if (hasIntensity) {
fields.push_back("intensity");
types.push_back("F");
fields.emplace_back("intensity");
types.emplace_back("F");
converters.push_back(convert_float);
}
+4 -4
View File
@@ -249,16 +249,16 @@ void ViewProviderPoints::setDisplayMode(const char* ModeName)
std::vector<std::string> ViewProviderPoints::getDisplayModes() const
{
std::vector<std::string> StrList;
StrList.push_back("Points");
StrList.emplace_back("Points");
// FIXME: This way all display modes are added even if the points feature
// doesn't support it.
// For the future a more flexible way is needed to add new display modes
// at a later time
#if 1
StrList.push_back("Color");
StrList.push_back("Shaded");
StrList.push_back("Intensity");
StrList.emplace_back("Color");
StrList.emplace_back("Shaded");
StrList.emplace_back("Intensity");
#else
if (pcObject) {
@@ -149,9 +149,9 @@ void ViewProviderRobotObject::setDisplayMode(const char* ModeName)
std::vector<std::string> ViewProviderRobotObject::getDisplayModes(void) const
{
std::vector<std::string> StrList;
StrList.push_back("VRML");
StrList.push_back("Simple");
StrList.push_back("Off");
StrList.emplace_back("VRML");
StrList.emplace_back("Simple");
StrList.emplace_back("Off");
return StrList;
}
+1 -1
View File
@@ -133,7 +133,7 @@ void ViewProviderTrajectory::setDisplayMode(const char* ModeName)
std::vector<std::string> ViewProviderTrajectory::getDisplayModes(void) const
{
std::vector<std::string> StrList;
StrList.push_back("Waypoints");
StrList.emplace_back("Waypoints");
return StrList;
}
+10 -10
View File
@@ -4779,10 +4779,10 @@ void CmdSketcherConstrainRadius::activated(int iMsg)
double radius = arc->getRadius();
if(issegmentfixed) {
externalGeoIdRadiusMap.push_back(std::make_pair(GeoId, radius));
externalGeoIdRadiusMap.emplace_back(GeoId, radius);
}
else {
geoIdRadiusMap.push_back(std::make_pair(GeoId, radius));
geoIdRadiusMap.emplace_back(GeoId, radius);
}
nonpoles = true;
@@ -4792,10 +4792,10 @@ void CmdSketcherConstrainRadius::activated(int iMsg)
double radius = circle->getRadius();
if(issegmentfixed) {
externalGeoIdRadiusMap.push_back(std::make_pair(GeoId, radius));
externalGeoIdRadiusMap.emplace_back(GeoId, radius);
}
else {
geoIdRadiusMap.push_back(std::make_pair(GeoId, radius));
geoIdRadiusMap.emplace_back(GeoId, radius);
}
if(isBsplinePole(geom))
@@ -5076,10 +5076,10 @@ void CmdSketcherConstrainDiameter::activated(int iMsg)
double radius = arc->getRadius();
if(issegmentfixed) {
externalGeoIdDiameterMap.push_back(std::make_pair(GeoId, 2*radius));
externalGeoIdDiameterMap.emplace_back(GeoId, 2*radius);
}
else {
geoIdDiameterMap.push_back(std::make_pair(GeoId, 2*radius));
geoIdDiameterMap.emplace_back(GeoId, 2*radius);
}
}
else if (geom && geom->getTypeId() == Part::GeomCircle::getClassTypeId()) {
@@ -5093,10 +5093,10 @@ void CmdSketcherConstrainDiameter::activated(int iMsg)
}
if(issegmentfixed) {
externalGeoIdDiameterMap.push_back(std::make_pair(GeoId, 2*radius));
externalGeoIdDiameterMap.emplace_back(GeoId, 2*radius);
}
else {
geoIdDiameterMap.push_back(std::make_pair(GeoId, 2*radius));
geoIdDiameterMap.emplace_back(GeoId, 2*radius);
}
}
}
@@ -5366,10 +5366,10 @@ void CmdSketcherConstrainRadiam::activated(int iMsg)
continue;
if(issegmentfixed) {
externalGeoIdRadiamMap.push_back(std::make_pair(GeoId, radius));
externalGeoIdRadiamMap.emplace_back(GeoId, radius);
}
else {
geoIdRadiamMap.push_back(std::make_pair(GeoId, radius));
geoIdRadiamMap.emplace_back(GeoId, radius);
}
}
@@ -464,7 +464,7 @@ void ConstraintView::contextMenuEvent (QContextMenuEvent* event)
for (auto&& it : items) {
auto ci = static_cast<ConstraintItem*>(it);
std::string constraint_name = Sketcher::PropertyConstraintList::getConstraintName(ci->ConstraintNbr);
constraintSubNames.push_back(constraint_name.c_str());
constraintSubNames.emplace_back(constraint_name.c_str());
}
if(!constraintSubNames.empty())
@@ -82,7 +82,7 @@ void ViewProviderSheet::setDisplayMode(const char* ModeName)
std::vector<std::string> ViewProviderSheet::getDisplayModes(void) const
{
std::vector<std::string> StrList;
StrList.push_back("Spreadsheet");
StrList.emplace_back("Spreadsheet");
return StrList;
}
+13 -13
View File
@@ -373,8 +373,8 @@ void FillingPanel::open()
// highlight the referenced face
std::vector<App::PropertyLinkSubList::SubSet> links;
links.push_back(std::make_pair(editedObject->InitialFace.getValue(),
editedObject->InitialFace.getSubValues()));
links.emplace_back(editedObject->InitialFace.getValue(),
editedObject->InitialFace.getSubValues());
this->vp->highlightReferences(ViewProviderFilling::Face, links, true);
Gui::Selection().clearSelection();
@@ -420,8 +420,8 @@ void FillingPanel::slotDeletedObject(const Gui::ViewProviderDocumentObject& Obj)
// unhighlight the referenced face
std::vector<App::PropertyLinkSubList::SubSet> links;
links.push_back(std::make_pair(editedObject->InitialFace.getValue(),
editedObject->InitialFace.getSubValues()));
links.emplace_back(editedObject->InitialFace.getValue(),
editedObject->InitialFace.getSubValues());
this->vp->highlightReferences(ViewProviderFilling::Face, links, false);
}
}
@@ -444,8 +444,8 @@ bool FillingPanel::accept()
// unhighlight the referenced face
std::vector<App::PropertyLinkSubList::SubSet> links;
links.push_back(std::make_pair(editedObject->InitialFace.getValue(),
editedObject->InitialFace.getSubValues()));
links.emplace_back(editedObject->InitialFace.getValue(),
editedObject->InitialFace.getSubValues());
this->vp->highlightReferences(ViewProviderFilling::Face, links, false);
return true;
@@ -458,8 +458,8 @@ bool FillingPanel::reject()
// unhighlight the referenced face
std::vector<App::PropertyLinkSubList::SubSet> links;
links.push_back(std::make_pair(editedObject->InitialFace.getValue(),
editedObject->InitialFace.getSubValues()));
links.emplace_back(editedObject->InitialFace.getValue(),
editedObject->InitialFace.getSubValues());
this->vp->highlightReferences(ViewProviderFilling::Face, links, false);
selectionMode = None;
@@ -475,8 +475,8 @@ void FillingPanel::on_lineInitFaceName_textChanged(const QString& text)
// unhighlight the referenced face
std::vector<App::PropertyLinkSubList::SubSet> links;
links.push_back(std::make_pair(editedObject->InitialFace.getValue(),
editedObject->InitialFace.getSubValues()));
links.emplace_back(editedObject->InitialFace.getValue(),
editedObject->InitialFace.getSubValues());
this->vp->highlightReferences(ViewProviderFilling::Face, links, false);
editedObject->InitialFace.setValue(nullptr);
@@ -586,12 +586,12 @@ void FillingPanel::onSelectionChanged(const Gui::SelectionChanges& msg)
ui->lineInitFaceName->setText(text);
std::vector<std::string> subList;
subList.push_back(msg.pSubName);
subList.emplace_back(msg.pSubName);
editedObject->InitialFace.setValue(sel.getObject(), subList);
// highlight the referenced face
std::vector<App::PropertyLinkSubList::SubSet> links;
links.push_back(std::make_pair(sel.getObject(), subList));
links.emplace_back(sel.getObject(), subList);
this->vp->highlightReferences(ViewProviderFilling::Face, links, true);
Gui::Selection().rmvSelectionGate();
@@ -619,7 +619,7 @@ void FillingPanel::onSelectionChanged(const Gui::SelectionChanges& msg)
std::size_t count = objects.size();
objects.push_back(sel.getObject());
auto element = editedObject->BoundaryEdges.getSubValues();
element.push_back(msg.pSubName);
element.emplace_back(msg.pSubName);
editedObject->BoundaryEdges.setValues(objects, element);
// extend faces and continuities lists if needed
+1 -1
View File
@@ -397,7 +397,7 @@ void FillingEdgePanel::onSelectionChanged(const Gui::SelectionChanges& msg)
std::size_t count = objects.size();
objects.push_back(sel.getObject());
auto element = editedObject->UnboundEdges.getSubValues();
element.push_back(msg.pSubName);
element.emplace_back(msg.pSubName);
editedObject->UnboundEdges.setValues(objects, element);
// extend faces and continuities lists if needed
+1 -1
View File
@@ -272,7 +272,7 @@ void FillingVertexPanel::onSelectionChanged(const Gui::SelectionChanges& msg)
auto objects = editedObject->Points.getValues();
objects.push_back(sel.getObject());
auto element = editedObject->Points.getSubValues();
element.push_back(msg.pSubName);
element.emplace_back(msg.pSubName);
editedObject->Points.setValues(objects, element);
this->vp->highlightReferences(ViewProviderFilling::Vertex,
editedObject->Points.getSubListValues(), true);
+1 -1
View File
@@ -437,7 +437,7 @@ void GeomFillSurface::onSelectionChanged(const Gui::SelectionChanges& msg)
auto objects = editedObject->BoundaryList.getValues();
objects.push_back(sel.getObject());
auto element = editedObject->BoundaryList.getSubValues();
element.push_back(msg.pSubName);
element.emplace_back(msg.pSubName);
editedObject->BoundaryList.setValues(objects, element);
auto booleans = editedObject->ReversedList.getValues();
booleans.push_back(false);
+1 -1
View File
@@ -131,7 +131,7 @@ std::vector<std::string> DrawViewSymbol::getEditableFields()
while (!queryResult.next().isNull()) {
QDomElement tspan = model.toDomNode(queryResult.current().toNodeModelIndex()).toElement();
QString editableValue = tspan.firstChild().nodeValue();
editables.push_back(std::string(editableValue.toUtf8().constData()));
editables.emplace_back(editableValue.toUtf8().constData());
}
}
return editables;
+2 -2
View File
@@ -1347,8 +1347,8 @@ void CmdTechDrawLandmarkDimension::activated(int iMsg)
std::vector<App::DocumentObject*> refs2d;
std::vector<std::string> subs;
subs.push_back("Vertex1");
subs.push_back("Vertex1");
subs.emplace_back("Vertex1");
subs.emplace_back("Vertex1");
TechDraw::DrawPage* page = dvp->findParentPage();
std::string parentName = dvp->getNameInDocument();
std::string PageName = page->getNameInDocument();
+1 -1
View File
@@ -160,7 +160,7 @@ void TaskProjGroup::saveGroupState()
for( const auto it : multiView->Views.getValues() ) {
auto view( dynamic_cast<DrawProjGroupItem *>(it) );
if (view) {
m_saveViewNames.push_back(view->Type.getValueAsString());
m_saveViewNames.emplace_back(view->Type.getValueAsString());
}
}
}
+1 -1
View File
@@ -125,7 +125,7 @@ std::vector<std::string> ViewProviderPage::getDisplayModes(void) const
{
// get the modes of the father
std::vector<std::string> StrList = ViewProviderDocumentObject::getDisplayModes();
StrList.push_back("Drawing");
StrList.emplace_back("Drawing");
return StrList;
}
@@ -63,7 +63,7 @@ std::vector<std::string> ViewProviderProjGroup::getDisplayModes(void) const
{
// get the modes of the father
std::vector<std::string> StrList = ViewProviderDrawingView::getDisplayModes();
StrList.push_back("Drawing");
StrList.emplace_back("Drawing");
return StrList;
}
@@ -126,21 +126,21 @@ bool ViewProviderProjGroup::onDelete(const std::vector<std::string> &)
// add names to a list
if (!viewSection.empty()) {
for (auto SecIterator : viewSection) {
ViewList.push_back(SecIterator->Label.getValue());
ViewList.emplace_back(SecIterator->Label.getValue());
}
}
// get its detail views
auto viewDetail = Item->getDetailRefs();
if (!viewDetail.empty()) {
for (auto DetIterator : viewDetail) {
ViewList.push_back(DetIterator->Label.getValue());
ViewList.emplace_back(DetIterator->Label.getValue());
}
}
// get its leader lines
auto viewLead = Item->getLeaders();
if (!viewLead.empty()) {
for (auto LeadIterator : viewLead) {
ViewList.push_back(LeadIterator->Label.getValue());
ViewList.emplace_back(LeadIterator->Label.getValue());
}
}
}
@@ -55,7 +55,7 @@ std::vector<std::string> ViewProviderProjGroupItem::getDisplayModes(void) const
{
// get the modes of the father
std::vector<std::string> StrList = ViewProviderViewPart::getDisplayModes();
StrList.push_back("Drawing");
StrList.emplace_back("Drawing");
return StrList;
}