diff --git a/GUI/View/Realspace/RealSpaceBuilder.h b/GUI/View/Realspace/RealSpaceBuilder.h index 2006554c1710974ec8df1cc3504a81b921209fc3..c6a3d4ddad1caa4d6011ef027f23d6bbecb896c5 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 30814daba6357283856a9e1125511c540a437ef3..446fb09e6863add353cec87972a20e583994cc54 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();