use rvalue ref for parameter

This commit is contained in:
Li-Ta Lo 2023-05-10 17:28:30 -06:00
parent 61c002072f
commit 50a9efc2f5
3 changed files with 3 additions and 4 deletions

@ -82,8 +82,7 @@ void ScalarRenderer::SetInput(vtkm::cont::DataSet& dataSet)
auto triIntersector = std::make_unique<raytracing::TriangleIntersector>();
triIntersector->SetData(coords, triExtractor.GetTriangles());
this->Internals->ShapeBounds = triIntersector->GetShapeBounds();
this->Internals->Tracer.SetShapeIntersector(std::unique_ptr<raytracing::ShapeIntersector>{
static_cast<raytracing::ShapeIntersector*>(triIntersector.release()) });
this->Internals->Tracer.SetShapeIntersector(std::move(triIntersector));
}
}

@ -214,7 +214,7 @@ public:
}; //class WriteDepthBuffer
} // namespace detail
void ScalarRenderer::SetShapeIntersector(std::unique_ptr<ShapeIntersector> intersector)
void ScalarRenderer::SetShapeIntersector(std::unique_ptr<ShapeIntersector>&& intersector)
{
Intersector = std::move(intersector);
IntersectorValid = true;

@ -48,7 +48,7 @@ protected:
public:
VTKM_CONT
void SetShapeIntersector(std::unique_ptr<ShapeIntersector> intersector);
void SetShapeIntersector(std::unique_ptr<ShapeIntersector>&& intersector);
VTKM_CONT
void AddField(const vtkm::cont::Field& scalarField);