diff --git a/Core/FormFactor/FormFactorDWBA.cpp b/Core/FormFactor/FormFactorDWBA.cpp index 93fbc0cdf2ca7845a42d2dfdd4bf60f5f78b5608..eef1c1d47536f8336bf79ed880afadedabe484e1 100644 --- a/Core/FormFactor/FormFactorDWBA.cpp +++ b/Core/FormFactor/FormFactorDWBA.cpp @@ -33,8 +33,8 @@ FormFactorDWBA* FormFactorDWBA::clone() const return result; } -void FormFactorDWBA::setSpecularInfo(const class ILayerRTCoefficients* p_in_coeffs, - const class ILayerRTCoefficients* p_out_coeffs) +void FormFactorDWBA::setSpecularInfo(const ILayerRTCoefficients* p_in_coeffs, + const ILayerRTCoefficients* p_out_coeffs) { mp_in_coeffs = p_in_coeffs; mp_out_coeffs = p_out_coeffs; diff --git a/Core/Material/HomogeneousMagneticMaterial.cpp b/Core/Material/HomogeneousMagneticMaterial.cpp index 714428c8a3ca68268dcd0d26f23aa7f13d8d4173..b2db68f9c31dfa94d96d194c24180aafd4c56e0b 100644 --- a/Core/Material/HomogeneousMagneticMaterial.cpp +++ b/Core/Material/HomogeneousMagneticMaterial.cpp @@ -14,6 +14,8 @@ // ************************************************************************** // #include "HomogeneousMagneticMaterial.h" +#include "Rotations.h" +#include "Transform3D.h" const double HomogeneousMagneticMaterial::m_magnetic_prefactor = -2.91042993836710484e-3; diff --git a/Core/Material/HomogeneousMaterial.h b/Core/Material/HomogeneousMaterial.h index 7267396f9699a1b7f703116e22b3f1b6fd529b50..df27568210b6d92dbbcdb6ee04a09d268ecd616a 100644 --- a/Core/Material/HomogeneousMaterial.h +++ b/Core/Material/HomogeneousMaterial.h @@ -17,6 +17,7 @@ #define HOMOGENEOUSMATERIAL_H #include "IMaterial.h" +#include <vector> //! @class HomogeneousMaterial //! @ingroup materials @@ -42,7 +43,7 @@ public: virtual ~HomogeneousMaterial() {} - virtual HomogeneousMaterial *clone() const; + virtual HomogeneousMaterial* clone() const; //! Return refractive index. virtual complex_t getRefractiveIndex() const { return m_refractive_index; } @@ -81,10 +82,8 @@ inline Eigen::Matrix2cd HomogeneousMaterial::getScatteringMatrix(double) const return m_refractive_index * m_refractive_index * Eigen::Matrix2cd::Identity(); } -inline const IMaterial * -HomogeneousMaterial::createTransformedMaterial(const IRotation &rotation) const +inline const IMaterial* HomogeneousMaterial::createTransformedMaterial(const IRotation&) const { - (void)rotation; return new HomogeneousMaterial(getName(), getRefractiveIndex()); } diff --git a/Core/Material/IMaterial.h b/Core/Material/IMaterial.h index 0e010841c86e13a4759fcc73e7f6242359fd4da7..376cd62ee9a532986a0004460f5dcfa15fddb4dc 100644 --- a/Core/Material/IMaterial.h +++ b/Core/Material/IMaterial.h @@ -16,9 +16,13 @@ #ifndef IMATERIAL_H #define IMATERIAL_H -#include "Rotations.h" +#include "Complex.h" +#include "EigenCore.h" +#include "INamed.h" #include "Vectors3D.h" +class IRotation; + //! @class IMaterial //! @ingroup materials_internal //! @brief Interface to a named material. @@ -26,26 +30,14 @@ class BA_CORE_API_ IMaterial : public INamed { public: - //! Constructor that sets _name_. - explicit IMaterial(const std::string &name) : INamed(name) - { - } - - //! Destructor. - virtual ~IMaterial() - { - } - - //! Clone + explicit IMaterial(const std::string &name) : INamed(name) {} + virtual ~IMaterial() {} virtual IMaterial *clone() const; //! Indicates whether the interaction with the material is scalar. //! This means that different polarization states will be diffracted //! equally - virtual bool isScalarMaterial() const - { - return true; - } + virtual bool isScalarMaterial() const { return true; } friend std::ostream &operator<<(std::ostream &ostr, const IMaterial &m) { @@ -54,10 +46,7 @@ public: } //! Return refractive index. - virtual complex_t getRefractiveIndex() const - { - return 1.0; - } + virtual complex_t getRefractiveIndex() const { return 1.0; } #ifndef SWIG //! Get the effective scattering matrix from the refractive index @@ -72,7 +61,7 @@ public: #endif //! Create a new material that is transformed with respect to this one - virtual const IMaterial *createTransformedMaterial(const class IRotation &rotation) const; + virtual const IMaterial *createTransformedMaterial(const IRotation &rotation) const; protected: virtual void print(std::ostream &ostr) const @@ -99,7 +88,7 @@ inline Eigen::Matrix2cd IMaterial::getSpecularScatteringMatrix(const kvector_t k #endif // SWIG -inline const IMaterial *IMaterial::createTransformedMaterial(const class IRotation&) const +inline const IMaterial *IMaterial::createTransformedMaterial(const IRotation&) const { throw Exceptions::NotImplementedException( "IMaterial is an interface and should not be created!"); diff --git a/Core/Sample/ISample.cpp b/Core/Sample/ISample.cpp index bac077ecf057be873b3ac47f4903f90cb5e2aef4..5839a3b31aff7bb447284bd04ca157df1a8ce762 100644 --- a/Core/Sample/ISample.cpp +++ b/Core/Sample/ISample.cpp @@ -13,6 +13,7 @@ // // ************************************************************************** // +#include "ISample.h" #include "SampleMaterialVisitor.h" #include "SamplePrintVisitor.h" @@ -22,7 +23,7 @@ ISample* ISample::cloneInvertB() const "ISample::cloneInvertB() -> Error! Method is not implemented"); } -DWBASimulation *ISample::createDWBASimulation() const +DWBASimulation* ISample::createDWBASimulation() const { return nullptr; } @@ -40,7 +41,7 @@ bool ISample::containsMagneticMaterial() const return material_vis.containsMagneticMaterial(); } -std::vector<const ISample *> ISample::getChildren() const +std::vector<const ISample*> ISample::getChildren() const { - return std::vector<const ISample*>{}; + return std::vector<const ISample*> {}; } diff --git a/Core/Vectors/EigenCore.h b/Core/Vectors/EigenCore.h index 0a639e0db202c96e0e081aea4fcda813e8926a54..f5d80536e1258e2aa695f9eb2881ec3d35f65637 100644 --- a/Core/Vectors/EigenCore.h +++ b/Core/Vectors/EigenCore.h @@ -28,6 +28,4 @@ #pragma GCC diagnostic pop #endif - #endif // EIGENCORE_H - diff --git a/Core/Vectors/Transform3D.h b/Core/Vectors/Transform3D.h index 286f75393c9aea6e8ca7c6dcf81c26fd3b33cfd1..f5c40582450895d05f72405b0c01859cafcd3c7c 100644 --- a/Core/Vectors/Transform3D.h +++ b/Core/Vectors/Transform3D.h @@ -20,7 +20,6 @@ #include "Complex.h" #include "EigenCore.h" - namespace Geometry { //! @class Transform3D diff --git a/Core/Visitors/SampleMaterialVisitor.h b/Core/Visitors/SampleMaterialVisitor.h index 1cfd93a86c6f9b38169cf4990af1a82c9962df59..7b2bcca858df2b0ac29876b0722bf2d715143967 100644 --- a/Core/Visitors/SampleMaterialVisitor.h +++ b/Core/Visitors/SampleMaterialVisitor.h @@ -18,6 +18,7 @@ #include "ISampleVisitor.h" #include "IMaterial.h" +#include <vector> //! @class SampleMaterialVisitor //! @ingroup samples_internal @@ -119,9 +120,7 @@ public: void visit(const RotationEuler*); //! return vector of material presented in the sample - std::vector<const IMaterial*> getMaterials() const { - return m_materials; - } + std::vector<const IMaterial*> getMaterials() const { return m_materials; } //! return true if contains magnetic materials bool containsMagneticMaterial() const; diff --git a/Tests/UnitTests/Core/4/HomogeneousMagneticMaterialTest.h b/Tests/UnitTests/Core/4/HomogeneousMagneticMaterialTest.h index a53778126013de2b070591077519ca02401a1707..acc5e32ba67f3c0051ffc119438fdf062418d264 100644 --- a/Tests/UnitTests/Core/4/HomogeneousMagneticMaterialTest.h +++ b/Tests/UnitTests/Core/4/HomogeneousMagneticMaterialTest.h @@ -2,6 +2,7 @@ #define HOMOGENEOUSMAGNETICMATERIALTEST_H #include "HomogeneousMagneticMaterial.h" +#include "Rotations.h" class HomogeneousMagneticMaterialTest : public ::testing::Test { @@ -35,7 +36,6 @@ TEST_F(HomogeneousMagneticMaterialTest, HomogeneousMagneticMaterialWithRefIndex) EXPECT_EQ(complex_t(3.0,4.0), matrix2(1,0)); EXPECT_EQ(complex_t(-10.0,12.0), matrix2(1,1)); - kvector_t magnetism2 = kvector_t(5.0, 6.0, 7.0); material.setMagneticField(magnetism2); EXPECT_EQ(magnetism2, material.getMagneticField()); @@ -44,7 +44,6 @@ TEST_F(HomogeneousMagneticMaterialTest, HomogeneousMagneticMaterialWithRefIndex) TEST_F(HomogeneousMagneticMaterialTest, HomogeneousMagneticMaterialWithRefIndexAndMagField) { - kvector_t magnetism = kvector_t(3.0, 4.0, 5.0); HomogeneousMagneticMaterial material("MagMaterial", 2.0, 2.0, magnetism); EXPECT_EQ("MagMaterial", material.getName()); @@ -85,7 +84,6 @@ TEST_F(HomogeneousMagneticMaterialTest, HomogeneousMagneticMaterialTransform) EXPECT_EQ(complex_t(0.0, 0.0), matrix(1,0)); EXPECT_EQ(complex_t(0.0, 0.0), matrix(1,1)); - delete tMaterial; } @@ -115,17 +113,14 @@ TEST_F(HomogeneousMagneticMaterialTest, HomogeneousMagneticMaterialClone) clone->setMagneticField(magnetism2); EXPECT_EQ(magnetism2, clone->getMagneticField()); - RotationZ transform(45.*Units::degree); const IMaterial * tMaterial = clone->createTransformedMaterial(transform); EXPECT_EQ("MagMaterial", tMaterial->getName()); EXPECT_EQ(refIndex2, tMaterial->getRefractiveIndex()); - delete tMaterial; delete clone; } - #endif // HOMOGENEOUSMAGNETICMATERIALTEST_H