Skip to content
Snippets Groups Projects
Commit e5ea4181 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

no need for release|reset: rvalue can be directly assigned to unique_ptr

parent d608a7a8
No related branches found
No related tags found
1 merge request!2702follow-up to !2700 (roughness visualization)
Pipeline #153868 passed
......@@ -127,18 +127,18 @@ std::unique_ptr<Img3D::Layer> createLayer(const LayerItem& layerItem, const doub
// visual mesh will later be scaled, so we divide roughness by thickness factor in advance
std::unique_ptr<double2d_t> top;
if (topRoughMap)
top.reset(::scaledArray(*topRoughMap, 1. / thickness).release());
top = ::scaledArray(*topRoughMap, 1. / thickness);
else {
// TODO rework
// try to generate it roughness map if is not provided (individual layer visualization)
int seed = 1; // TODO accept seed from SampleItem/LayerItem
auto new_top = ::layerRoughnessMap(layerItem, sceneGeometry, seed);
if (new_top.get())
top.reset(::scaledArray(*new_top, 1. / thickness).release());
top = ::scaledArray(*new_top, 1. / thickness);
}
std::unique_ptr<double2d_t> bottom;
if (bottomRoughMap)
bottom.reset(::scaledArray(*bottomRoughMap, 1. / thickness).release());
bottom = ::scaledArray(*bottomRoughMap, 1. / thickness);
std::unique_ptr<Img3D::Layer> result = std::make_unique<Img3D::Layer>(
Img3D::F3Range(Img3D::F3fromR3({-s2, -s2, ztop}), Img3D::F3fromR3({s2, s2, zbottom})),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment