diff --git a/Common/Core/vtkDataArraySelection.cxx b/Common/Core/vtkDataArraySelection.cxx index c80b0f4757fe8585b5e3f2c3ef6023bab80a2f1f..219bad9b9593bec14b0ef7cfb560abb6792ebb80 100644 --- a/Common/Core/vtkDataArraySelection.cxx +++ b/Common/Core/vtkDataArraySelection.cxx @@ -117,7 +117,7 @@ void vtkDataArraySelection::SetArraySetting(const char* name, int setting) } else if (name) { - internal.Arrays.push_back(vtkInternals::ArraySettingPair(name, status)); + internal.Arrays.emplace_back(name, status); this->Modified(); } } @@ -276,7 +276,7 @@ int vtkDataArraySelection::AddArray(const char* name, bool state) { return 0; } - this->Internal->Arrays.push_back(vtkInternals::ArraySettingPair(name, state)); + this->Internal->Arrays.emplace_back(name, state); return 1; } @@ -331,7 +331,7 @@ void vtkDataArraySelection::SetArraysWithDefault( { setting = iter->second; } - newInternal->Arrays.push_back(vtkInternals::ArraySettingPair(names[i], setting)); + newInternal->Arrays.emplace_back(names[i], setting); } // Delete the old map and save the new one. diff --git a/Common/Core/vtkGarbageCollector.cxx b/Common/Core/vtkGarbageCollector.cxx index 87d0a088ec402e9003f0762e6999d2c4b43355ff..9de215cf9a0b15f1d8e3dabe58925d8943677748 100644 --- a/Common/Core/vtkGarbageCollector.cxx +++ b/Common/Core/vtkGarbageCollector.cxx @@ -646,7 +646,7 @@ void vtkGarbageCollectorImpl::Report(vtkObjectBase* obj, void* ptr) } // Save this reference. - v->References.push_back(EntryEdge(w, ptr)); + v->References.emplace_back(w, ptr); } //------------------------------------------------------------------------------ diff --git a/Common/DataModel/vtkIncrementalOctreePointLocator.cxx b/Common/DataModel/vtkIncrementalOctreePointLocator.cxx index 1da9f8742730ad03dba1455d72ca66e7320c0f3c..284214f431194ce7bf9ca4715ac5717bf19b49cd 100644 --- a/Common/DataModel/vtkIncrementalOctreePointLocator.cxx +++ b/Common/DataModel/vtkIncrementalOctreePointLocator.cxx @@ -305,7 +305,7 @@ void vtkIncrementalOctreePointLocator::GenerateRepresentation(int nodeLevel, vtk std::queue<std::pair<vtkIncrementalOctreeNode*, int>> pairQueue; // recursively process the nodes in the octree - pairQueue.push(std::make_pair(this->OctreeRootNode, 0)); + pairQueue.emplace(this->OctreeRootNode, 0); while (!pairQueue.empty()) { pTempNode = pairQueue.front().first; @@ -320,7 +320,7 @@ void vtkIncrementalOctreePointLocator::GenerateRepresentation(int nodeLevel, vtk { for (int i = 0; i < 8; i++) { - pairQueue.push(std::make_pair(pTempNode->GetChild(i), tempLevel + 1)); + pairQueue.emplace(pTempNode->GetChild(i), tempLevel + 1); } } } diff --git a/Common/DataModel/vtkOctreePointLocator.cxx b/Common/DataModel/vtkOctreePointLocator.cxx index ed1c787cc8fbe36d26ae0ce69c0862379f982ae1..82464f518c9b6861c1e9ddbe575c33651aec826c 100644 --- a/Common/DataModel/vtkOctreePointLocator.cxx +++ b/Common/DataModel/vtkOctreePointLocator.cxx @@ -1030,7 +1030,7 @@ void vtkOctreePointLocator::GenerateRepresentation(int level, vtkPolyData* pd) std::list<vtkOctreePointLocatorNode*> nodesAtLevel; // queue of nodes to be examined and what level each one is at std::queue<std::pair<vtkOctreePointLocatorNode*, int>> testNodes; - testNodes.push(std::make_pair(this->Top, 0)); + testNodes.emplace(this->Top, 0); while (!testNodes.empty()) { vtkOctreePointLocatorNode* node = testNodes.front().first; @@ -1044,7 +1044,7 @@ void vtkOctreePointLocator::GenerateRepresentation(int level, vtkPolyData* pd) { for (int i = 0; i < 8; i++) { - testNodes.push(std::make_pair(node->GetChild(i), nodeLevel + 1)); + testNodes.emplace(node->GetChild(i), nodeLevel + 1); } } } diff --git a/Common/DataModel/vtkSphericalPointIterator.cxx b/Common/DataModel/vtkSphericalPointIterator.cxx index abf8c0087aa983229d691b8eb78e5212439d6d20..c6e80f72e57bfc0efe50779bbfc72649098ca6c3 100644 --- a/Common/DataModel/vtkSphericalPointIterator.cxx +++ b/Common/DataModel/vtkSphericalPointIterator.cxx @@ -162,7 +162,7 @@ struct vtkSphericalPointIterator::SphericalPointIterator { this->DataSet->GetPoint(ptId, x); d2 = vtkMath::Distance2BetweenPoints(x, this->Center); - radialSort.emplace_back(RadialTuple(ptId, d2)); + radialSort.emplace_back(ptId, d2); } if (dir == vtkSphericalPointIterator::SORT_DESCENDING) { diff --git a/Common/DataModel/vtkStaticCellLocator.cxx b/Common/DataModel/vtkStaticCellLocator.cxx index 2e8ef2b6d5019f27d4494173585b4c71cc818bcd..57acab80c409e25d74e468b1e9bd1f1bee6a1017 100644 --- a/Common/DataModel/vtkStaticCellLocator.cxx +++ b/Common/DataModel/vtkStaticCellLocator.cxx @@ -1031,7 +1031,7 @@ vtkIdType CellProcessor<T>::FindClosestPointWithinRadius(const double x[3], doub // first get ijk containing point vtkIdType binId = this->Binner->GetBinIndex(x); - queue.push(std::make_pair(0.0, binId)); + queue.emplace(0.0, binId); binHasBeenQueued[binId] = true; // minimum squared distance to the closest point @@ -1125,7 +1125,7 @@ vtkIdType CellProcessor<T>::FindClosestPointWithinRadius(const double x[3], doub distance2ToCellBounds = Distance2ToBounds(x, bds); // add to queue - queue.push(std::make_pair(distance2ToCellBounds, binId)); + queue.emplace(distance2ToCellBounds, binId); } } } diff --git a/Common/DataModel/vtkStaticPointLocator2D.cxx b/Common/DataModel/vtkStaticPointLocator2D.cxx index 6eeda1a465ea43ef3c7461a3b6f12143605e4032..eeb6318e4c14afa0918e1088f91d266b08a52539 100644 --- a/Common/DataModel/vtkStaticPointLocator2D.cxx +++ b/Common/DataModel/vtkStaticPointLocator2D.cxx @@ -1023,7 +1023,7 @@ void BucketList2D<TIds>::FindClosestNPoints(int N, const double x[3], vtkIdList* { maxDist2 = dist2; } - sortedPts.emplace_back(IdTuple(ptId, dist2)); + sortedPts.emplace_back(ptId, dist2); } // As soon as N points found, jump out. if (static_cast<int>(sortedPts.size()) >= N) @@ -1065,7 +1065,7 @@ FOUND_N: dist2 = Distance2BetweenPoints2D(x, pt); if (dist2 <= maxDist2) { - sortedPts.emplace_back(IdTuple(ptId, dist2)); + sortedPts.emplace_back(ptId, dist2); } } jStart = 0; @@ -1381,11 +1381,11 @@ double BucketList2D<TIds>::FindCloseNBoundedPoints(int N, const double x[3], vtk if (static_cast<int>(sortedPts.size()) < N) { maxDist2 = (dist2 > maxDist2 ? dist2 : maxDist2); - sortedPts.emplace_back(IdTuple(ptId, dist2)); + sortedPts.emplace_back(ptId, dist2); } else if (dist2 <= maxDist2) { - sortedPts.emplace_back(IdTuple(ptId, dist2)); + sortedPts.emplace_back(ptId, dist2); } } } // if points in bucket @@ -1421,7 +1421,7 @@ FOUND_N: dist2 = Distance2BetweenPoints2D(x, pt); if (dist2 <= maxDist2) { - sortedPts.emplace_back(IdTuple(ptId, dist2)); + sortedPts.emplace_back(ptId, dist2); } } } // if points in bucket diff --git a/Common/DataModel/vtkTreeDFSIterator.cxx b/Common/DataModel/vtkTreeDFSIterator.cxx index 9c98d6090efecdebdd6483c1571039351be60a73..2b474425ec2974f0ff28b6b67a22d023f7187ada 100644 --- a/Common/DataModel/vtkTreeDFSIterator.cxx +++ b/Common/DataModel/vtkTreeDFSIterator.cxx @@ -159,7 +159,7 @@ vtkIdType vtkTreeDFSIterator::NextInternal() vtkIdType found = this->Tree->GetChild(pos.Vertex, pos.Index); // cout << "DFS coloring " << found << " gray (adjacency)" << endl; this->Color->SetValue(found, this->GRAY); - this->Internals->Stack.push(vtkTreeDFSIteratorPosition(found, 0)); + this->Internals->Stack.emplace(found, 0); if (this->Mode == this->DISCOVER) { // cout << "DFS adjacent discovery " << found << endl; @@ -177,7 +177,7 @@ vtkIdType vtkTreeDFSIterator::NextInternal() { // Found a new component; make it gray, put it on the stack // cerr << "DFS coloring " << this->CurRoot << " gray (new component)" << endl; - this->Internals->Stack.push(vtkTreeDFSIteratorPosition(this->CurRoot, 0)); + this->Internals->Stack.emplace(this->CurRoot, 0); this->Color->SetValue(this->CurRoot, this->GRAY); if (this->Mode == this->DISCOVER) { diff --git a/Common/ExecutionModel/vtkParallelReader.cxx b/Common/ExecutionModel/vtkParallelReader.cxx index f17d28861c246b197d6fc401e9ea0d1929e2635a..d2918793910d36cfe60c46d6e4bb0e7f110145f0 100644 --- a/Common/ExecutionModel/vtkParallelReader.cxx +++ b/Common/ExecutionModel/vtkParallelReader.cxx @@ -55,7 +55,7 @@ void vtkParallelReader::AddFileName(const char* fname) { return; } - this->Internal->FileNames.push_back(fname); + this->Internal->FileNames.emplace_back(fname); this->Modified(); } diff --git a/Common/ExecutionModel/vtkSimpleReader.cxx b/Common/ExecutionModel/vtkSimpleReader.cxx index 7a6ec6023ac464da9d2bd58b2dbca2cf6ad1a56d..b609383aa4214201f7dd703474371114fd01e9a8 100644 --- a/Common/ExecutionModel/vtkSimpleReader.cxx +++ b/Common/ExecutionModel/vtkSimpleReader.cxx @@ -56,7 +56,7 @@ void vtkSimpleReader::AddFileName(const char* fname) { return; } - this->Internal->FileNames.push_back(fname); + this->Internal->FileNames.emplace_back(fname); this->Modified(); } diff --git a/Filters/Core/vtkVoronoi2D.cxx b/Filters/Core/vtkVoronoi2D.cxx index 04f5459abdf81daa20f8200762433cd996651dfa..2a850ccb0420cd56e89279884d1d24d64667840a 100644 --- a/Filters/Core/vtkVoronoi2D.cxx +++ b/Filters/Core/vtkVoronoi2D.cxx @@ -157,19 +157,19 @@ struct VTile double v[2], *bds = this->PaddedBounds; v[0] = bds[1]; v[1] = bds[3]; - this->Verts.emplace_back(VVertex((-1), this->TileX, v)); + this->Verts.emplace_back((-1), this->TileX, v); v[0] = bds[0]; v[1] = bds[3]; - this->Verts.emplace_back(VVertex((-1), this->TileX, v)); + this->Verts.emplace_back((-1), this->TileX, v); v[0] = bds[0]; v[1] = bds[2]; - this->Verts.emplace_back(VVertex((-1), this->TileX, v)); + this->Verts.emplace_back((-1), this->TileX, v); v[0] = bds[1]; v[1] = bds[2]; - this->Verts.emplace_back(VVertex((-1), this->TileX, v)); + this->Verts.emplace_back((-1), this->TileX, v); } // Initialize with a convex polygon. The points are in counterclockwise order @@ -192,7 +192,7 @@ struct VTile for (vtkIdType i = 0; i < nPts; ++i) { pts->GetPoint(p[i], v); - this->Verts.emplace_back(VVertex((-1), this->TileX, v)); + this->Verts.emplace_back((-1), this->TileX, v); } } @@ -729,7 +729,7 @@ struct VoronoiTiles { lTiles.push_back((i + numPoints)); VVertex& tileVertex = tile.Verts.at(i); - lPoints.emplace_back(TileVertex(tileVertex.X[0], tileVertex.X[1])); + lPoints.emplace_back(tileVertex.X[0], tileVertex.X[1]); } // Accumulate scalars if requested diff --git a/Filters/FlowPaths/vtkLagrangianBasicIntegrationModel.cxx b/Filters/FlowPaths/vtkLagrangianBasicIntegrationModel.cxx index 97a8b17caa16cc601fba610999b4972294801fd8..3e2666b1cf4b34cdae9490bb2a5e5344d82933f5 100644 --- a/Filters/FlowPaths/vtkLagrangianBasicIntegrationModel.cxx +++ b/Filters/FlowPaths/vtkLagrangianBasicIntegrationModel.cxx @@ -398,7 +398,7 @@ vtkLagrangianParticle* vtkLagrangianBasicIntegrationModel::ComputeSurfaceInterac vtkLagrangianParticle* clone = particle->CloneParticle(); clone->SetInteraction(vtkLagrangianParticle::SURFACE_INTERACTION_PASS); this->InterpolateNextParticleVariables(clone, item.second); - passThroughParticles.push(std::make_pair(item.first, clone)); + passThroughParticles.emplace(item.first, clone); } } diff --git a/Filters/FlowPaths/vtkModifiedBSPTree.cxx b/Filters/FlowPaths/vtkModifiedBSPTree.cxx index f99268933a2a63d2455e76f56d60202143e41c10..69c4f7c306deb66d2418bff7ceedf0e9cf6bcac9 100644 --- a/Filters/FlowPaths/vtkModifiedBSPTree.cxx +++ b/Filters/FlowPaths/vtkModifiedBSPTree.cxx @@ -513,7 +513,7 @@ void vtkModifiedBSPTree::GenerateRepresentation(int level, vtkPolyData* pd) ns.pop(); if (node->depth == level) { - bl.push_back(box(node->Bounds)); + bl.emplace_back(node->Bounds); } else { @@ -528,7 +528,7 @@ void vtkModifiedBSPTree::GenerateRepresentation(int level, vtkPolyData* pd) } else if (level == -1) { - bl.push_back(box(node->Bounds)); + bl.emplace_back(node->Bounds); } } } diff --git a/Filters/FlowPaths/vtkParallelVectors.cxx b/Filters/FlowPaths/vtkParallelVectors.cxx index 1384695a697f8bcd24c38936c181918263750a47..b26c33b36c1df5b5e9557bbfead72c9f58bd94fa 100644 --- a/Filters/FlowPaths/vtkParallelVectors.cxx +++ b/Filters/FlowPaths/vtkParallelVectors.cxx @@ -219,7 +219,7 @@ struct PolyLineBuilder // (...,b)<- ~(a,b) if (l.first != c.back().first) { - c.emplace_back(Link(l.second, l.first)); + c.emplace_back(l.second, l.first); } return; } @@ -237,7 +237,7 @@ struct PolyLineBuilder // ~(a,b) -> (a,...) if (l.second != c.front().second) { - c.emplace_front(Link(l.second, l.first)); + c.emplace_front(l.second, l.first); } return; } @@ -300,7 +300,7 @@ struct PolyLineBuilder // (...,a) <- (...,a) for (auto linkIt = c2->rbegin(); linkIt != c2->rend(); ++linkIt) { - c1->emplace_back(Link(linkIt->second, linkIt->first)); + c1->emplace_back(linkIt->second, linkIt->first); } c2->clear(); } diff --git a/Filters/FlowPaths/vtkStreaklineFilter.cxx b/Filters/FlowPaths/vtkStreaklineFilter.cxx index b45f696223bdf8cf3c2eb4b9222ca56f4405a4bf..8d9c3790e67ff1b8a6e0ae67d789b74083c830e9 100644 --- a/Filters/FlowPaths/vtkStreaklineFilter.cxx +++ b/Filters/FlowPaths/vtkStreaklineFilter.cxx @@ -97,7 +97,7 @@ void StreaklineFilterInternal::Finalize() } Streak& streak = streaks[streakId]; float age = particleAge->GetValue(i); - streak.push_back(StreakParticle(i, age)); + streak.emplace_back(i, age); } // sort streaks based on age diff --git a/Filters/General/vtkDensifyPolyData.cxx b/Filters/General/vtkDensifyPolyData.cxx index cab698e732c1b145142a8e8669457813f41916bd..7870604403f9cf2fdfe0559783ea18dfabce66ab 100644 --- a/Filters/General/vtkDensifyPolyData.cxx +++ b/Filters/General/vtkDensifyPolyData.cxx @@ -297,7 +297,7 @@ public: t.Verts[3 * id2], t.Verts[3 * id2 + 1], t.Verts[3 * id2 + 2], centroid[0], centroid[1], centroid[2] }; vtkIdType vertIds[3] = { t.VertIds[id1], t.VertIds[id2], id3 }; - polygons.push_back(Polygon(verts, 3, vertIds, t.NumVerts, t.VertIds)); + polygons.emplace_back(verts, 3, vertIds, t.NumVerts, t.VertIds); } this->NumPoints++; diff --git a/Filters/General/vtkMultiThreshold.cxx b/Filters/General/vtkMultiThreshold.cxx index 10c9a1b39938a74889dc1a59fbd90e249abbc6df..fc4208dca53bdcafdef507f9199efa7c8abb65a6 100644 --- a/Filters/General/vtkMultiThreshold.cxx +++ b/Filters/General/vtkMultiThreshold.cxx @@ -296,7 +296,7 @@ int vtkMultiThreshold::AddBooleanSet(int operation, int numInputs, int* inputs) BooleanSet* bset = new BooleanSet(sId, operation, inputs, inputs + numInputs); this->Sets.push_back(bset); - this->DependentSets.push_back(TruthTreeValues()); + this->DependentSets.emplace_back(); // Add dependency to input sets for (i = 0; i < numInputs; ++i) @@ -428,7 +428,7 @@ int vtkMultiThreshold::AddIntervalSet(NormKey& nk, double xmin, double xmax, int interval->Id = entry; this->Sets.push_back(interval); - this->DependentSets.push_back(TruthTreeValues()); + this->DependentSets.emplace_back(); this->IntervalRules[nk].push_back(interval); return entry; diff --git a/Filters/General/vtkPassArrays.cxx b/Filters/General/vtkPassArrays.cxx index 89fd517b050ea5549680141bab40275866a75063..b777d7ff738ab62b1209fc6827cf9ec890d42a45 100644 --- a/Filters/General/vtkPassArrays.cxx +++ b/Filters/General/vtkPassArrays.cxx @@ -87,7 +87,7 @@ void vtkPassArrays::AddArray(int fieldType, const char* name) return; } std::string n = name; - this->Implementation->Arrays.push_back(std::make_pair(fieldType, n)); + this->Implementation->Arrays.emplace_back(fieldType, n); this->Modified(); } diff --git a/Filters/Modeling/vtkContourLoopExtraction.cxx b/Filters/Modeling/vtkContourLoopExtraction.cxx index c652351dde2c79f218ecbb80204ef3ab09cc89e2..76ed165691ad9e78958f403eb6a5b505ded5236a 100644 --- a/Filters/Modeling/vtkContourLoopExtraction.cxx +++ b/Filters/Modeling/vtkContourLoopExtraction.cxx @@ -106,7 +106,7 @@ vtkIdType TraverseLoop(double dir, vtkPolyData* polyData, vtkIdType lineId, vtkI last = (pts[0] != last ? pts[0] : pts[1]); numInserted++; t = dir * static_cast<double>(numInserted); - sortedPoints.push_back(LoopPoint(t, last)); + sortedPoints.emplace_back(t, last); UpdateRange(scalars, last, range); polyData->GetPointCells(last, ncells, cells); @@ -433,7 +433,7 @@ int vtkContourLoopExtraction::RequestData(vtkInformation* vtkNotUsed(request), visited[lineId] = 1; start = pts[0]; sortedPoints.clear(); - sortedPoints.push_back(LoopPoint(0.0, start)); + sortedPoints.emplace_back(0.0, start); range[0] = VTK_FLOAT_MAX; range[1] = VTK_FLOAT_MIN; UpdateRange(scalars, start, range); diff --git a/Filters/Modeling/vtkCookieCutter.cxx b/Filters/Modeling/vtkCookieCutter.cxx index ee2b97f508f5dbac7bd911387573a20947ba129c..ae1a37d8530669e02164460ad514cb489d60eccd 100644 --- a/Filters/Modeling/vtkCookieCutter.cxx +++ b/Filters/Modeling/vtkCookieCutter.cxx @@ -283,7 +283,7 @@ int CleanSortedPolyline(SortedPointsType& sortedPoints) t = sortedPoints[i].T; if (end == (num - 1)) { // last point may require special treatment - mergeRange.emplace_back(MergeRange(end, end + 1)); + mergeRange.emplace_back(end, end + 1); break; } ip = i + 1; @@ -298,7 +298,7 @@ int CleanSortedPolyline(SortedPointsType& sortedPoints) end = ip; // Add new segment - mergeRange.emplace_back(MergeRange(start, end)); + mergeRange.emplace_back(start, end); // Move to next segment i = start = end; @@ -347,7 +347,7 @@ int CleanSortedPolyline(SortedPointsType& sortedPoints) { spc = SortPoint::MULT_INTS; } - newSortedPoints.emplace_back(SortPoint(minT, spc, minId, onId, sortedPoints[minX].X)); + newSortedPoints.emplace_back(minT, spc, minId, onId, sortedPoints[minX].X); } // across all merge ranges // Update the sorted points array, now clean! @@ -408,7 +408,7 @@ void CleanSortedPolygon(vtkIdType npts, SortedPointsType& sortedPoints) { if (i == (imax - 1)) { - mergeRange.emplace_back(MergeRange(i, imax)); + mergeRange.emplace_back(i, imax); break; } @@ -439,7 +439,7 @@ void CleanSortedPolygon(vtkIdType npts, SortedPointsType& sortedPoints) end = ip; // Add new segment - mergeRange.emplace_back(MergeRange(start, end)); + mergeRange.emplace_back(start, end); // Move to next segment i = start = end; @@ -490,7 +490,7 @@ void CleanSortedPolygon(vtkIdType npts, SortedPointsType& sortedPoints) { spc = SortPoint::MULT_INTS; } - newSortedPoints.emplace_back(SortPoint(minT, spc, minId, onId, sortedPoints[minX].X)); + newSortedPoints.emplace_back(minT, spc, minId, onId, sortedPoints[minX].X); } // across all merge ranges // Update the sorted points array, now clean! @@ -796,18 +796,18 @@ struct vtkAttributeManager // See if it's a vertex (CopyData) if (attType < PointAttribute::Intersection) { - this->PointAttributes.emplace_back(PointAttribute(attType, m0, m1, tm)); + this->PointAttributes.emplace_back(attType, m0, m1, tm); return; } // See if it's an edge (InterpolateData) if (this->PointInterpolation == vtkCookieCutter::USE_MESH_EDGES) { - this->PointAttributes.emplace_back(PointAttribute(PointAttribute::MeshEdge, m0, m1, tm)); + this->PointAttributes.emplace_back(PointAttribute::MeshEdge, m0, m1, tm); } else // if ( this->PointInterpolation == vtkCookieCutter::USE_LOOP_EDGES ) { - this->PointAttributes.emplace_back(PointAttribute(PointAttribute::LoopEdge, l0, l1, tl)); + this->PointAttributes.emplace_back(PointAttribute::LoopEdge, l0, l1, tl); } } @@ -940,7 +940,7 @@ void vtkCookieCutterHelper::CropLine(vtkIdType cellId, vtkIdType cellOffset, vtk { t = static_cast<double>(i); this->InPoints->GetPoint(pts[i], x); - sortedPoints.emplace_back(SortPoint(t, SortPoint::VERTEX, -1, -1, x)); + sortedPoints.emplace_back(t, SortPoint::VERTEX, -1, -1, x); attrMgr->AddPointAttribute(PointAttribute::MeshVertex, pts[i]); } @@ -968,7 +968,7 @@ void vtkCookieCutterHelper::CropLine(vtkIdType cellId, vtkIdType cellOffset, vtk attrMgr->AddPointAttribute(PointAttribute::Intersection, m0, m1, l0, l1, u, v); u += static_cast<double>(i); v += static_cast<double>(j); - sortedPoints.emplace_back(SortPoint(u, SortPoint::INTERSECTION, numInts, -1, x)); + sortedPoints.emplace_back(u, SortPoint::INTERSECTION, numInts, -1, x); numInts++; } else if (result == 3) // parallel lines @@ -986,8 +986,7 @@ void vtkCookieCutterHelper::CropLine(vtkIdType cellId, vtkIdType cellOffset, vtk vtkLine::DistanceToLine(x0, y0, y1, u, c); if (-VTK_DEGENERATE_TOL <= u && u <= (1.0 + VTK_DEGENERATE_TOL)) { - sortedPoints.emplace_back( - SortPoint(static_cast<double>(i), SortPoint::ON, numInts, onId, c)); + sortedPoints.emplace_back(static_cast<double>(i), SortPoint::ON, numInts, onId, c); attrMgr->AddPointAttribute(PointAttribute::MeshVertex, m0); numInts++; } @@ -995,23 +994,21 @@ void vtkCookieCutterHelper::CropLine(vtkIdType cellId, vtkIdType cellOffset, vtk if (-VTK_DEGENERATE_TOL <= u && u <= (1.0 + VTK_DEGENERATE_TOL)) { sortedPoints.emplace_back( - SortPoint(static_cast<double>(i) + 1.0, SortPoint::ON, numInts, onId, c)); + static_cast<double>(i) + 1.0, SortPoint::ON, numInts, onId, c); attrMgr->AddPointAttribute(PointAttribute::MeshVertex, m1); numInts++; } vtkLine::DistanceToLine(y0, x0, x1, u, c); if (-VTK_DEGENERATE_TOL <= u && u <= (1.0 + VTK_DEGENERATE_TOL)) { - sortedPoints.emplace_back( - SortPoint(static_cast<double>(i) + u, SortPoint::ON, numInts, onId, c)); + sortedPoints.emplace_back(static_cast<double>(i) + u, SortPoint::ON, numInts, onId, c); attrMgr->AddPointAttribute(PointAttribute::LoopVertex, l0); numInts++; } vtkLine::DistanceToLine(y1, x0, x1, u, c); if (-VTK_DEGENERATE_TOL <= u && u <= (1.0 + VTK_DEGENERATE_TOL)) { - sortedPoints.emplace_back( - SortPoint(static_cast<double>(i) + u, SortPoint::ON, numInts, onId, c)); + sortedPoints.emplace_back(static_cast<double>(i) + u, SortPoint::ON, numInts, onId, c); attrMgr->AddPointAttribute(PointAttribute::LoopVertex, l1); numInts++; } @@ -1178,7 +1175,7 @@ void vtkCookieCutterHelper::CropPoly(vtkIdType cellId, vtkIdType cellOffset, vtk { t = static_cast<double>(i); this->InPoints->GetPoint(pts[i], x); - polyPoints.emplace_back(SortPoint(t, SortPoint::VERTEX, numPts, -1, x)); + polyPoints.emplace_back(t, SortPoint::VERTEX, numPts, -1, x); attrMgr->AddPointAttribute(PointAttribute::MeshVertex, pts[i]); numPts++; } @@ -1188,7 +1185,7 @@ void vtkCookieCutterHelper::CropPoly(vtkIdType cellId, vtkIdType cellOffset, vtk { t = static_cast<double>(i); loop->Points->GetPoint(i, x); - loopPoints.emplace_back(SortPoint(t, SortPoint::VERTEX, numPts, -1, x)); + loopPoints.emplace_back(t, SortPoint::VERTEX, numPts, -1, x); attrMgr->AddPointAttribute(PointAttribute::LoopVertex, i); numPts++; } @@ -1219,8 +1216,8 @@ void vtkCookieCutterHelper::CropPoly(vtkIdType cellId, vtkIdType cellOffset, vtk attrMgr->AddPointAttribute(PointAttribute::Intersection, m0, m1, l0, l1, u, v); u += static_cast<double>(i); v += static_cast<double>(j); - polyPoints.emplace_back(SortPoint(u, SortPoint::INTERSECTION, numPts, -1, x)); - loopPoints.emplace_back(SortPoint(v, SortPoint::INTERSECTION, numPts, -1, x)); + polyPoints.emplace_back(u, SortPoint::INTERSECTION, numPts, -1, x); + loopPoints.emplace_back(v, SortPoint::INTERSECTION, numPts, -1, x); numPts++; } else if (result == 3) // parallel lines @@ -1238,40 +1235,32 @@ void vtkCookieCutterHelper::CropPoly(vtkIdType cellId, vtkIdType cellOffset, vtk vtkLine::DistanceToLine(x0, y0, y1, u, c); if (-VTK_DEGENERATE_TOL <= u && u <= (1.0 + VTK_DEGENERATE_TOL)) { - polyPoints.emplace_back( - SortPoint(static_cast<double>(i), SortPoint::ON, numPts, onId, c)); - loopPoints.emplace_back( - SortPoint(static_cast<double>(j) + u, SortPoint::ON, numPts, onId, c)); + polyPoints.emplace_back(static_cast<double>(i), SortPoint::ON, numPts, onId, c); + loopPoints.emplace_back(static_cast<double>(j) + u, SortPoint::ON, numPts, onId, c); attrMgr->AddPointAttribute(PointAttribute::MeshVertex, m0); numPts++; } vtkLine::DistanceToLine(x1, y0, y1, u, c); if (-VTK_DEGENERATE_TOL <= u && u <= (1.0 + VTK_DEGENERATE_TOL)) { - polyPoints.emplace_back( - SortPoint(static_cast<double>(i) + 1.0, SortPoint::ON, numPts, onId, c)); - loopPoints.emplace_back( - SortPoint(static_cast<double>(j) + u, SortPoint::ON, numPts, onId, c)); + polyPoints.emplace_back(static_cast<double>(i) + 1.0, SortPoint::ON, numPts, onId, c); + loopPoints.emplace_back(static_cast<double>(j) + u, SortPoint::ON, numPts, onId, c); attrMgr->AddPointAttribute(PointAttribute::MeshVertex, m1); numPts++; } vtkLine::DistanceToLine(y0, x0, x1, u, c); if (-VTK_DEGENERATE_TOL <= u && u <= (1.0 + VTK_DEGENERATE_TOL)) { - polyPoints.emplace_back( - SortPoint(static_cast<double>(i) + u, SortPoint::ON, numPts, onId, c)); - loopPoints.emplace_back( - SortPoint(static_cast<double>(j), SortPoint::ON, numPts, onId, c)); + polyPoints.emplace_back(static_cast<double>(i) + u, SortPoint::ON, numPts, onId, c); + loopPoints.emplace_back(static_cast<double>(j), SortPoint::ON, numPts, onId, c); attrMgr->AddPointAttribute(PointAttribute::LoopVertex, l0); numPts++; } vtkLine::DistanceToLine(y1, x0, x1, u, c); if (-VTK_DEGENERATE_TOL <= u && u <= (1.0 + VTK_DEGENERATE_TOL)) { - polyPoints.emplace_back( - SortPoint(static_cast<double>(i) + u, SortPoint::ON, numPts, onId, c)); - loopPoints.emplace_back( - SortPoint(static_cast<double>(j) + 1.0, SortPoint::ON, numPts, onId, c)); + polyPoints.emplace_back(static_cast<double>(i) + u, SortPoint::ON, numPts, onId, c); + loopPoints.emplace_back(static_cast<double>(j) + 1.0, SortPoint::ON, numPts, onId, c); attrMgr->AddPointAttribute(PointAttribute::LoopVertex, l1); numPts++; } diff --git a/Filters/Modeling/vtkImprintFilter.cxx b/Filters/Modeling/vtkImprintFilter.cxx index 748059dca2639cca19f37f616af6691b69e0ae03..79c66b2015827167ba38fee431320461ac9e54c6 100644 --- a/Filters/Modeling/vtkImprintFilter.cxx +++ b/Filters/Modeling/vtkImprintFilter.cxx @@ -1715,13 +1715,13 @@ struct ProduceIntersectionPoints ((vtkMath::Distance2BetweenPoints(xInt, y0) <= this->MergeTol2) ? v0 : v1); vtkPointList& newPts = this->LocalIntData.Local().NewPoints; - newPts.emplace_back(vtkPointInfo()); + newPts.emplace_back(); vtkPointInfo& pt = newPts.back(); pt.Classification = PointClassification::OnVertex; this->PtClassifier->SetClassification(vtkPtId, PointClassification::OnVertex); pt.VTKPtId = vtkPtId; // The target point which the imprint edge intersects target->GetPoint(vtkPtId, pt.X); - eIntList.emplace_back(vtkEdgeIntersection(u, newPts.size() - 1, &newPts)); + eIntList.emplace_back(u, newPts.size() - 1, &newPts); return 2; } @@ -1734,8 +1734,7 @@ struct ProduceIntersectionPoints target->GetCellEdgeNeighbors(-1, v0, v1, neighbors); cells[0] = (neighbors->GetNumberOfIds() < 1 ? -1 : neighbors->GetId(0)); cells[1] = (neighbors->GetNumberOfIds() < 2 ? -1 : neighbors->GetId(1)); - newPts.emplace_back( - vtkPointInfo(PointClassification::OnEdge, -1, cells, v0, v1, v, u0, u1, u, xInt)); + newPts.emplace_back(PointClassification::OnEdge, -1, cells, v0, v1, v, u0, u1, u, xInt); // For now, we are using local point ids. Later we'll update to refer to // global point ids. Note we have to use ids rather than pointers to @@ -1934,7 +1933,7 @@ struct ProduceIntersectionPoints // Output an edge fragment if appropriate. if (outputCellId >= 0) { - newEdges.emplace_back(vtkEdgeFragment(edgeIntList[i], edgeIntList[i + 1], outputCellId)); + newEdges.emplace_back(edgeIntList[i], edgeIntList[i + 1], outputCellId); } } // for all edge fragments } // ProduceInteriorEdgeFragments @@ -2016,9 +2015,8 @@ struct ProduceIntersectionPoints vtkIdType candidateCell = this->IsInteriorEdge(pStart, pEnd); if (candidateCell >= 0) { - newEdges.emplace_back( - vtkEdgeFragment(vtkEdgeIntersection(0.0, viStart, this->PointList), - vtkEdgeIntersection(1.0, viEnd, this->PointList), candidateCell)); + newEdges.emplace_back(vtkEdgeIntersection(0.0, viStart, this->PointList), + vtkEdgeIntersection(1.0, viEnd, this->PointList), candidateCell); continue; } @@ -2138,7 +2136,7 @@ struct ProduceIntersectionPoints vtkPointInfo& v0 = frag.V0.GetPointInfo(); vtkPointInfo& v1 = frag.V1.GetPointInfo(); - cInfo->InteriorEdges.emplace_back(vtkEdge(v0.VTKPtId, v1.VTKPtId)); + cInfo->InteriorEdges.emplace_back(v0.VTKPtId, v1.VTKPtId); } } // for each edge fragment } // for all local data in threads @@ -2317,7 +2315,7 @@ struct Triangulate { double t = (swapped ? (1.0 - pInfo->TargetEdge.Data) : pInfo->TargetEdge.Data); t += static_cast<double>(eId); - pList.emplace_back(vtkPerimeterPoint(t, pInfo->X, pInfo->VTKPtId)); + pList.emplace_back(t, pInfo->X, pInfo->VTKPtId); return; } } // for all edges @@ -2344,7 +2342,7 @@ struct Triangulate { outPts->GetPoint(pts[i], x); t = static_cast<double>(i); - pList.emplace_back(vtkPerimeterPoint(t, x, pts[i])); + pList.emplace_back(t, x, pts[i]); } // Now insert edge points around the perimeter with the appropriate diff --git a/Filters/Parallel/vtkExtractCTHPart.cxx b/Filters/Parallel/vtkExtractCTHPart.cxx index fbdcf9c13ddcddf7b179e933ea574ddea98db9a2..c79afdae89f8d262c0254c6fefe4d05c050050ca 100644 --- a/Filters/Parallel/vtkExtractCTHPart.cxx +++ b/Filters/Parallel/vtkExtractCTHPart.cxx @@ -182,7 +182,7 @@ void vtkExtractCTHPart::AddVolumeArrayName(const char* arrayName) std::find(this->Internals->VolumeArrayNames.begin(), this->Internals->VolumeArrayNames.end(), std::string(arrayName)) == this->Internals->VolumeArrayNames.end()) { - this->Internals->VolumeArrayNames.push_back(arrayName); + this->Internals->VolumeArrayNames.emplace_back(arrayName); // ensure that the volume arrays are in determinate order. I should just // change the code to use a std::set. diff --git a/Filters/ParallelDIY2/vtkAdaptiveResampleToImage.cxx b/Filters/ParallelDIY2/vtkAdaptiveResampleToImage.cxx index 578cf26bececf003caba0d329a46259e5c51a4a7..f8995aab126aa0c9083564d998dfd8749d599e2a 100644 --- a/Filters/ParallelDIY2/vtkAdaptiveResampleToImage.cxx +++ b/Filters/ParallelDIY2/vtkAdaptiveResampleToImage.cxx @@ -283,7 +283,7 @@ int vtkAdaptiveResampleToImage::RequestData( // vtkLogF(TRACE, "dequeue from %d", source.gid); auto img = vtkImageData::SafeDownCast(ptr); assert(img); - resamples[rp.gid()].push_back(img); + resamples[rp.gid()].emplace_back(img); ptr->Delete(); } } diff --git a/Filters/ParallelDIY2/vtkDIYKdTreeUtilities.cxx b/Filters/ParallelDIY2/vtkDIYKdTreeUtilities.cxx index 11950962ffb3cc84d91fe355aa794921e122619c..076e5ed973148b9c7d58a8a4a364ffb6867b85e9 100644 --- a/Filters/ParallelDIY2/vtkDIYKdTreeUtilities.cxx +++ b/Filters/ParallelDIY2/vtkDIYKdTreeUtilities.cxx @@ -336,7 +336,7 @@ vtkSmartPointer<vtkPartitionedDataSet> vtkDIYKdTreeUtilities::Exchange( if (target_rank == myrank) { // short-circuit messages to self. - (*block)[partId].push_back(part); + (*block)[partId].emplace_back(part); } else { diff --git a/Filters/Sources/vtkHyperTreeGridSource.cxx b/Filters/Sources/vtkHyperTreeGridSource.cxx index 97d9e6e2ab74ea4b1b22bf6b76017ac014ed31ef..0c3c3346b2ff0d4997ef1288acd81c5faba3b79e 100644 --- a/Filters/Sources/vtkHyperTreeGridSource.cxx +++ b/Filters/Sources/vtkHyperTreeGridSource.cxx @@ -851,7 +851,7 @@ int vtkHyperTreeGridSource::InitializeFromStringDescriptor() nNextLevel = nRefined * this->BlockSize; if (nRefined > 0) { - this->LevelDescriptors.emplace_back(std::string(nNextLevel, '.')); + this->LevelDescriptors.emplace_back(nNextLevel, '.'); } } diff --git a/IO/CONVERGECFD/vtkCONVERGECFDReader.cxx b/IO/CONVERGECFD/vtkCONVERGECFDReader.cxx index 3dcd6d344e0af0026a36bce71942d11b717a46a4..1356b161f1cab4ccda7235981837f0788d42cb3d 100644 --- a/IO/CONVERGECFD/vtkCONVERGECFDReader.cxx +++ b/IO/CONVERGECFD/vtkCONVERGECFDReader.cxx @@ -196,7 +196,7 @@ bool ReadStrings(hid_t fileId, const char* path, std::vector<std::string>& strin strings.clear(); for (hsize_t i = 0; i < dim; ++i) { - strings.emplace_back(std::string(rdata[i])); + strings.emplace_back(rdata[i]); } delete[] rdata[0]; @@ -1290,7 +1290,7 @@ void vtkCONVERGECFDReader::ReadTimeSteps(vtkInformation* outInfo) bool timeRead = this->ReadOutputTime(file, time); if (timeRead) { - timesAndFiles.emplace_back(std::make_pair(time, file)); + timesAndFiles.emplace_back(time, file); } } diff --git a/IO/Cesium3DTiles/TreeInformation.cxx b/IO/Cesium3DTiles/TreeInformation.cxx index 88fad535605bc7a20764649dc6d022f918f81d5c..1f3e9fb19e2cb74208d61999bf5170a174db8589 100644 --- a/IO/Cesium3DTiles/TreeInformation.cxx +++ b/IO/Cesium3DTiles/TreeInformation.cxx @@ -894,7 +894,7 @@ vtkSmartPointer<vtkImageData> TreeInformation::SplitTileTexture( // place cells in the new image using Next-Fit Decreasing Height (NFDH) algorithm // https://cgi.csc.liv.ac.uk/~epa/surveyhtml.html - groupedRegions.emplace_back(std::vector<size_t>()); + groupedRegions.emplace_back(); int currentWidth = 0; int currentHeight = (scatteredRegions[0].Region[3] - scatteredRegions[0].Region[2] + 1); for (size_t i = 0; i < scatteredRegions.size(); ++i) @@ -918,7 +918,7 @@ vtkSmartPointer<vtkImageData> TreeInformation::SplitTileTexture( return nullptr; } // create a new row and add the cell there - groupedRegions.emplace_back(std::vector<size_t>()); + groupedRegions.emplace_back(); rowWidthHeight.push_back({ { currentWidth, currentHeight } }); currentWidth = 0; currentHeight = (scatteredRegions[i].Region[3] - scatteredRegions[i].Region[2] + 1); diff --git a/IO/Core/vtkSortFileNames.cxx b/IO/Core/vtkSortFileNames.cxx index 6fe83fe7193a865852fc9017d3d623855e8ddf44..fc65baee8e956324d9085fe0e497d59100300197 100644 --- a/IO/Core/vtkSortFileNames.cxx +++ b/IO/Core/vtkSortFileNames.cxx @@ -45,7 +45,7 @@ public: void InsertNextStringArray(vtkStringArray* stringArray) { - this->Container.push_back(stringArray); + this->Container.emplace_back(stringArray); } vtkStringArray* GetStringArray(int i) diff --git a/IO/Import/vtkGLTFImporter.cxx b/IO/Import/vtkGLTFImporter.cxx index c73e8ff9845e3d9df887b185c7e24d0e5eb9bb5d..91dc76a6daf565e654f99f5a82a2f17fa677c800 100644 --- a/IO/Import/vtkGLTFImporter.cxx +++ b/IO/Import/vtkGLTFImporter.cxx @@ -500,7 +500,7 @@ void vtkGLTFImporter::ImportActors(vtkRenderer* renderer) } renderer->AddActor(actor); - this->Actors[nodeId].push_back(actor); + this->Actors[nodeId].emplace_back(actor); this->InvokeEvent(vtkCommand::UpdateDataEvent); } diff --git a/IO/Xdmf3/vtkXdmf3Writer.cxx b/IO/Xdmf3/vtkXdmf3Writer.cxx index 30023418b7e6fdb403737083175fe5ad096af7a4..51ac6f7ca07b36fc795af8961a1b1b707e13af6b 100644 --- a/IO/Xdmf3/vtkXdmf3Writer.cxx +++ b/IO/Xdmf3/vtkXdmf3Writer.cxx @@ -72,7 +72,7 @@ public: { shared_ptr<XdmfGridCollection> dest = XdmfGridCollection::New(); dest->setType(XdmfGridCollectionType::Temporal()); - this->DestinationGroups.push(dest); + this->DestinationGroups.emplace(dest); this->Destination = this->DestinationGroups.top(); this->Domain->insert(dest); } @@ -89,7 +89,7 @@ public: { shared_ptr<XdmfGridCollection> group = XdmfGridCollection::New(); this->Destination->insert(group); - this->DestinationGroups.push(group); + this->DestinationGroups.emplace(group); this->Destination = this->DestinationGroups.top(); vtkMultiBlockDataSet* mbds = vtkMultiBlockDataSet::SafeDownCast(dataSet); for (unsigned int i = 0; i < mbds->GetNumberOfBlocks(); i++) diff --git a/Imaging/Morphological/vtkImageThresholdConnectivity.cxx b/Imaging/Morphological/vtkImageThresholdConnectivity.cxx index 12fcc875c079fb69453f9b0c3a34f1720bb28b22..36a8cc57f7e07b464f359b8b0fad82a382b3d5e1 100644 --- a/Imaging/Morphological/vtkImageThresholdConnectivity.cxx +++ b/Imaging/Morphological/vtkImageThresholdConnectivity.cxx @@ -644,27 +644,27 @@ void vtkImageThresholdConnectivityExecute(vtkImageThresholdConnectivity* self, v // push the new seeds if (seed[2] > 0 && *(maskPtr1 - maskInc[2]) == 0) { - seedStack.push(vtkFloodFillSeed(seed[0], seed[1], seed[2] - 1)); + seedStack.emplace(seed[0], seed[1], seed[2] - 1); } if (seed[2] < maxIdZ && *(maskPtr1 + maskInc[2]) == 0) { - seedStack.push(vtkFloodFillSeed(seed[0], seed[1], seed[2] + 1)); + seedStack.emplace(seed[0], seed[1], seed[2] + 1); } if (seed[1] > 0 && *(maskPtr1 - maskInc[1]) == 0) { - seedStack.push(vtkFloodFillSeed(seed[0], seed[1] - 1, seed[2])); + seedStack.emplace(seed[0], seed[1] - 1, seed[2]); } if (seed[1] < maxIdY && *(maskPtr1 + maskInc[1]) == 0) { - seedStack.push(vtkFloodFillSeed(seed[0], seed[1] + 1, seed[2])); + seedStack.emplace(seed[0], seed[1] + 1, seed[2]); } if (seed[0] > 0 && *(maskPtr1 - maskInc[0]) == 0) { - seedStack.push(vtkFloodFillSeed(seed[0] - 1, seed[1], seed[2])); + seedStack.emplace(seed[0] - 1, seed[1], seed[2]); } if (seed[0] < maxIdX && *(maskPtr1 + maskInc[0]) == 0) { - seedStack.push(vtkFloodFillSeed(seed[0] + 1, seed[1], seed[2])); + seedStack.emplace(seed[0] + 1, seed[1], seed[2]); } } } diff --git a/Infovis/Core/vtkNetworkHierarchy.cxx b/Infovis/Core/vtkNetworkHierarchy.cxx index 99bbdaa9b781d71c367e6ff038e1d42066c05fba..16b9c5bdef3655357d8b236c96dc3cd4f100f56c 100644 --- a/Infovis/Core/vtkNetworkHierarchy.cxx +++ b/Infovis/Core/vtkNetworkHierarchy.cxx @@ -128,7 +128,7 @@ int vtkNetworkHierarchy::RequestData( for (vtkIdType i = 0; i < ipArray->GetNumberOfTuples(); ++i) { unsigned int packedID = this->ITON(ipArray->GetValue(i)); - SubnetMap.push_back(std::make_pair(packedID, i)); + SubnetMap.emplace_back(packedID, i); } std::sort(SubnetMap.begin(), SubnetMap.end()); diff --git a/Infovis/Core/vtkTableToGraph.cxx b/Infovis/Core/vtkTableToGraph.cxx index c75e277fe75a31e010285b7e7fe72d025577ef52..29db13f51651b664cf8d87e9775ce1ecd92b8194 100644 --- a/Infovis/Core/vtkTableToGraph.cxx +++ b/Infovis/Core/vtkTableToGraph.cxx @@ -794,7 +794,7 @@ int vtkTableToGraph::RequestData( } else if (!hiddenSource && hiddenTarget) { - hiddenInEdges[target].push_back(std::make_pair(source, r)); + hiddenInEdges[target].emplace_back(source, r); } else { diff --git a/Parallel/Core/vtkSocketCommunicator.cxx b/Parallel/Core/vtkSocketCommunicator.cxx index 2add1a9bff8d6589c2e1d1c63a74d32c4c54df41..81e8d306824503a1b869bde415bba98e440152b7 100644 --- a/Parallel/Core/vtkSocketCommunicator.cxx +++ b/Parallel/Core/vtkSocketCommunicator.cxx @@ -57,7 +57,7 @@ public: void Push(int tag, int numchars, char* data) { - this->Buffer[tag].push_back(MessageType()); + this->Buffer[tag].emplace_back(); MessageType& msg = this->Buffer[tag].back(); msg.insert(msg.end(), data, (data + numchars)); } diff --git a/Rendering/Core/vtkCellCenterDepthSort.cxx b/Rendering/Core/vtkCellCenterDepthSort.cxx index f422e6f0aef37db7bade56b3b0da1e7319baabc8..5d396d984622a727df5c53321ed514511c5ac7c3 100644 --- a/Rendering/Core/vtkCellCenterDepthSort.cxx +++ b/Rendering/Core/vtkCellCenterDepthSort.cxx @@ -195,7 +195,7 @@ void vtkCellCenterDepthSort::InitTraversal() while (!this->ToSort->Stack.empty()) this->ToSort->Stack.pop(); - this->ToSort->Stack.push(vtkIdPair(0, numcells)); + this->ToSort->Stack.emplace(0, numcells); this->LastSortTime.Modified(); } @@ -236,7 +236,7 @@ vtkIdTypeArray* vtkCellCenterDepthSort::GetNextCells() right--; } - this->ToSort->Stack.push(vtkIdPair(left, partition.second)); + this->ToSort->Stack.emplace(left, partition.second); partition.second = left; } diff --git a/Rendering/Label/vtkLabelHierarchyCompositeIterator.cxx b/Rendering/Label/vtkLabelHierarchyCompositeIterator.cxx index 3a71bea24e4cfb408de0b983c74535c2e888fca3..5442f8185fc6051f3f0cfdcfd42b553b60ee9b79 100644 --- a/Rendering/Label/vtkLabelHierarchyCompositeIterator.cxx +++ b/Rendering/Label/vtkLabelHierarchyCompositeIterator.cxx @@ -54,8 +54,8 @@ vtkLabelHierarchyCompositeIterator::~vtkLabelHierarchyCompositeIterator() void vtkLabelHierarchyCompositeIterator::AddIterator(vtkLabelHierarchyIterator* it, int count) { - this->Implementation->Iterators.push_back( - std::make_pair(vtkSmartPointer<vtkLabelHierarchyIterator>(it), count)); + this->Implementation->Iterators.emplace_back( + vtkSmartPointer<vtkLabelHierarchyIterator>(it), count); } void vtkLabelHierarchyCompositeIterator::ClearIterators() diff --git a/Rendering/OpenGL2/vtkCompositePolyDataMapper2.cxx b/Rendering/OpenGL2/vtkCompositePolyDataMapper2.cxx index 9098a8128ceff3980465abd272e70f5dc8ac5488..631087a6e67866e1d35badc6f0c1c14e667f280a 100644 --- a/Rendering/OpenGL2/vtkCompositePolyDataMapper2.cxx +++ b/Rendering/OpenGL2/vtkCompositePolyDataMapper2.cxx @@ -2168,10 +2168,10 @@ void vtkCompositePolyDataMapper2::Render(vtkRenderer* ren, vtkActor* actor) this->BlockState.Visibility.push(true); this->BlockState.Pickability.push(true); this->BlockState.Opacity.push(prop->GetOpacity()); - this->BlockState.AmbientColor.push(vtkColor3d(prop->GetAmbientColor())); - this->BlockState.DiffuseColor.push(vtkColor3d(prop->GetDiffuseColor())); - this->BlockState.SpecularColor.push(vtkColor3d(prop->GetSpecularColor())); - this->BlockState.SelectionColor.push(vtkColor3d(selColor)); + this->BlockState.AmbientColor.emplace(prop->GetAmbientColor()); + this->BlockState.DiffuseColor.emplace(prop->GetDiffuseColor()); + this->BlockState.SpecularColor.emplace(prop->GetSpecularColor()); + this->BlockState.SelectionColor.emplace(selColor); this->BlockState.SelectionOpacity.push(selColor[3]); unsigned int flat_index = 0; diff --git a/Rendering/OpenGL2/vtkOpenGLState.cxx b/Rendering/OpenGL2/vtkOpenGLState.cxx index 0d62701cc3c4f90605b33d9766c4e8c887534b92..1ba445827df368faba4fa93de21a00b550daf491 100644 --- a/Rendering/OpenGL2/vtkOpenGLState.cxx +++ b/Rendering/OpenGL2/vtkOpenGLState.cxx @@ -1889,7 +1889,7 @@ vtkOpenGLState::vtkOpenGLState() this->TextureUnitManager = vtkTextureUnitManager::New(); - this->Stack.push(GLState()); + this->Stack.emplace(); auto& cs = this->Stack.top(); diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastMapperShadows.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastMapperShadows.cxx index e902120ec0548ac7ccc8d6c684674afd20807683..e931df8294da2b5248115ba2c7b87c21177ca38e 100644 --- a/Rendering/Volume/Testing/Cxx/TestGPURayCastMapperShadows.cxx +++ b/Rendering/Volume/Testing/Cxx/TestGPURayCastMapperShadows.cxx @@ -143,9 +143,9 @@ int TestGPURayCastMapperShadows(int argc, char* argv[]) BoxList Boxes; // wall - Boxes.push_back(ImageDataAABox(0.05, 0.05, 0.05, 0.1, 0.95, 0.95, 1.0)); + Boxes.emplace_back(0.05, 0.05, 0.05, 0.1, 0.95, 0.95, 1.0); // box - Boxes.push_back(ImageDataAABox(0.6, 0.35, 0.35, 0.9, 0.65, 0.65, 2.0)); + Boxes.emplace_back(0.6, 0.35, 0.35, 0.9, 0.65, 0.65, 2.0); // Camera Parameters double camera_position[3] = { 1.85, -1.27, 0.97 }; diff --git a/Rendering/Volume/vtkMultiVolume.cxx b/Rendering/Volume/vtkMultiVolume.cxx index 855160f9099cc225830f5e34fe86f31521b1bbad..62ce47c89fbc0ed4bb8bac145fb2956b2f9051f9 100644 --- a/Rendering/Volume/vtkMultiVolume.cxx +++ b/Rendering/Volume/vtkMultiVolume.cxx @@ -222,13 +222,13 @@ std::array<double, 6> vtkMultiVolume::ComputeAABounds(double bounds[6], vtkMatri PointVec pointsDataCoords; pointsDataCoords.reserve(8); pointsDataCoords.push_back(minPoint); - pointsDataCoords.push_back(minPoint + Point(dim[0], 0., 0., 0.)); - pointsDataCoords.push_back(minPoint + Point(dim[0], dim[1], 0., 0.)); - pointsDataCoords.push_back(minPoint + Point(0., dim[1], 0., 0.)); - pointsDataCoords.push_back(minPoint + Point(0., 0., dim[2], 0.)); - pointsDataCoords.push_back(minPoint + Point(dim[0], 0., dim[2], 0.)); - pointsDataCoords.push_back(Point(bounds[1], bounds[3], bounds[5], 0.)); - pointsDataCoords.push_back(minPoint + Point(0., dim[1], dim[2], 0.)); + pointsDataCoords.emplace_back(minPoint + Point(dim[0], 0., 0., 0.)); + pointsDataCoords.emplace_back(minPoint + Point(dim[0], dim[1], 0., 0.)); + pointsDataCoords.emplace_back(minPoint + Point(0., dim[1], 0., 0.)); + pointsDataCoords.emplace_back(minPoint + Point(0., 0., dim[2], 0.)); + pointsDataCoords.emplace_back(minPoint + Point(dim[0], 0., dim[2], 0.)); + pointsDataCoords.emplace_back(bounds[1], bounds[3], bounds[5], 0.); + pointsDataCoords.emplace_back(minPoint + Point(0., dim[1], dim[2], 0.)); // Transform all points from data to world coordinates vtkBoundingBox bBoxWorld; diff --git a/Web/Core/vtkDataEncoder.cxx b/Web/Core/vtkDataEncoder.cxx index b3cc24766265554156ebac531de2766bd1debd8d..96aad7eac528ddf385bd316da4902ec54213eeed 100644 --- a/Web/Core/vtkDataEncoder.cxx +++ b/Web/Core/vtkDataEncoder.cxx @@ -153,7 +153,7 @@ public: assert(numThreads >= 0); for (int cc = 0; cc < numThreads; ++cc) { - this->ThreadPool.emplace_back(std::thread(&vtkWorkQueue::DoWork, cc, this)); + this->ThreadPool.emplace_back(&vtkWorkQueue::DoWork, cc, this); } } ~vtkWorkQueue()