From 6247a642718a33ed5d9f6c8c80967d2ac35ab34b Mon Sep 17 00:00:00 2001 From: Matthias Puchner <github@mpuchner.de> Date: Thu, 16 Dec 2021 10:50:29 +0100 Subject: [PATCH] make private where possible --- GUI/View/Realspace/RealSpaceBuilder.h | 8 +++++--- GUI/View/Realspace/TransformTo3D.cpp | 21 +-------------------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/GUI/View/Realspace/RealSpaceBuilder.h b/GUI/View/Realspace/RealSpaceBuilder.h index 2006554c171..c6a3d4ddad1 100644 --- a/GUI/View/Realspace/RealSpaceBuilder.h +++ b/GUI/View/Realspace/RealSpaceBuilder.h @@ -51,6 +51,11 @@ public: RealSpace::Vector3D::_z)) // up const; + void populateParticleFromParticle3DContainer(RealSpace::Model* model, + const Particle3DContainer& particle3DContainer, + const QVector3D& lattice_position = {}) const; + +private: void populateMultiLayer(RealSpace::Model* model, const MultiLayerItem& mlayerItem, const SceneGeometry& sceneGeometry, const QVector3D& origin = {}) const; @@ -64,9 +69,6 @@ public: void populateParticleFromParticleItem(RealSpace::Model* model, const ItemWithParticles& particleItem) const; - void populateParticleFromParticle3DContainer(RealSpace::Model* model, - const Particle3DContainer& particle3DContainer, - const QVector3D& lattice_position = {}) const; private: std::unique_ptr<RealSpace::BuilderUtils> m_builderUtils; diff --git a/GUI/View/Realspace/TransformTo3D.cpp b/GUI/View/Realspace/TransformTo3D.cpp index 30814daba63..446fb09e686 100644 --- a/GUI/View/Realspace/TransformTo3D.cpp +++ b/GUI/View/Realspace/TransformTo3D.cpp @@ -20,31 +20,12 @@ #include "GUI/View/Realspace/RealSpaceCanvas.h" #include "Sample/HardParticle/HardParticles.h" -#include <boost/polymorphic_cast.hpp> - -using boost::polymorphic_downcast; - -namespace { - -bool isTopLayer(const LayerItem& layerItem) -{ - auto layers = polymorphic_downcast<MultiLayerItem*>(layerItem.parent())->layers(); - return layers.indexOf(const_cast<LayerItem*>(&layerItem)) == 0; -} -bool isBottomLayer(const LayerItem& layerItem) -{ - auto layers = polymorphic_downcast<MultiLayerItem*>(layerItem.parent())->layers(); - return layers.indexOf(const_cast<LayerItem*>(&layerItem)) == layers.size() - 1; -} - -} // namespace - double GUI::View::TransformTo3D::visualLayerThickness(const LayerItem& layerItem, const SceneGeometry& sceneGeometry) { double thickness(0.0); - if (isTopLayer(layerItem) || isBottomLayer(layerItem)) + if (layerItem.isTopLayer() || layerItem.isBottomLayer()) thickness = sceneGeometry.topOrBottomLayerThickness; else thickness = layerItem.thickness(); -- GitLab