diff --git a/GUI/coregui/Models/GUIDomainSampleVisitor.cpp b/GUI/coregui/Models/GUIDomainSampleVisitor.cpp index 551d8f067f22ee95ae55b7afc69eb9b81a988887..9a072bbe25a532997baf9ac6114c7200f7bf8948 100644 --- a/GUI/coregui/Models/GUIDomainSampleVisitor.cpp +++ b/GUI/coregui/Models/GUIDomainSampleVisitor.cpp @@ -108,15 +108,15 @@ void GUIDomainSampleVisitor::visit(const Layer* p_sample) { auto p_multilayer = dynamic_cast<const MultiLayer*>(m_itemToSample[p_parent]); ASSERT(p_multilayer); size_t layer_index = MultiLayerUtils::IndexOfLayer(*p_multilayer, p_sample); - const LayerInterface* p_interface = - MultiLayerUtils::LayerTopInterface(*p_multilayer, layer_index); + const LayerInterface* top_interface = + layer_index==0 ? nullptr : p_multilayer->layerInterface(layer_index - 1); SessionItem* p_layer_item = m_sampleModel->insertNewItem("Layer", m_sampleModel->indexOfItem(p_parent)); p_layer_item->setItemValue(LayerItem::P_MATERIAL, createMaterialFromDomain(p_sample->material()).variant()); - TransformFromDomain::setLayerItem(p_layer_item, p_sample, p_interface); + TransformFromDomain::setLayerItem(p_layer_item, p_sample, top_interface); m_levelToParentItem[depth()] = p_layer_item; } diff --git a/Sample/Multilayer/MultiLayerUtils.cpp b/Sample/Multilayer/MultiLayerUtils.cpp index e0af6a66084a89ac6daffb99a9af3a8c4b876dec..034a259cc5cad4c3df37d6dee2af35d3d01b36ba 100644 --- a/Sample/Multilayer/MultiLayerUtils.cpp +++ b/Sample/Multilayer/MultiLayerUtils.cpp @@ -18,12 +18,6 @@ #include "Sample/Multilayer/MultiLayer.h" #include "Sample/Slice/LayerInterface.h" -const LayerInterface* MultiLayerUtils::LayerTopInterface(const MultiLayer& multilayer, size_t i) { - if (i == 0) - return nullptr; - return multilayer.layerInterface(i - 1); -} - const LayerRoughness* MultiLayerUtils::LayerTopRoughness(const MultiLayer& multilayer, size_t i) { if (i == 0) return nullptr; diff --git a/Sample/Multilayer/MultiLayerUtils.h b/Sample/Multilayer/MultiLayerUtils.h index f8081af204c4602970c4e4c96ed0f5d123c35e90..e15a7c7050390f25a89b5dbd98b34d8cfa2d0c50 100644 --- a/Sample/Multilayer/MultiLayerUtils.h +++ b/Sample/Multilayer/MultiLayerUtils.h @@ -25,9 +25,6 @@ class MultiLayer; namespace MultiLayerUtils { -//! Returns top interface of layer -const LayerInterface* LayerTopInterface(const MultiLayer& multilayer, size_t i); - //! Returns top roughness of layer const LayerRoughness* LayerTopRoughness(const MultiLayer& multilayer, size_t i);