From f408041d64df3dcd831502ebdd319790c912aee3 Mon Sep 17 00:00:00 2001
From: Mikhail Svechnikov <m.svechnikov@fz-juelich.de>
Date: Thu, 24 Nov 2022 12:44:03 +0100
Subject: [PATCH] clang-format

---
 GUI/Model/Descriptor/AxisProperty.cpp        |  8 +--
 GUI/Model/Descriptor/DistributionItems.cpp   | 22 ++++---
 GUI/Model/Descriptor/DoubleProperty.h        |  4 +-
 GUI/Model/Device/BackgroundItems.cpp         |  4 +-
 GUI/Model/Device/BeamItems.cpp               |  4 +-
 GUI/Model/Device/FootprintItems.cpp          |  6 +-
 GUI/Model/Device/InstrumentItems.cpp         |  4 +-
 GUI/Model/Device/RectangularDetectorItem.cpp |  4 +-
 GUI/Model/Device/ResolutionFunctionItems.cpp |  6 +-
 GUI/Model/Sample/CompoundItem.cpp            |  4 +-
 GUI/Model/Sample/CoreAndShellItem.cpp        |  4 +-
 GUI/Model/Sample/FormFactorItems.cpp         | 69 ++++++++++----------
 GUI/Model/Sample/InterferenceItems.cpp       |  6 +-
 GUI/Model/Sample/Lattice2DItems.cpp          |  6 +-
 GUI/Model/Sample/LayerItem.cpp               |  6 +-
 GUI/Model/Sample/LayerRoughnessItems.cpp     |  6 +-
 GUI/Model/Sample/MesocrystalItem.cpp         |  2 +-
 GUI/Model/Sample/MultiLayerItem.cpp          |  8 +--
 GUI/Model/Sample/ParticleItem.cpp            |  2 +-
 GUI/Model/Sample/ParticleLayoutItem.cpp      |  6 +-
 GUI/Model/Sample/ProfileItems.cpp            |  6 +-
 GUI/Model/Sample/RotationItems.cpp           |  6 +-
 22 files changed, 97 insertions(+), 96 deletions(-)

diff --git a/GUI/Model/Descriptor/AxisProperty.cpp b/GUI/Model/Descriptor/AxisProperty.cpp
index aef84f281b7..41819068484 100644
--- a/GUI/Model/Descriptor/AxisProperty.cpp
+++ b/GUI/Model/Descriptor/AxisProperty.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "Base/Util/Assert.h"
 #include "GUI/Model/Descriptor/AxisProperty.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Support/XML/Serialize.h"
 
 namespace {
@@ -23,8 +23,8 @@ const QString Nbins("Nbins");
 const QString Min("Min");
 const QString Max("Max");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 using std::variant;
 
@@ -51,7 +51,7 @@ std::unique_ptr<FixedBinAxis> AxisProperty::createAxis(double scaleFactor) const
 }
 
 void AxisProperty::rwAxisProperty(Streamer& s, const QString& tag)
-{    
+{
     s.start(tag);
     s.assertVersion(0);
     Serialize::rwValue(s, Tag::Nbins, m_nbins);
diff --git a/GUI/Model/Descriptor/DistributionItems.cpp b/GUI/Model/Descriptor/DistributionItems.cpp
index f3ce1ab929c..686b879f7ee 100644
--- a/GUI/Model/Descriptor/DistributionItems.cpp
+++ b/GUI/Model/Descriptor/DistributionItems.cpp
@@ -37,8 +37,8 @@ const QString LeftWidth("LeftWidth");
 const QString MiddleWidth("MiddleWidth");
 const QString RightWidth("RightWidth");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 using std::variant;
 
@@ -63,7 +63,9 @@ void DistributionItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwValue(s, Tag::NumberOfSamples, m_numberOfSamples);
-    Serialize::rwProperty(s, Tag::SigmaFactor, m_sigmaFactor);
+
+    if (hasSigmaFactor())
+        Serialize::rwProperty(s, Tag::SigmaFactor, m_sigmaFactor);
 
     // m_limits and a changed unit (with setUnit) will not be serialized here. They have to be set
     // again by the owner of DistributionItem after reading it
@@ -93,7 +95,7 @@ void SymmetricResolutionItem::setMeanDecimals(uint d)
     m_mean.setDecimals(d);
 }
 
-void SymmetricResolutionItem::serialize(Streamer &s)
+void SymmetricResolutionItem::serialize(Streamer& s)
 {
     DistributionItem::serialize(s);
     Serialize::rwProperty(s, Tag::Mean, m_mean);
@@ -165,7 +167,7 @@ void DistributionGateItem::setRange(double min, double max)
     m_maximum.set(max);
 }
 
-void DistributionGateItem::serialize(Streamer &s)
+void DistributionGateItem::serialize(Streamer& s)
 {
     DistributionItem::serialize(s);
     Serialize::rwProperty(s, Tag::Minimum, m_minimum);
@@ -221,7 +223,7 @@ void DistributionLorentzItem::initDistribution(double value)
     m_hwhm.setLimits(RealLimits::lowerLimited(0.0));
 }
 
-void DistributionLorentzItem::serialize(Streamer &s)
+void DistributionLorentzItem::serialize(Streamer& s)
 {
     SymmetricResolutionItem::serialize(s);
     Serialize::rwProperty(s, Tag::HWHM, m_hwhm);
@@ -277,7 +279,7 @@ void DistributionGaussianItem::initDistribution(double value)
     setStandardDeviation(stddev);
 }
 
-void DistributionGaussianItem::serialize(Streamer &s)
+void DistributionGaussianItem::serialize(Streamer& s)
 {
     SymmetricResolutionItem::serialize(s);
     Serialize::rwProperty(s, Tag::StandardDeviation, m_standardDeviation);
@@ -320,7 +322,7 @@ void DistributionLogNormalItem::initDistribution(double value)
     setScaleParameter(scale);
 }
 
-void DistributionLogNormalItem::serialize(Streamer &s)
+void DistributionLogNormalItem::serialize(Streamer& s)
 {
     DistributionItem::serialize(s);
     Serialize::rwProperty(s, Tag::Median, m_median);
@@ -374,7 +376,7 @@ void DistributionCosineItem::initDistribution(double value)
     setSigma(sigma);
 }
 
-void DistributionCosineItem::serialize(Streamer &s)
+void DistributionCosineItem::serialize(Streamer& s)
 {
     SymmetricResolutionItem::serialize(s);
     Serialize::rwProperty(s, Tag::Sigma, m_sigma);
@@ -421,7 +423,7 @@ void DistributionTrapezoidItem::initDistribution(double value)
     setRightWidth(width);
 }
 
-void DistributionTrapezoidItem::serialize(Streamer &s)
+void DistributionTrapezoidItem::serialize(Streamer& s)
 {
     DistributionItem::serialize(s);
     Serialize::rwProperty(s, Tag::Center, m_center);
diff --git a/GUI/Model/Descriptor/DoubleProperty.h b/GUI/Model/Descriptor/DoubleProperty.h
index 05d7a8b6d07..6aab1e51139 100644
--- a/GUI/Model/Descriptor/DoubleProperty.h
+++ b/GUI/Model/Descriptor/DoubleProperty.h
@@ -65,7 +65,7 @@ public:
     double get() const { return m_value; }
 
     //! Persistent tag for serializing.
-//    QString persistentTag() const { return m_persistentTag; }
+    //    QString persistentTag() const { return m_persistentTag; }
 
     //! Unique id of this double property.
     QString uid() const { return m_uid; }
@@ -100,7 +100,7 @@ private:
 };
 
 namespace Serialize {
-void rwProperty(Streamer& s, const QString &tag, DoubleProperty& d);
+void rwProperty(Streamer& s, const QString& tag, DoubleProperty& d);
 } // namespace Serialize
 
 // clang-format off
diff --git a/GUI/Model/Device/BackgroundItems.cpp b/GUI/Model/Device/BackgroundItems.cpp
index 7e4fdc148ee..342e93687cc 100644
--- a/GUI/Model/Device/BackgroundItems.cpp
+++ b/GUI/Model/Device/BackgroundItems.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Descriptor/DoubleDescriptor.h"
 #include "GUI/Model/Device/BackgroundItems.h"
+#include "GUI/Model/Descriptor/DoubleDescriptor.h"
 #include "GUI/Support/XML/Serialize.h"
 #include "Sim/Background/ConstantBackground.h"
 #include "Sim/Background/PoissonBackground.h"
@@ -24,7 +24,7 @@ namespace Tag {
 const QString BackgroundValue("BackgroundValue");
 
 }
-}
+} // namespace
 
 ConstantBackgroundItem::ConstantBackgroundItem()
 {
diff --git a/GUI/Model/Device/BeamItems.cpp b/GUI/Model/Device/BeamItems.cpp
index 1c4ee4d80dc..71c9993076d 100644
--- a/GUI/Model/Device/BeamItems.cpp
+++ b/GUI/Model/Device/BeamItems.cpp
@@ -12,12 +12,12 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Device/BeamItems.h"
 #include "Base/Axis/IAxis.h"
 #include "Base/Const/Units.h"
 #include "Device/Beam/Beam.h"
 #include "GUI/Model/CatDevice/FootprintItemCatalog.h"
 #include "GUI/Model/Device/BeamAngleItems.h"
-#include "GUI/Model/Device/BeamItems.h"
 #include "GUI/Model/Device/BeamWavelengthItem.h"
 #include "GUI/Model/Device/FootprintItems.h"
 #include "GUI/Model/Device/PointwiseAxisItem.h"
@@ -33,7 +33,7 @@ const QString Wavelength("Wavelength");
 const QString AzimuthalAngle("AzimuthalAngle");
 const QString InclinationAngle("InclinationAngle");
 
-}
+} // namespace Tag
 
 // defines wavelength limits according to given maximum q value
 RealLimits getLimits(double max_q)
diff --git a/GUI/Model/Device/FootprintItems.cpp b/GUI/Model/Device/FootprintItems.cpp
index 1249221b824..323b599fdce 100644
--- a/GUI/Model/Device/FootprintItems.cpp
+++ b/GUI/Model/Device/FootprintItems.cpp
@@ -12,9 +12,9 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Device/FootprintItems.h"
 #include "Device/Beam/FootprintGauss.h"
 #include "Device/Beam/FootprintSquare.h"
-#include "GUI/Model/Device/FootprintItems.h"
 #include "GUI/Support/XML/Serialize.h"
 
 namespace {
@@ -23,8 +23,8 @@ namespace Tag {
 const QString GaussianFootprint("GaussianFootprint");
 const QString SquareFootprint("SquareFootprint");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 std::unique_ptr<IFootprintFactor> FootprintNoneItem::createFootprint() const
 {
diff --git a/GUI/Model/Device/InstrumentItems.cpp b/GUI/Model/Device/InstrumentItems.cpp
index 737254e2cc7..49ee4bcf2d4 100644
--- a/GUI/Model/Device/InstrumentItems.cpp
+++ b/GUI/Model/Device/InstrumentItems.cpp
@@ -12,6 +12,7 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Device/InstrumentItems.h"
 #include "Base/Const/Units.h"
 #include "Base/Pixel/RectangularPixel.h"
 #include "Device/Beam/Beam.h"
@@ -27,7 +28,6 @@
 #include "GUI/Model/Device/BeamWavelengthItem.h"
 #include "GUI/Model/Device/DetectorItems.h"
 #include "GUI/Model/Device/Instrument.h"
-#include "GUI/Model/Device/InstrumentItems.h"
 #include "GUI/Model/Device/PointwiseAxisItem.h"
 #include "GUI/Model/Device/RectangularDetectorItem.h"
 #include "GUI/Model/Device/SphericalDetectorItem.h"
@@ -52,7 +52,7 @@ const QString AnalyzerEfficiency("AnalyzerEfficiency");
 const QString AnalyzerTotalTransmission("AnalyzerTotalTransmission");
 const QString Beam("Beam");
 
-}
+} // namespace Tag
 
 void setBeamDistribution(ParameterDistribution::WhichParameter which,
                          const BeamDistributionItem& item, ISimulation& simulation)
diff --git a/GUI/Model/Device/RectangularDetectorItem.cpp b/GUI/Model/Device/RectangularDetectorItem.cpp
index 2d019de94a6..12fbfcc2baf 100644
--- a/GUI/Model/Device/RectangularDetectorItem.cpp
+++ b/GUI/Model/Device/RectangularDetectorItem.cpp
@@ -12,10 +12,10 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Device/RectangularDetectorItem.h"
 #include "Device/Detector/RectangularDetector.h"
 #include "GUI/Model/CatDevice/ResolutionFunctionItemCatalog.h"
 #include "GUI/Model/Device/AxesItems.h"
-#include "GUI/Model/Device/RectangularDetectorItem.h"
 #include "GUI/Model/Device/ResolutionFunctionItems.h"
 #include "GUI/Support/XML/Serialize.h"
 #include "GUI/Support/XML/UtilXML.h"
@@ -36,7 +36,7 @@ const QString u0("u0");
 const QString v0("v0");
 const QString Distance("Distance");
 
-}
+} // namespace Tag
 
 const double default_detector_width = 20.0;
 const double default_detector_height = 20.0;
diff --git a/GUI/Model/Device/ResolutionFunctionItems.cpp b/GUI/Model/Device/ResolutionFunctionItems.cpp
index ca75c6ff65e..3741fd4326d 100644
--- a/GUI/Model/Device/ResolutionFunctionItems.cpp
+++ b/GUI/Model/Device/ResolutionFunctionItems.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "Device/Resolution/ResolutionFunction2DGaussian.h"
 #include "GUI/Model/Device/ResolutionFunctionItems.h"
+#include "Device/Resolution/ResolutionFunction2DGaussian.h"
 #include "GUI/Support/XML/Serialize.h"
 
 namespace {
@@ -22,8 +22,8 @@ namespace Tag {
 const QString SigmaX("SigmaX");
 const QString SigmaY("SigmaY");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 std::unique_ptr<IResolutionFunction2D>
 ResolutionFunctionNoneItem::createResolutionFunction(double) const
diff --git a/GUI/Model/Sample/CompoundItem.cpp b/GUI/Model/Sample/CompoundItem.cpp
index a8db6731daa..6ff879aad97 100644
--- a/GUI/Model/Sample/CompoundItem.cpp
+++ b/GUI/Model/Sample/CompoundItem.cpp
@@ -12,9 +12,9 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/CatSample/ItemWithParticlesCatalog.h"
 #include "GUI/Model/CatSample/RotationItemCatalog.h"
-#include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
 #include "GUI/Model/Sample/MesocrystalItem.h"
 #include "GUI/Model/Sample/ParticleItem.h"
@@ -31,7 +31,7 @@ namespace Tag {
 const QString Abundance("Abundance");
 const QString Particles("Particles");
 
-}
+} // namespace Tag
 
 const QString abundance_tooltip = "Proportion of this type of particles normalized to the \n"
                                   "total number of particles in the layout";
diff --git a/GUI/Model/Sample/CoreAndShellItem.cpp b/GUI/Model/Sample/CoreAndShellItem.cpp
index 885a13da964..e6d038044d2 100644
--- a/GUI/Model/Sample/CoreAndShellItem.cpp
+++ b/GUI/Model/Sample/CoreAndShellItem.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Descriptor/DoubleDescriptor.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
+#include "GUI/Model/Descriptor/DoubleDescriptor.h"
 #include "GUI/Model/Sample/MaterialItems.h"
 #include "GUI/Model/Sample/ParticleItem.h"
 #include "GUI/Support/Type/VariantUtil.h"
@@ -30,7 +30,7 @@ const QString Abundance("Abundance");
 const QString Core("Core");
 const QString Shell("Shell");
 
-}
+} // namespace Tag
 
 const QString abundance_tooltip = "Proportion of this type of particles normalized to the \n"
                                   "total number of particles in the layout";
diff --git a/GUI/Model/Sample/FormFactorItems.cpp b/GUI/Model/Sample/FormFactorItems.cpp
index b616a00901c..450ead50312 100644
--- a/GUI/Model/Sample/FormFactorItems.cpp
+++ b/GUI/Model/Sample/FormFactorItems.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "Base/Const/Units.h"
 #include "GUI/Model/Sample/FormFactorItems.h"
+#include "Base/Const/Units.h"
 #include "Sample/HardParticle/HardParticles.h"
 
 namespace {
@@ -36,8 +36,8 @@ const QString HeightFlattening("HeightFlattening");
 const QString SliceBottom("SliceBottom");
 const QString SliceTop("SliceTop");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 /* ------------------------------------------------ */
 
@@ -54,7 +54,7 @@ std::unique_ptr<IFormFactor> Pyramid2Item::createFormFactor() const
     return std::make_unique<Pyramid2>(length(), width(), height(), alpha() * Units::deg);
 }
 
-void Pyramid2Item::serialize(Streamer &s)
+void Pyramid2Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -77,7 +77,7 @@ std::unique_ptr<IFormFactor> BarGaussItem::createFormFactor() const
     return std::make_unique<BarGauss>(length(), width(), height());
 }
 
-void BarGaussItem::serialize(Streamer &s)
+void BarGaussItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -99,7 +99,7 @@ std::unique_ptr<IFormFactor> BarLorentzItem::createFormFactor() const
     return std::make_unique<BarLorentz>(length(), width(), height());
 }
 
-void BarLorentzItem::serialize(Streamer &s)
+void BarLorentzItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -121,7 +121,7 @@ std::unique_ptr<IFormFactor> BoxItem::createFormFactor() const
     return std::make_unique<Box>(length(), width(), height());
 }
 
-void BoxItem::serialize(Streamer &s)
+void BoxItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -144,7 +144,7 @@ std::unique_ptr<IFormFactor> ConeItem::createFormFactor() const
     return std::make_unique<Cone>(radius(), height(), alpha() * Units::deg);
 }
 
-void ConeItem::serialize(Streamer &s)
+void ConeItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -167,7 +167,7 @@ std::unique_ptr<IFormFactor> Pyramid6Item::createFormFactor() const
     return std::make_unique<Pyramid6>(baseEdge(), height(), alpha() * Units::deg);
 }
 
-void Pyramid6Item::serialize(Streamer &s)
+void Pyramid6Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::BaseEdge, m_baseEdge);
@@ -195,7 +195,7 @@ std::unique_ptr<IFormFactor> Bipyramid4Item::createFormFactor() const
     return std::make_unique<Bipyramid4>(length(), height(), heightRatio(), alpha() * Units::deg);
 }
 
-void Bipyramid4Item::serialize(Streamer &s)
+void Bipyramid4Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -217,7 +217,7 @@ std::unique_ptr<IFormFactor> CylinderItem::createFormFactor() const
     return std::make_unique<Cylinder>(radius(), height());
 }
 
-void CylinderItem::serialize(Streamer &s)
+void CylinderItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -236,7 +236,7 @@ std::unique_ptr<IFormFactor> DodecahedronItem::createFormFactor() const
     return std::make_unique<Dodecahedron>(edge());
 }
 
-void DodecahedronItem::serialize(Streamer &s)
+void DodecahedronItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Edge, m_edge);
@@ -258,7 +258,7 @@ std::unique_ptr<IFormFactor> EllipsoidalCylinderItem::createFormFactor() const
     return std::make_unique<EllipsoidalCylinder>(radiusX(), radiusY(), height());
 }
 
-void EllipsoidalCylinderItem::serialize(Streamer &s)
+void EllipsoidalCylinderItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::RadiusX, m_radiusX);
@@ -278,7 +278,7 @@ std::unique_ptr<IFormFactor> SphereItem::createFormFactor() const
     return std::make_unique<Sphere>(radius());
 }
 
-void SphereItem::serialize(Streamer &s)
+void SphereItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -297,7 +297,7 @@ std::unique_ptr<IFormFactor> SpheroidItem::createFormFactor() const
     return std::make_unique<Spheroid>(radius(), height());
 }
 
-void SpheroidItem::serialize(Streamer &s)
+void SpheroidItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -320,7 +320,7 @@ std::unique_ptr<IFormFactor> HemiEllipsoidItem::createFormFactor() const
     return std::make_unique<HemiEllipsoid>(radiusX(), radiusY(), height());
 }
 
-void HemiEllipsoidItem::serialize(Streamer &s)
+void HemiEllipsoidItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::RadiusX, m_radiusX);
@@ -340,7 +340,7 @@ std::unique_ptr<IFormFactor> IcosahedronItem::createFormFactor() const
     return std::make_unique<Icosahedron>(edge());
 }
 
-void IcosahedronItem::serialize(Streamer &s)
+void IcosahedronItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Edge, m_edge);
@@ -359,7 +359,7 @@ std::unique_ptr<IFormFactor> Prism3Item::createFormFactor() const
     return std::make_unique<Prism3>(baseEdge(), height());
 }
 
-void Prism3Item::serialize(Streamer &s)
+void Prism3Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::BaseEdge, m_baseEdge);
@@ -379,7 +379,7 @@ std::unique_ptr<IFormFactor> Prism6Item::createFormFactor() const
     return std::make_unique<Prism6>(baseEdge(), height());
 }
 
-void Prism6Item::serialize(Streamer &s)
+void Prism6Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::BaseEdge, m_baseEdge);
@@ -401,7 +401,7 @@ std::unique_ptr<IFormFactor> Pyramid4Item::createFormFactor() const
     return std::make_unique<Pyramid4>(baseEdge(), height(), alpha() * Units::deg);
 }
 
-void Pyramid4Item::serialize(Streamer &s)
+void Pyramid4Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::BaseEdge, m_baseEdge);
@@ -423,7 +423,7 @@ std::unique_ptr<IFormFactor> CosineRippleBoxItem::createFormFactor() const
     return std::make_unique<CosineRippleBox>(length(), width(), height());
 }
 
-void CosineRippleBoxItem::serialize(Streamer &s)
+void CosineRippleBoxItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -445,7 +445,7 @@ std::unique_ptr<IFormFactor> CosineRippleGaussItem::createFormFactor() const
     return std::make_unique<CosineRippleGauss>(length(), width(), height());
 }
 
-void CosineRippleGaussItem::serialize(Streamer &s)
+void CosineRippleGaussItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -467,7 +467,7 @@ std::unique_ptr<IFormFactor> CosineRippleLorentzItem::createFormFactor() const
     return std::make_unique<CosineRippleLorentz>(length(), width(), height());
 }
 
-void CosineRippleLorentzItem::serialize(Streamer &s)
+void CosineRippleLorentzItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -491,7 +491,7 @@ std::unique_ptr<IFormFactor> SawtoothRippleBoxItem::createFormFactor() const
     return std::make_unique<SawtoothRippleBox>(length(), width(), height(), asymmetry());
 }
 
-void SawtoothRippleBoxItem::serialize(Streamer &s)
+void SawtoothRippleBoxItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -516,7 +516,7 @@ std::unique_ptr<IFormFactor> SawtoothRippleGaussItem::createFormFactor() const
     return std::make_unique<SawtoothRippleGauss>(length(), width(), height(), asymmetry());
 }
 
-void SawtoothRippleGaussItem::serialize(Streamer &s)
+void SawtoothRippleGaussItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -541,7 +541,7 @@ std::unique_ptr<IFormFactor> SawtoothRippleLorentzItem::createFormFactor() const
     return std::make_unique<SawtoothRippleLorentz>(length(), width(), height(), asymmetry());
 }
 
-void SawtoothRippleLorentzItem::serialize(Streamer &s)
+void SawtoothRippleLorentzItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -565,7 +565,7 @@ std::unique_ptr<IFormFactor> Pyramid3Item::createFormFactor() const
     return std::make_unique<Pyramid3>(baseEdge(), height(), alpha() * Units::deg);
 }
 
-void Pyramid3Item::serialize(Streamer &s)
+void Pyramid3Item::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::BaseEdge, m_baseEdge);
@@ -587,7 +587,7 @@ std::unique_ptr<IFormFactor> TruncatedCubeItem::createFormFactor() const
     return std::make_unique<TruncatedCube>(length(), removedLength());
 }
 
-void TruncatedCubeItem::serialize(Streamer &s)
+void TruncatedCubeItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -609,7 +609,7 @@ std::unique_ptr<IFormFactor> TruncatedSphereItem::createFormFactor() const
     return std::make_unique<TruncatedSphere>(radius(), height(), removedTop());
 }
 
-void TruncatedSphereItem::serialize(Streamer &s)
+void TruncatedSphereItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -638,7 +638,7 @@ std::unique_ptr<IFormFactor> TruncatedSpheroidItem::createFormFactor() const
                                                removedTop());
 }
 
-void TruncatedSpheroidItem::serialize(Streamer &s)
+void TruncatedSpheroidItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -661,7 +661,7 @@ std::unique_ptr<IFormFactor> CantellatedCubeItem::createFormFactor() const
     return std::make_unique<CantellatedCube>(length(), removedLength());
 }
 
-void CantellatedCubeItem::serialize(Streamer &s)
+void CantellatedCubeItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Length, m_length);
@@ -685,7 +685,7 @@ std::unique_ptr<IFormFactor> HorizontalCylinderItem::createFormFactor() const
     return std::make_unique<HorizontalCylinder>(radius(), length(), sliceBottom(), sliceTop());
 }
 
-void HorizontalCylinderItem::serialize(Streamer &s)
+void HorizontalCylinderItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Radius, m_radius);
@@ -706,7 +706,7 @@ std::unique_ptr<IFormFactor> PlatonicOctahedronItem::createFormFactor() const
     return std::make_unique<PlatonicOctahedron>(edge());
 }
 
-void PlatonicOctahedronItem::serialize(Streamer &s)
+void PlatonicOctahedronItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Edge, m_edge);
@@ -724,9 +724,8 @@ std::unique_ptr<IFormFactor> PlatonicTetrahedronItem::createFormFactor() const
     return std::make_unique<PlatonicTetrahedron>(edge());
 }
 
-void PlatonicTetrahedronItem::serialize(Streamer &s)
+void PlatonicTetrahedronItem::serialize(Streamer& s)
 {
     s.assertVersion(0);
     Serialize::rwProperty(s, Tag::Edge, m_edge);
 }
-
diff --git a/GUI/Model/Sample/InterferenceItems.cpp b/GUI/Model/Sample/InterferenceItems.cpp
index 5b4bbd11140..a8ed565c14b 100644
--- a/GUI/Model/Sample/InterferenceItems.cpp
+++ b/GUI/Model/Sample/InterferenceItems.cpp
@@ -12,10 +12,10 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/InterferenceItems.h"
 #include "Base/Const/Units.h"
 #include "GUI/Model/CatSample/Lattice2DItemCatalog.h"
 #include "GUI/Model/CatSample/ProfileItemCatalogs.h"
-#include "GUI/Model/Sample/InterferenceItems.h"
 #include "GUI/Model/Sample/Lattice2DItems.h"
 #include "GUI/Model/Sample/ProfileItems.h"
 #include "GUI/Support/XML/Serialize.h"
@@ -37,8 +37,8 @@ const QString Density("Density");
 const QString PeakDistance("PeakDistance");
 const QString Kappa("Kappa");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 InterferenceItem::InterferenceItem()
 {
diff --git a/GUI/Model/Sample/Lattice2DItems.cpp b/GUI/Model/Sample/Lattice2DItems.cpp
index f4c8af9be64..74884987989 100644
--- a/GUI/Model/Sample/Lattice2DItems.cpp
+++ b/GUI/Model/Sample/Lattice2DItems.cpp
@@ -12,9 +12,9 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/Lattice2DItems.h"
 #include "Base/Const/Units.h"
 #include "Base/Util/Assert.h"
-#include "GUI/Model/Sample/Lattice2DItems.h"
 #include "GUI/Support/XML/Serialize.h"
 #include "Sample/Lattice/Lattice2D.h"
 
@@ -27,8 +27,8 @@ const QString Length1("Length1");
 const QString Length2("Length2");
 const QString Angle("Angle");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 Lattice2DItem::Lattice2DItem()
 {
diff --git a/GUI/Model/Sample/LayerItem.cpp b/GUI/Model/Sample/LayerItem.cpp
index 903d1587bb7..5d3085f8b9a 100644
--- a/GUI/Model/Sample/LayerItem.cpp
+++ b/GUI/Model/Sample/LayerItem.cpp
@@ -12,9 +12,9 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/LayerItem.h"
 #include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
-#include "GUI/Model/Sample/LayerItem.h"
 #include "GUI/Model/Sample/MesocrystalItem.h"
 #include "GUI/Model/Sample/MultiLayerItem.h"
 #include "GUI/Model/Sample/ParticleItem.h"
@@ -33,7 +33,7 @@ const QString Thickness("Thickness");
 const QString Roughness("Roughness");
 const QString Layouts("Layouts");
 
-}
+} // namespace Tag
 
 QVector<ItemWithMaterial*> layoutItemsWithMaterial(ParticleLayoutItem* layout)
 {
@@ -142,7 +142,7 @@ void LayerItem::removeLayout(ParticleLayoutItem* layout)
 }
 
 void LayerItem::serialize(Streamer& s)
-{   
+{
     s.assertVersion(0);
     Serialize::rwValue(s, Tag::Name, m_name);
     Serialize::rwValue(s, Tag::Color, m_color);
diff --git a/GUI/Model/Sample/LayerRoughnessItems.cpp b/GUI/Model/Sample/LayerRoughnessItems.cpp
index 7796dc43dd6..59491440305 100644
--- a/GUI/Model/Sample/LayerRoughnessItems.cpp
+++ b/GUI/Model/Sample/LayerRoughnessItems.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Descriptor/DoubleDescriptor.h"
 #include "GUI/Model/Sample/LayerRoughnessItems.h"
+#include "GUI/Model/Descriptor/DoubleDescriptor.h"
 #include "GUI/Support/XML/Serialize.h"
 
 namespace {
@@ -23,8 +23,8 @@ const QString Sigma("Sigma");
 const QString Hurst("Hurst");
 const QString LateralCorrelationLength("LateralCorrelationLength");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 LayerBasicRoughnessItem::LayerBasicRoughnessItem()
 {
diff --git a/GUI/Model/Sample/MesocrystalItem.cpp b/GUI/Model/Sample/MesocrystalItem.cpp
index a8b302b7571..a5bf7b609fa 100644
--- a/GUI/Model/Sample/MesocrystalItem.cpp
+++ b/GUI/Model/Sample/MesocrystalItem.cpp
@@ -12,13 +12,13 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/MesocrystalItem.h"
 #include "GUI/Model/CatSample/FormFactorItemCatalog.h"
 #include "GUI/Model/CatSample/ItemWithParticlesCatalog.h"
 #include "GUI/Model/CatSample/RotationItemCatalog.h"
 #include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
 #include "GUI/Model/Sample/FormFactorItems.h"
-#include "GUI/Model/Sample/MesocrystalItem.h"
 #include "GUI/Model/Sample/ParticleItem.h"
 #include "GUI/Support/XML/Serialize.h"
 #include "GUI/Util/Error.h"
diff --git a/GUI/Model/Sample/MultiLayerItem.cpp b/GUI/Model/Sample/MultiLayerItem.cpp
index a3c764f675d..d6a6bbc2c56 100644
--- a/GUI/Model/Sample/MultiLayerItem.cpp
+++ b/GUI/Model/Sample/MultiLayerItem.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Sample/LayerItem.h"
 #include "GUI/Model/Sample/MultiLayerItem.h"
+#include "GUI/Model/Sample/LayerItem.h"
 #include "GUI/Support/XML/Backup.h"
 #include "GUI/Support/XML/Serialize.h"
 #include <QXmlStreamWriter>
@@ -27,8 +27,8 @@ const QString CrossCorrelationLength("CrossCorrelationLength");
 const QString Materials("Materials");
 const QString Layers("Layers");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 MultiLayerItem::MultiLayerItem()
 {
@@ -154,7 +154,7 @@ void MultiLayerItem::readContentFrom(QXmlStreamReader* reader)
 }
 
 void MultiLayerItem::serialize(Streamer& s)
-{    
+{
     s.assertVersion(0);
     Serialize::rwValue(s, Tag::Name, m_name);
     Serialize::rwValue(s, Tag::Description, m_description);
diff --git a/GUI/Model/Sample/ParticleItem.cpp b/GUI/Model/Sample/ParticleItem.cpp
index c5ed7dc525e..c65c08ce34f 100644
--- a/GUI/Model/Sample/ParticleItem.cpp
+++ b/GUI/Model/Sample/ParticleItem.cpp
@@ -12,12 +12,12 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/ParticleItem.h"
 #include "GUI/Model/CatSample/FormFactorItemCatalog.h"
 #include "GUI/Model/CatSample/RotationItemCatalog.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
 #include "GUI/Model/Sample/FormFactorItems.h"
 #include "GUI/Model/Sample/MaterialItem.h"
-#include "GUI/Model/Sample/ParticleItem.h"
 #include "GUI/Support/XML/Serialize.h"
 #include "Sample/Particle/IFormFactor.h"
 #include "Sample/Particle/Particle.h"
diff --git a/GUI/Model/Sample/ParticleLayoutItem.cpp b/GUI/Model/Sample/ParticleLayoutItem.cpp
index 117cb44db51..edef14c9b14 100644
--- a/GUI/Model/Sample/ParticleLayoutItem.cpp
+++ b/GUI/Model/Sample/ParticleLayoutItem.cpp
@@ -12,6 +12,7 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/ParticleLayoutItem.h"
 #include "GUI/Model/CatSample/InterferenceItemCatalog.h"
 #include "GUI/Model/CatSample/ItemWithParticlesCatalog.h"
 #include "GUI/Model/Sample/CompoundItem.h"
@@ -19,7 +20,6 @@
 #include "GUI/Model/Sample/Lattice2DItems.h"
 #include "GUI/Model/Sample/MesocrystalItem.h"
 #include "GUI/Model/Sample/ParticleItem.h"
-#include "GUI/Model/Sample/ParticleLayoutItem.h"
 #include "GUI/Support/XML/Serialize.h"
 
 namespace {
@@ -28,8 +28,8 @@ namespace Tag {
 const QString OwnDensity("OwnDensity");
 const QString Particles("Particles");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 ParticleLayoutItem::ParticleLayoutItem(const MaterialItems* materials)
     : m_materials(materials)
diff --git a/GUI/Model/Sample/ProfileItems.cpp b/GUI/Model/Sample/ProfileItems.cpp
index e5687f98566..d225196ad43 100644
--- a/GUI/Model/Sample/ProfileItems.cpp
+++ b/GUI/Model/Sample/ProfileItems.cpp
@@ -12,8 +12,8 @@
 //
 //  ************************************************************************************************
 
-#include "Base/Const/Units.h"
 #include "GUI/Model/Sample/ProfileItems.h"
+#include "Base/Const/Units.h"
 #include "GUI/Support/XML/Serialize.h"
 
 namespace {
@@ -25,8 +25,8 @@ const QString OmegaY("OmegaY");
 const QString Eta("Eta");
 const QString Gamma("Gamma");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 Profile1DItem::Profile1DItem()
 {
diff --git a/GUI/Model/Sample/RotationItems.cpp b/GUI/Model/Sample/RotationItems.cpp
index ff31f527f02..6ed7f274af2 100644
--- a/GUI/Model/Sample/RotationItems.cpp
+++ b/GUI/Model/Sample/RotationItems.cpp
@@ -12,9 +12,9 @@
 //
 //  ************************************************************************************************
 
+#include "GUI/Model/Sample/RotationItems.h"
 #include "Base/Const/Units.h"
 #include "Base/Vector/RotMatrix.h"
-#include "GUI/Model/Sample/RotationItems.h"
 #include "GUI/Support/XML/Serialize.h"
 #include "Sample/Scattering/Rotations.h"
 
@@ -26,8 +26,8 @@ const QString Alpha("Alpha");
 const QString Beta("Beta");
 const QString Gamma("Gamma");
 
-}
-}
+} // namespace Tag
+} // namespace
 
 using namespace Units;
 
-- 
GitLab