diff --git a/GUI/coregui/mainwindow/mainwindow.cpp b/GUI/coregui/mainwindow/mainwindow.cpp index bf0f7d9e1b4b0833ae7de08a002edd982d06de67..d7a90d1a8058744282ffaf20e7f68aeca0a8bdb9 100644 --- a/GUI/coregui/mainwindow/mainwindow.cpp +++ b/GUI/coregui/mainwindow/mainwindow.cpp @@ -81,12 +81,12 @@ MainWindow::MainWindow() fillerButton->setEnabled(false); m_viewSelectionButtonsLayout->insertWidget(-1, fillerButton); -# if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) connect(m_viewSelectionButtons, &QButtonGroup::idClicked, this, &MainWindow::setCurrentView); -# else +#else connect(m_viewSelectionButtons, QOverload<int>::of(&QButtonGroup::buttonClicked), this, &MainWindow::setCurrentView); -# endif +#endif m_statusBar->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed); diff --git a/Sample/Aggregate/InterferenceFunction3DLattice.cpp b/Sample/Aggregate/InterferenceFunction3DLattice.cpp index c73a8188f703e5cea80276f02a26e95a91c6f4e2..9f66af876aac24c37ef113bd2680d40afb149412 100644 --- a/Sample/Aggregate/InterferenceFunction3DLattice.cpp +++ b/Sample/Aggregate/InterferenceFunction3DLattice.cpp @@ -62,23 +62,23 @@ double InterferenceFunction3DLattice::iff_without_dw(const kvector_t q) const kvector_t center = q; double radius = 2.1 * m_rec_radius; double inner_radius = 0.0; -// if (m_peak_shape->angularDisorder()) { -// center = kvector_t(0.0, 0.0, 0.0); -// inner_radius = std::max(0.0, q.mag() - radius); -// radius += q.mag(); -// } + // if (m_peak_shape->angularDisorder()) { + // center = kvector_t(0.0, 0.0, 0.0); + // inner_radius = std::max(0.0, q.mag() - radius); + // radius += q.mag(); + // } const auto rec_vectors = m_lattice.reciprocalLatticeVectorsWithinRadius(center, radius); - //std::cout << "IWD: q=" << q << ", r=" << radius << ", ir=" << inner_radius << + // std::cout << "IWD: q=" << q << ", r=" << radius << ", ir=" << inner_radius << // ", disordered=" << m_peak_shape->angularDisorder() << " => nVec=" << rec_vectors.size() // << std::endl; double result = 0.0; for (const auto& q_rec : rec_vectors) -// if (!(q_rec.mag() < inner_radius)) { - // result += m_peak_shape->evaluate(q, q_rec); - result += exp(-(q-q_rec).mag2()/2/pow(.06,2)); - // std::cout << " INCR: qr=" << q_rec << " => " << result << std::endl; -// } + // if (!(q_rec.mag() < inner_radius)) { + // result += m_peak_shape->evaluate(q, q_rec); + result += exp(-(q - q_rec).mag2() / 2 / pow(.06, 2)); + // std::cout << " INCR: qr=" << q_rec << " => " << result << std::endl; + // } return result; } diff --git a/Sample/HardParticle/FormFactorCantellatedCube.cpp b/Sample/HardParticle/FormFactorCantellatedCube.cpp index 0fa175123f8ed6508367b77afcbe9ad325035a8d..1bb00a8ddb81191da74b9385f0bf7e24b3286ed4 100644 --- a/Sample/HardParticle/FormFactorCantellatedCube.cpp +++ b/Sample/HardParticle/FormFactorCantellatedCube.cpp @@ -77,16 +77,11 @@ void FormFactorCantellatedCube::onChange() double a = m_length / 2; double c = a - m_removed_length; - setPolyhedron(topology, -a, {{-c, -c, +a}, // point 0 - {+c, -c, +a}, {+c, +c, +a}, {-c, +c, +a}, - {-a, -c, +c}, // point 4 - {+c, -a, +c}, {+a, +c, +c}, {-c, +a, +c}, - {-c, -a, +c}, // point 8 - {+a, -c, +c}, {+c, +a, +c}, {-a, +c, +c}, - {-a, -c, -c}, // point 12 - {+c, -a, -c}, {+a, +c, -c}, {-c, +a, -c}, - {-c, -a, -c}, // point 16 - {+a, -c, -c}, {+c, +a, -c}, {-a, +c, -c}, - {-c, -c, -a}, // point 20 + setPolyhedron(topology, -a, {{-c, -c, +a}, // point 0 + {+c, -c, +a}, {+c, +c, +a}, {-c, +c, +a}, {-a, -c, +c}, // point 4 + {+c, -a, +c}, {+a, +c, +c}, {-c, +a, +c}, {-c, -a, +c}, // point 8 + {+a, -c, +c}, {+c, +a, +c}, {-a, +c, +c}, {-a, -c, -c}, // point 12 + {+c, -a, -c}, {+a, +c, -c}, {-c, +a, -c}, {-c, -a, -c}, // point 16 + {+a, -c, -c}, {+c, +a, -c}, {-a, +c, -c}, {-c, -c, -a}, // point 20 {+c, -c, -a}, {+c, +c, -a}, {-c, +c, -a}}); } diff --git a/Sample/HardParticle/FormFactorCone.cpp b/Sample/HardParticle/FormFactorCone.cpp index 977b4b20d1bd9f0f4d610fa448059cd31efa1cbb..0c21d79592d7fe2501618574f1069b19b8551d24 100644 --- a/Sample/HardParticle/FormFactorCone.cpp +++ b/Sample/HardParticle/FormFactorCone.cpp @@ -91,5 +91,5 @@ void FormFactorCone::onChange() { m_cot_alpha = Math::cot(m_alpha); double radius2 = m_radius - m_height * m_cot_alpha; - m_shape = std::make_unique<DoubleEllipse>(m_radius, m_radius, m_height, radius2, radius2); + m_shape3D = std::make_unique<DoubleEllipse>(m_radius, m_radius, m_height, radius2, radius2); } diff --git a/Sample/HardParticle/FormFactorCylinder.cpp b/Sample/HardParticle/FormFactorCylinder.cpp index 8eeff478dc7b6ed2d7bd60bbd4113274cdf4522a..64376e49793fd70158a5ca264ca9b54a2392ac4d 100644 --- a/Sample/HardParticle/FormFactorCylinder.cpp +++ b/Sample/HardParticle/FormFactorCylinder.cpp @@ -59,5 +59,5 @@ IFormFactor* FormFactorCylinder::sliceFormFactor(ZLimits limits, const IRotation void FormFactorCylinder::onChange() { - m_shape = std::make_unique<DoubleEllipse>(m_radius, m_radius, m_height, m_radius, m_radius); + m_shape3D = std::make_unique<DoubleEllipse>(m_radius, m_radius, m_height, m_radius, m_radius); } diff --git a/Sample/HardParticle/FormFactorEllipsoidalCylinder.cpp b/Sample/HardParticle/FormFactorEllipsoidalCylinder.cpp index 302cbbc5ac0f6896f21cbe61846c24be48693600..94042f4b482ebb7920dc4366c042cda97ff0991f 100644 --- a/Sample/HardParticle/FormFactorEllipsoidalCylinder.cpp +++ b/Sample/HardParticle/FormFactorEllipsoidalCylinder.cpp @@ -67,6 +67,6 @@ IFormFactor* FormFactorEllipsoidalCylinder::sliceFormFactor(ZLimits limits, cons void FormFactorEllipsoidalCylinder::onChange() { - m_shape = + m_shape3D = std::make_unique<DoubleEllipse>(m_radius_x, m_radius_y, m_height, m_radius_x, m_radius_y); } diff --git a/Sample/HardParticle/FormFactorFullSpheroid.cpp b/Sample/HardParticle/FormFactorFullSpheroid.cpp index 8c1cf1f0206db47a4acdb3b5b18ea9ca99be2cef..954fb3419839c56a97208f4f5298e9f8ea7614fb 100644 --- a/Sample/HardParticle/FormFactorFullSpheroid.cpp +++ b/Sample/HardParticle/FormFactorFullSpheroid.cpp @@ -67,6 +67,6 @@ IFormFactor* FormFactorFullSpheroid::sliceFormFactor(ZLimits limits, const IRota void FormFactorFullSpheroid::onChange() { - m_shape = + m_shape3D = std::make_unique<TruncatedEllipsoid>(m_radius, m_radius, m_height / 2.0, m_height, 0.0); } diff --git a/Sample/HardParticle/FormFactorHemiEllipsoid.cpp b/Sample/HardParticle/FormFactorHemiEllipsoid.cpp index 560ed5a85e585b4366dea6fac576362a344e138b..41156e458b76057231218c05f4da259c57096135 100644 --- a/Sample/HardParticle/FormFactorHemiEllipsoid.cpp +++ b/Sample/HardParticle/FormFactorHemiEllipsoid.cpp @@ -76,5 +76,6 @@ complex_t FormFactorHemiEllipsoid::evaluate_for_q(cvector_t q) const void FormFactorHemiEllipsoid::onChange() { - m_shape = std::make_unique<TruncatedEllipsoid>(m_radius_x, m_radius_x, m_height, m_height, 0.0); + m_shape3D = + std::make_unique<TruncatedEllipsoid>(m_radius_x, m_radius_x, m_height, m_height, 0.0); } diff --git a/Sample/HardParticle/FormFactorHollowSphere.cpp b/Sample/HardParticle/FormFactorHollowSphere.cpp index c13958c6e2672065face9f7c68ed936c7c2df958..945fd2c3531fbcb107a98e9054aa763a28598266 100644 --- a/Sample/HardParticle/FormFactorHollowSphere.cpp +++ b/Sample/HardParticle/FormFactorHollowSphere.cpp @@ -56,7 +56,7 @@ complex_t FormFactorHollowSphere::evaluate_for_q(cvector_t q) const void FormFactorHollowSphere::onChange() { - m_shape = std::make_unique<TruncatedEllipsoid>(m_mean, m_mean, m_mean, 2.0 * m_mean, 0.0); + m_shape3D = std::make_unique<TruncatedEllipsoid>(m_mean, m_mean, m_mean, 2.0 * m_mean, 0.0); } bool FormFactorHollowSphere::checkParameters() const diff --git a/Sample/HardParticle/FormFactorLongBoxGauss.cpp b/Sample/HardParticle/FormFactorLongBoxGauss.cpp index 1678f740fe8a4eeaac349c46024868cc1d44b25d..94ad120a07cb1d7099c1857279d5f341d5dfcc09 100644 --- a/Sample/HardParticle/FormFactorLongBoxGauss.cpp +++ b/Sample/HardParticle/FormFactorLongBoxGauss.cpp @@ -56,5 +56,5 @@ IFormFactor* FormFactorLongBoxGauss::sliceFormFactor(ZLimits limits, const IRota void FormFactorLongBoxGauss::onChange() { - m_shape = std::make_unique<Box>(m_length, m_width, m_height); + m_shape3D = std::make_unique<Box>(m_length, m_width, m_height); } diff --git a/Sample/HardParticle/FormFactorLongBoxLorentz.cpp b/Sample/HardParticle/FormFactorLongBoxLorentz.cpp index e4c4d2db68b918c807ef8b8728452fe7703fd416..7e03e0ff9ba955c36ad0cb14a37d3a2aa0b3fb43 100644 --- a/Sample/HardParticle/FormFactorLongBoxLorentz.cpp +++ b/Sample/HardParticle/FormFactorLongBoxLorentz.cpp @@ -56,5 +56,5 @@ IFormFactor* FormFactorLongBoxLorentz::sliceFormFactor(ZLimits limits, const IRo void FormFactorLongBoxLorentz::onChange() { - m_shape = std::make_unique<Box>(m_length, m_width, m_height); + m_shape3D = std::make_unique<Box>(m_length, m_width, m_height); } diff --git a/Sample/HardParticle/FormFactorTruncatedCube.cpp b/Sample/HardParticle/FormFactorTruncatedCube.cpp index a3248e312785cbc3424fc4f28d044cab9cabaed6..c50d198214b66d7d1bff7306f30b2dfc1ccd9cc3 100644 --- a/Sample/HardParticle/FormFactorTruncatedCube.cpp +++ b/Sample/HardParticle/FormFactorTruncatedCube.cpp @@ -64,10 +64,8 @@ void FormFactorTruncatedCube::onChange() double c = a - m_removed_length; setPolyhedron(topology, -a, - {{-c, -a, -a}, {-a, -c, -a}, {-a, -a, -c}, {c, -a, -a}, - {a, -c, -a}, {a, -a, -c}, {-c, a, -a}, {-a, c, -a}, - {-a, a, -c}, {c, a, -a}, {a, c, -a}, {a, a, -c}, - {-c, -a, a}, {-a, -c, a}, {-a, -a, c}, {c, -a, a}, - {a, -c, a}, {a, -a, c}, {-c, a, a}, {-a, c, a}, - {-a, a, c}, {c, a, a}, {a, c, a}, {a, a, c}}); + {{-c, -a, -a}, {-a, -c, -a}, {-a, -a, -c}, {c, -a, -a}, {a, -c, -a}, {a, -a, -c}, + {-c, a, -a}, {-a, c, -a}, {-a, a, -c}, {c, a, -a}, {a, c, -a}, {a, a, -c}, + {-c, -a, a}, {-a, -c, a}, {-a, -a, c}, {c, -a, a}, {a, -c, a}, {a, -a, c}, + {-c, a, a}, {-a, c, a}, {-a, a, c}, {c, a, a}, {a, c, a}, {a, a, c}}); } diff --git a/Sample/HardParticle/FormFactorTruncatedSphere.cpp b/Sample/HardParticle/FormFactorTruncatedSphere.cpp index 604c803f3668fd52eb34dc851e171a82fd6cad06..7529fe6f48f208097d71c40811cc500ad3af1695 100644 --- a/Sample/HardParticle/FormFactorTruncatedSphere.cpp +++ b/Sample/HardParticle/FormFactorTruncatedSphere.cpp @@ -90,5 +90,5 @@ IFormFactor* FormFactorTruncatedSphere::sliceFormFactor(ZLimits limits, const IR void FormFactorTruncatedSphere::onChange() { - m_shape = std::make_unique<TruncatedEllipsoid>(m_radius, m_radius, m_radius, m_height, m_dh); + m_shape3D = std::make_unique<TruncatedEllipsoid>(m_radius, m_radius, m_radius, m_height, m_dh); } diff --git a/Sample/HardParticle/FormFactorTruncatedSpheroid.cpp b/Sample/HardParticle/FormFactorTruncatedSpheroid.cpp index b5c93046a29cb6a67ef00b7f4b3f27ddfe08acd0..224e773ce24f60c8f3b60fe53e800ec4dee63b63 100644 --- a/Sample/HardParticle/FormFactorTruncatedSpheroid.cpp +++ b/Sample/HardParticle/FormFactorTruncatedSpheroid.cpp @@ -97,6 +97,6 @@ IFormFactor* FormFactorTruncatedSpheroid::sliceFormFactor(ZLimits limits, const void FormFactorTruncatedSpheroid::onChange() { - m_shape.reset( + m_shape3D.reset( new TruncatedEllipsoid(m_radius, m_radius, m_height_flattening * m_radius, m_height, m_dh)); } diff --git a/Sample/HardParticle/IFormFactorPolyhedron.h b/Sample/HardParticle/IFormFactorPolyhedron.h index c79e4c7f55ed21325ad1a961c0f9dd038df4d797..39f58abd8eaa27dec13ee53ad6d60e1d05c1addd 100644 --- a/Sample/HardParticle/IFormFactorPolyhedron.h +++ b/Sample/HardParticle/IFormFactorPolyhedron.h @@ -26,9 +26,9 @@ class Polyhedron; class IFormFactorPolyhedron : public IBornFF { public: -// #ifdef ALGORITHM_DIAGNOSTIC -// static void setLimits(double _q, int _n); -// #endif + // #ifdef ALGORITHM_DIAGNOSTIC + // static void setLimits(double _q, int _n); + // #endif IFormFactorPolyhedron() = delete; IFormFactorPolyhedron(const NodeMeta& meta, const std::vector<double>& PValues); diff --git a/Sample/HardParticle/IProfileRipple.cpp b/Sample/HardParticle/IProfileRipple.cpp index 557118e3231db0f2623a3418a0c4ebf99ad9e2d5..64aae177586c6734cd2bf845108ae19883722267 100644 --- a/Sample/HardParticle/IProfileRipple.cpp +++ b/Sample/HardParticle/IProfileRipple.cpp @@ -63,7 +63,7 @@ complex_t IProfileRectangularRipple::factor_yz(complex_t qy, complex_t qz) const void IProfileRectangularRipple::onChange() { - m_shape = std::make_unique<Box>(m_length, m_width, m_height); + m_shape3D = std::make_unique<Box>(m_length, m_width, m_height); } // ************************************************************************************************ @@ -84,7 +84,7 @@ complex_t ICosineRipple::factor_yz(complex_t qy, complex_t qz) const void ICosineRipple::onChange() { - m_shape = std::make_unique<RippleCosine>(m_length, m_width, m_height); + m_shape3D = std::make_unique<RippleCosine>(m_length, m_width, m_height); } // ************************************************************************************************ @@ -108,5 +108,5 @@ complex_t ISawtoothRipple::factor_yz(complex_t qy, complex_t qz) const void ISawtoothRipple::onChange() { - m_shape = std::make_unique<RippleSawtooth>(m_length, m_width, m_height, m_asymmetry); + m_shape3D = std::make_unique<RippleSawtooth>(m_length, m_width, m_height, m_asymmetry); } diff --git a/Sample/HardParticle/PolyhedralComponents.cpp b/Sample/HardParticle/PolyhedralComponents.cpp index 0ebf96a3318332d93e700960428243d39a70e310..c629604e540aeaa9c9d29cb10bf64f40f19c2d35 100644 --- a/Sample/HardParticle/PolyhedralComponents.cpp +++ b/Sample/HardParticle/PolyhedralComponents.cpp @@ -24,10 +24,14 @@ constexpr auto ReciprocalFactorialArray = Math::generateReciprocalFactorialArray } // namespace #ifdef ALGORITHM_DIAGNOSTIC -void PolyhedralDiagnosis::reset() { - order = 0; algo = 0; msg.clear(); +void PolyhedralDiagnosis::reset() +{ + order = 0; + algo = 0; + msg.clear(); }; -std::string PolyhedralDiagnosis::message() const { +std::string PolyhedralDiagnosis::message() const +{ std::string ret = "algo=" + std::to_string(algo) + ", order=" + std::to_string(order); if (!msg.empty()) ret += ", msg:\n" + msg; @@ -35,15 +39,14 @@ std::string PolyhedralDiagnosis::message() const { } bool PolyhedralDiagnosis::operator==(const PolyhedralDiagnosis& other) const { - return order==other.order && algo==other.algo; + return order == other.order && algo == other.algo; } bool PolyhedralDiagnosis::operator!=(const PolyhedralDiagnosis& other) const { - return !(*this==other); + return !(*this == other); } #endif - // ************************************************************************************************ // PolyhedralEdge implementation // ************************************************************************************************ diff --git a/Sample/HardParticle/PolyhedralComponents.h b/Sample/HardParticle/PolyhedralComponents.h index 0d3b14826dac76089af8fe65c98d34ab1fcc0101..6d3f46e420c2e3ed4729cdc4ae5ef9cac4a90049 100644 --- a/Sample/HardParticle/PolyhedralComponents.h +++ b/Sample/HardParticle/PolyhedralComponents.h @@ -72,7 +72,7 @@ public: complex_t ff_n(int m, cvector_t q) const; complex_t ff(cvector_t q, bool sym_Ci) const; complex_t ff_2D(cvector_t qpa) const; - complex_t ff_2D_direct(cvector_t qpa) const; // for TestTriangle + complex_t ff_2D_direct(cvector_t qpa) const; // for TestTriangle complex_t ff_2D_expanded(cvector_t qpa) const; // for TestTriangle void assert_Ci(const PolyhedralFace& other) const; diff --git a/Sample/HardParticle/Polyhedron.cpp b/Sample/HardParticle/Polyhedron.cpp index d3f019d83d6ad7cb6ab0ff56cfc5bae5d95c7bab..38a347e5cd089225447efe92a7dbc77ca59509c6 100644 --- a/Sample/HardParticle/Polyhedron.cpp +++ b/Sample/HardParticle/Polyhedron.cpp @@ -17,12 +17,12 @@ //! "Numerically stable form factor of any polygon and polyhedron" #include "Sample/HardParticle/Polyhedron.h" -#include "Sample/HardParticle/PolyhedralTopology.h" #include "Base/Math/Functions.h" +#include "Sample/HardParticle/PolyhedralTopology.h" +#include <boost/format.hpp> #include <iomanip> #include <iostream> #include <stdexcept> // need overlooked by g++ 5.4 -#include <boost/format.hpp> namespace { const double eps = 2e-16; @@ -169,8 +169,8 @@ complex_t Polyhedron::evaluate_centered(const cvector_t& q) const term *= n_fac; #ifdef ALGORITHM_DIAGNOSTIC_LEVEL2 polyhedralDiagnosis.msg += - boost::str(boost::format(" + term(n=%2i) = %23.17e+i*%23.17e\n") - % n % term.real() % term.imag()); + boost::str(boost::format(" + term(n=%2i) = %23.17e+i*%23.17e\n") % n % term.real() + % term.imag()); #endif sum += term; if (std::abs(term) <= eps * std::abs(sum) || std::abs(sum) < eps * m_volume) @@ -193,14 +193,13 @@ complex_t Polyhedron::evaluate_centered(const cvector_t& q) const if (std::abs(qn) < eps * q.mag()) continue; complex_t term = qn * Gk.ff(q, m_sym_Ci); -#ifdef ALGORITHM_DIAGNOSTIC//_LEVEL2 - polyhedralDiagnosis.msg += - boost::str(boost::format(" + face_ff = %23.17e+i*%23.17e\n") - % term.real() % term.imag()); +#ifdef ALGORITHM_DIAGNOSTIC //_LEVEL2 + polyhedralDiagnosis.msg += boost::str(boost::format(" + face_ff = %23.17e+i*%23.17e\n") + % term.real() % term.imag()); #endif sum += term; } -#ifdef ALGORITHM_DIAGNOSTIC//_LEVEL2 +#ifdef ALGORITHM_DIAGNOSTIC //_LEVEL2 polyhedralDiagnosis.msg += boost::str(boost::format(" -> raw sum = %23.17e+i*%23.17e; divisor = %23.17e\n") % sum.real() % sum.imag() % q.mag2()); diff --git a/Sample/Scattering/IBornFF.cpp b/Sample/Scattering/IBornFF.cpp index 26399eff00bad8cc7dd60e52b7f14b0b0782c960..577f2ce3800085eac75e209d10cd3848ceef7116 100644 --- a/Sample/Scattering/IBornFF.cpp +++ b/Sample/Scattering/IBornFF.cpp @@ -16,7 +16,7 @@ #include "Base/Utils/Algorithms.h" #include "Sample/Material/WavevectorInfo.h" #include "Sample/Scattering/Rotations.h" -#include "Sample/Shapes/IShape.h" +#include "Sample/Shapes/IShape3D.h" IBornFF::IBornFF() = default; @@ -39,16 +39,16 @@ Eigen::Matrix2cd IBornFF::evaluatePol(const WavevectorInfo& wavevectors) const double IBornFF::bottomZ(const IRotation& rotation) const { - if (!m_shape) + if (!m_shape3D) return 0; - return BottomZ(m_shape->vertices(), rotation); + return BottomZ(m_shape3D->vertices(), rotation); } double IBornFF::topZ(const IRotation& rotation) const { - if (!m_shape) + if (!m_shape3D) return 0; - return TopZ(m_shape->vertices(), rotation); + return TopZ(m_shape3D->vertices(), rotation); } bool IBornFF::canSliceAnalytically(const IRotation& rot) const diff --git a/Sample/Scattering/IBornFF.h b/Sample/Scattering/IBornFF.h index 909a52bf56e15e1e6c0ed756d6f3546206ab57a6..f1db99ad85385448b375ad3d1be2d0a2204b759f 100644 --- a/Sample/Scattering/IBornFF.h +++ b/Sample/Scattering/IBornFF.h @@ -18,7 +18,7 @@ #include "Sample/Scattering/IFormFactor.h" -class IShape; +class IShape3D; //! Nested structure that holds slicing effects on position and removed parts. @@ -72,9 +72,9 @@ protected: virtual Eigen::Matrix2cd evaluate_for_q_pol(cvector_t q) const; #endif - //! IShape object, used to retrieve vertices (which may be approximate in the case + //! IShape3D object, used to retrieve vertices (which may be approximate in the case //! of round shapes). For soft particles, this will be a hard mean shape. - std::unique_ptr<IShape> m_shape; + std::unique_ptr<IShape3D> m_shape3D; //! Helper method for slicing static SlicingEffects computeSlicingEffects(ZLimits limits, const kvector_t& position, diff --git a/Sample/Shapes/Box.h b/Sample/Shapes/Box.h index 486143e990a2d0e88c01d49af7ae3fbdc6706e1e..8419147e5494a56b7db9aa794c151a4d5a27d277 100644 --- a/Sample/Shapes/Box.h +++ b/Sample/Shapes/Box.h @@ -20,9 +20,9 @@ #ifndef BORNAGAIN_SAMPLE_SHAPES_BOX_H #define BORNAGAIN_SAMPLE_SHAPES_BOX_H -#include "Sample/Shapes/IShape.h" +#include "Sample/Shapes/IShape3D.h" -class Box : public IShape { +class Box : public IShape3D { public: Box(double length, double width, double height); ~Box(); diff --git a/Sample/Shapes/DoubleEllipse.h b/Sample/Shapes/DoubleEllipse.h index 46f924263cb88098bb1d48800ba4a05eb0964664..a52f17b758f5db3758896636ecefc763d1656fbb 100644 --- a/Sample/Shapes/DoubleEllipse.h +++ b/Sample/Shapes/DoubleEllipse.h @@ -20,9 +20,9 @@ #ifndef BORNAGAIN_SAMPLE_SHAPES_DOUBLEELLIPSE_H #define BORNAGAIN_SAMPLE_SHAPES_DOUBLEELLIPSE_H -#include "Sample/Shapes/IShape.h" +#include "Sample/Shapes/IShape3D.h" -class DoubleEllipse : public IShape { +class DoubleEllipse : public IShape3D { public: DoubleEllipse(double r0_x, double r0_y, double z, double rz_x, double rz_y); ~DoubleEllipse(); diff --git a/Sample/Shapes/IShape.cpp b/Sample/Shapes/IShape3D.cpp similarity index 75% rename from Sample/Shapes/IShape.cpp rename to Sample/Shapes/IShape3D.cpp index 0aed6e1367ca32f29bbde77db995efd857b1172d..bf52d5929912c160b73ee01110438bacd8ee40f6 100644 --- a/Sample/Shapes/IShape.cpp +++ b/Sample/Shapes/IShape3D.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/Shapes/IShape.cpp -//! @brief Implements default methods of interface IShape. +//! @file Sample/Shapes/IShape3D.cpp +//! @brief Implements default methods of interface IShape3D. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,15 +12,15 @@ // // ************************************************************************************************ -#include "Sample/Shapes/IShape.h" +#include "Sample/Shapes/IShape3D.h" #include <cmath> // Value of 24 ensures that real points stick out of the convex hull at most // 1% of the radius -const size_t IShape::N_Circle = 24; +const size_t IShape3D::N_Circle = 24; -std::vector<kvector_t> IShape::vertices() const +std::vector<kvector_t> IShape3D::vertices() const { return m_vertices; } @@ -36,9 +36,9 @@ std::vector<kvector_t> RectangleVertices(double length, double width, double z) std::vector<kvector_t> EllipseVertices(double r_x, double r_y, double z) { - static constexpr double delta_angle = 2.0 * M_PI / IShape::N_Circle; - std::vector<kvector_t> result(IShape::N_Circle); - for (size_t i = 0; i < IShape::N_Circle; ++i) { + static constexpr double delta_angle = 2.0 * M_PI / IShape3D::N_Circle; + std::vector<kvector_t> result(IShape3D::N_Circle); + for (size_t i = 0; i < IShape3D::N_Circle; ++i) { double angle = i * delta_angle; double x = r_x * std::cos(angle); double y = r_y * std::sin(angle); diff --git a/Sample/Shapes/IShape.h b/Sample/Shapes/IShape3D.h similarity index 91% rename from Sample/Shapes/IShape.h rename to Sample/Shapes/IShape3D.h index 2ca482eb03608238c24c1e8a9f903e3e274e3fc5..dd16bbabc0477fd3b7ee2b68d4c10ae4d04c9d68 100644 --- a/Sample/Shapes/IShape.h +++ b/Sample/Shapes/IShape3D.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file Sample/Shapes/IShape.h -//! @brief Defines interface IShape. +//! @file Sample/Shapes/IShape3D.h +//! @brief Defines interface IShape3D. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -25,15 +25,15 @@ //! Abstract base class for different shapes. //! -//! In contrast to the form factors, these shapes only provide an intereface +//! In contrast to the form factors, these shapes only provide an interface //! for returning a set of vertices. //! @ingroup shapes_internal -class IShape { +class IShape3D { public: - IShape() {} - virtual ~IShape() {} + IShape3D() {} + virtual ~IShape3D() {} //! Retrieves a list of the vertices constituting this concrete shape virtual std::vector<kvector_t> vertices() const; diff --git a/Sample/Shapes/RippleCosine.cpp b/Sample/Shapes/RippleCosine.cpp index ac47d392555ff15cc7f45197497cbf824ff13eea..349c2fc39dc4afbf6e10d67abd8c32eaf1daf6e7 100644 --- a/Sample/Shapes/RippleCosine.cpp +++ b/Sample/Shapes/RippleCosine.cpp @@ -18,8 +18,8 @@ RippleCosine::RippleCosine(double length, double width, double height) { - size_t n_y = IShape::N_Circle + 1; - double y_step = width / (IShape::N_Circle); + size_t n_y = IShape3D::N_Circle + 1; + double y_step = width / (IShape3D::N_Circle); m_vertices.resize(2 * n_y); for (size_t i = 0; i < n_y; ++i) { double y = i * y_step - width / 2.0; diff --git a/Sample/Shapes/RippleCosine.h b/Sample/Shapes/RippleCosine.h index 89134f1a7668871b21d60bcf53ff36c0d11cd33b..17f6f323898dfbf3fe4b7ca9eebc874a46be7161 100644 --- a/Sample/Shapes/RippleCosine.h +++ b/Sample/Shapes/RippleCosine.h @@ -20,9 +20,9 @@ #ifndef BORNAGAIN_SAMPLE_SHAPES_RIPPLECOSINE_H #define BORNAGAIN_SAMPLE_SHAPES_RIPPLECOSINE_H -#include "Sample/Shapes/IShape.h" +#include "Sample/Shapes/IShape3D.h" -class RippleCosine : public IShape { +class RippleCosine : public IShape3D { public: RippleCosine(double length, double width, double height); ~RippleCosine(); diff --git a/Sample/Shapes/RippleSawtooth.h b/Sample/Shapes/RippleSawtooth.h index 6c1ebfa8ad837ded350e76eaea7973fca67093db..efdbbf350acaff53b69204b85c2475bc6ff00dee 100644 --- a/Sample/Shapes/RippleSawtooth.h +++ b/Sample/Shapes/RippleSawtooth.h @@ -20,9 +20,9 @@ #ifndef BORNAGAIN_SAMPLE_SHAPES_RIPPLESAWTOOTH_H #define BORNAGAIN_SAMPLE_SHAPES_RIPPLESAWTOOTH_H -#include "Sample/Shapes/IShape.h" +#include "Sample/Shapes/IShape3D.h" -class RippleSawtooth : public IShape { +class RippleSawtooth : public IShape3D { public: RippleSawtooth(double length, double width, double height, double asymmetry); ~RippleSawtooth(); diff --git a/Sample/Shapes/TruncatedEllipsoid.cpp b/Sample/Shapes/TruncatedEllipsoid.cpp index 14d31faeb6c889f44494f2a26c431c193763cff0..e4a23d36b1db0568c00c45cad4fe27bc9e4e1ce3 100644 --- a/Sample/Shapes/TruncatedEllipsoid.cpp +++ b/Sample/Shapes/TruncatedEllipsoid.cpp @@ -21,9 +21,9 @@ TruncatedEllipsoid::TruncatedEllipsoid(double r_x, double r_y, double r_z, doubl { static const int n_heights = std::max(2, static_cast<int>(std::round( - static_cast<double>(IShape::N_Circle) * height / 2.0 / r_z + 0.5))); + static_cast<double>(IShape3D::N_Circle) * height / 2.0 / r_z + 0.5))); double h_step = (height - dh) / (n_heights - 1); - m_vertices.resize(n_heights * IShape::N_Circle); + m_vertices.resize(n_heights * IShape3D::N_Circle); auto it = m_vertices.begin(); for (int i = 0; i < n_heights; ++i) { double z = i * h_step; diff --git a/Sample/Shapes/TruncatedEllipsoid.h b/Sample/Shapes/TruncatedEllipsoid.h index 5f1440090806a08c8315afcd28f2565cbbe82735..9f1deb0b41b3dacc9fbfd6fa4b1d8f66400d6d60 100644 --- a/Sample/Shapes/TruncatedEllipsoid.h +++ b/Sample/Shapes/TruncatedEllipsoid.h @@ -20,9 +20,9 @@ #ifndef BORNAGAIN_SAMPLE_SHAPES_TRUNCATEDELLIPSOID_H #define BORNAGAIN_SAMPLE_SHAPES_TRUNCATEDELLIPSOID_H -#include "Sample/Shapes/IShape.h" +#include "Sample/Shapes/IShape3D.h" -class TruncatedEllipsoid : public IShape { +class TruncatedEllipsoid : public IShape3D { public: TruncatedEllipsoid(double r_x, double r_y, double r_z, double height, double dh); ~TruncatedEllipsoid(); diff --git a/Sample/SoftParticle/FormFactorSphereGaussianRadius.cpp b/Sample/SoftParticle/FormFactorSphereGaussianRadius.cpp index b8a0569251082b44ecefb9acd4fc1eddd249a1e4..b02680da33263a955f86d4ccf495ea207b6e8fdf 100644 --- a/Sample/SoftParticle/FormFactorSphereGaussianRadius.cpp +++ b/Sample/SoftParticle/FormFactorSphereGaussianRadius.cpp @@ -44,7 +44,7 @@ complex_t FormFactorSphereGaussianRadius::evaluate_for_q(cvector_t q) const void FormFactorSphereGaussianRadius::onChange() { - m_shape = std::make_unique<TruncatedEllipsoid>(m_mean, m_mean, m_mean, 2.0 * m_mean, 0.0); + m_shape3D = std::make_unique<TruncatedEllipsoid>(m_mean, m_mean, m_mean, 2.0 * m_mean, 0.0); } double FormFactorSphereGaussianRadius::calculateMeanR3() const diff --git a/Sample/SoftParticle/FormFactorSphereLogNormalRadius.cpp b/Sample/SoftParticle/FormFactorSphereLogNormalRadius.cpp index 42aecfbee292f1fd3c95fdc2781ca21856527738..60f01e92dc36019117f1a293c1e297ec299ef8b7 100644 --- a/Sample/SoftParticle/FormFactorSphereLogNormalRadius.cpp +++ b/Sample/SoftParticle/FormFactorSphereLogNormalRadius.cpp @@ -62,5 +62,5 @@ complex_t FormFactorSphereLogNormalRadius::evaluate_for_q(cvector_t q) const void FormFactorSphereLogNormalRadius::onChange() { - m_shape = std::make_unique<TruncatedEllipsoid>(m_mean, m_mean, m_mean, 2.0 * m_mean, 0.0); + m_shape3D = std::make_unique<TruncatedEllipsoid>(m_mean, m_mean, m_mean, 2.0 * m_mean, 0.0); } diff --git a/Tests/SingleUse/ff-tetrahedron.cpp b/Tests/SingleUse/ff-tetrahedron.cpp index 6d3d8b10714ccf6887bc4d0fe4b0de6946a3830f..9b9e1a1a33db40b655d4d672c9cc19408061a0e0 100644 --- a/Tests/SingleUse/ff-tetrahedron.cpp +++ b/Tests/SingleUse/ff-tetrahedron.cpp @@ -10,7 +10,8 @@ //! //! To reactivate this code, just move in to ../UnitTest/Numeric/. -class AdHoc : public ::testing::Test {}; +class AdHoc : public ::testing::Test { +}; void run(const IBornFF& ff, const cvector_t& q, const cvector_t& p) { @@ -26,17 +27,17 @@ void run(const IBornFF& ff, const cvector_t& q, const cvector_t& p) std::cout << polyhedralDiagnosis.message() << "\n"; polyhedralDiagnosis.reset(); #endif - std::cout << "diff(ff)=" << ffq-ffp << "\n\n"; + std::cout << "diff(ff)=" << ffq - ffp << "\n\n"; } TEST_F(AdHoc, FF) { FormFactorTetrahedron ff(8.43, .25, .53); cvector_t q, p; - q = {{.03,-4e-16}, {-3e-17,0}, {0,0}}; + q = {{.03, -4e-16}, {-3e-17, 0}, {0, 0}}; run(ff, q, q.rotatedZ(M_TWOPI / 3)); - q = {{.03,0}, {-3e-17,0}, {0,0}}; + q = {{.03, 0}, {-3e-17, 0}, {0, 0}}; run(ff, q, q.rotatedZ(M_TWOPI / 3)); EXPECT_EQ(0, 0); diff --git a/Tests/SingleUse/ff-triangle.cpp b/Tests/SingleUse/ff-triangle.cpp index 69f049fd506d2b34fe99c1c5e06d38930301cce0..ba4e933043d415636ff87b890f0ec07811640a78 100644 --- a/Tests/SingleUse/ff-triangle.cpp +++ b/Tests/SingleUse/ff-triangle.cpp @@ -9,7 +9,8 @@ //! //! To reactivate this code, just move in to ../UnitTest/Numeric/. -class FFTriangleTest : public ::testing::Test {}; +class FFTriangleTest : public ::testing::Test { +}; TEST_F(FFTriangleTest, Triangle) { @@ -20,32 +21,31 @@ TEST_F(FFTriangleTest, Triangle) const std::vector<kvector_t> V{{-ac, as, 0.}, {-ac, -as, 0.}, {ah, 0., 0.}}; const PolyhedralFace T(V, false); - EXPECT_NEAR(T.area(), sqrt(3)/4, 1e-15); + EXPECT_NEAR(T.area(), sqrt(3) / 4, 1e-15); int failures = 0; - const int M=37; - for (int j=0; j < M; ++j) { - const double phi = M_PI_2*j/(M-1); - const cvector_t uQ{ sin(phi), cos(phi), 0. }; - const int N=2800+j; + const int M = 37; + for (int j = 0; j < M; ++j) { + const double phi = M_PI_2 * j / (M - 1); + const cvector_t uQ{sin(phi), cos(phi), 0.}; + const int N = 2800 + j; for (int i = 0; i < N; ++i) { - const double q = 1e-17*pow(1.7e17,i/(N-1.)); + const double q = 1e-17 * pow(1.7e17, i / (N - 1.)); const cvector_t Q = uQ * q; const double f1 = std::abs(T.ff_2D_direct(Q)); const double f2 = std::abs(T.ff_2D_expanded(Q)); - const double relerr = std::abs(f1-f2)/f2; - if (relerr>7e-16) { + const double relerr = std::abs(f1 - f2) / f2; + if (relerr > 7e-16) { printf("ERR1 %9.6f %16.11e %21.16e %21.16e %10.4e\n", phi, q, f1, f2, relerr); ++failures; } - if (q>1e-7) + if (q > 1e-7) continue; - const double relerr2 = std::abs(f1-T.area())/f2; - if (relerr2>7e-16) { + const double relerr2 = std::abs(f1 - T.area()) / f2; + if (relerr2 > 7e-16) { printf("ERR2 %9.6f %16.11e %21.16e %21.16e %10.4e\n", phi, q, f1, f2, relerr2); ++failures; } - } } EXPECT_EQ(failures, 0); diff --git a/Tests/UnitTests/Numeric/BisectFF.cpp b/Tests/UnitTests/Numeric/BisectFF.cpp index e2e12731dbc9771a36a8b1f9a939b1535ac7a4d7..6bedb2fdb26e9bc07bc775a1874f185237b6f690 100644 --- a/Tests/UnitTests/Numeric/BisectFF.cpp +++ b/Tests/UnitTests/Numeric/BisectFF.cpp @@ -5,9 +5,9 @@ #include "Sample/HardParticle/PolyhedralComponents.h" // for diagnostic #include "Tests/GTestWrapper/google_test.h" #include <cassert> -#include <iostream> -#include <iomanip> #include <complex> +#include <iomanip> +#include <iostream> #include <vector> const auto qlist = testing::Combine( @@ -20,85 +20,83 @@ const auto qlist = testing::Combine( cvector_t({2, 3, 0}), cvector_t({5, 0, 2}), cvector_t({0, 5, 3}), cvector_t({1, sqrt(2), 0}), cvector_t({sqrt(3), 0, 1}), cvector_t({1, 1, 1})), testing::Values(1e-19, 1e-17, 1e-15, 1e-12, 1e-9, 1e-6, 1e-3, .03, 1., 3., 10., 30., 100.), - testing::Values(-1., 1.), - testing::Values(0, -4e-16, +8e-16, -5e-11, 3e-7, -2e-3, .01, .1) - ); - + testing::Values(-1., 1.), testing::Values(0, -4e-16, +8e-16, -5e-11, 3e-7, -2e-3, .01, .1)); complex_t deriv(const IBornFF& ff, const cvector_t& qf, const complex_t Ff, const PolyhedralDiagnosis& /*df*/, const cvector_t& qdir, const double qstep) { - assert(Ff==ff.evaluate_for_q(qf)); - complex_t Fi = ff.evaluate_for_q(qf+qstep*qdir); + assert(Ff == ff.evaluate_for_q(qf)); + complex_t Fi = ff.evaluate_for_q(qf + qstep * qdir); PolyhedralDiagnosis di = polyhedralDiagnosis; - //assert(di==df); - return (Ff-Fi)/qstep; + // assert(di==df); + return (Ff - Fi) / qstep; } //! Bisect between two q's to find possible discontinuities -void bisect( - int& ifail, const cvector_t& qdir, const IBornFF& ff, - const cvector_t& q0, const cvector_t& q1, const complex_t F0, const complex_t F1, - const PolyhedralDiagnosis& d0, const PolyhedralDiagnosis& d1, - const double qmindiff, const double Fmaxreldiff) +void bisect(int& ifail, const cvector_t& qdir, const IBornFF& ff, const cvector_t& q0, + const cvector_t& q1, const complex_t F0, const complex_t F1, + const PolyhedralDiagnosis& d0, const PolyhedralDiagnosis& d1, const double qmindiff, + const double Fmaxreldiff) { - assert( d0!=d1 ); - if( (q0-q1).mag()<qmindiff ) { + assert(d0 != d1); + if ((q0 - q1).mag() < qmindiff) { // narrowed down to minimal step, now check for continuity - double aval = (std::abs(F0) + std::abs(F1))/2; - double step = std::abs(F0-F1); - double relstep = step/aval; - if( relstep>Fmaxreldiff){ - std::cout<<d0.message()<<" -> "<<d1.message()<<":\n"; - std::cout<<"relstep "<<std::setprecision(8)<<relstep<<"="<<step<<"/"<<std::setprecision(16)<<aval<<"\n"; - std::cout<<" q[-] = "<<q0<<"\n"; - std::cout<<" q[+] = "<<q1<<"\n"; - std::cout<<" F[-] = "<<F0<<"\n"; - std::cout<<" F[+] = "<<F1<<"\n"; - std::cout<<" F'[-1k] =" <<-deriv(ff, q0, F0, d0, -qdir, 1000*qmindiff)<<"\n"; - std::cout<<" F'[-300] ="<<-deriv(ff, q0, F0, d0, -qdir, 300*qmindiff)<<"\n"; - std::cout<<" F'[-100] ="<<-deriv(ff, q0, F0, d0, -qdir, 100*qmindiff)<<"\n"; - std::cout<<" F'[-30] =" <<-deriv(ff, q0, F0, d0, -qdir, 30*qmindiff)<<"\n"; - std::cout<<" F'[-10] =" <<-deriv(ff, q0, F0, d0, -qdir, 10*qmindiff)<<"\n"; - std::cout<<" F'[-3] =" <<-deriv(ff, q0, F0, d0, -qdir, 3*qmindiff)<<"\n"; - std::cout<<" F'[-1] =" <<-deriv(ff, q0, F0, d0, -qdir, 1*qmindiff)<<"\n"; - std::cout<<" F'[here]="<<(F1-F0)/(q0-q1).mag()<<"\n"; - std::cout<<" F'[+1] ="<<deriv(ff, q1, F1, d1, +qdir, 1*qmindiff)<<"\n"; - std::cout<<" F'[+3] ="<<deriv(ff, q1, F1, d1, +qdir, 3*qmindiff)<<"\n"; - std::cout<<" F'[+10] ="<<deriv(ff, q1, F1, d1, +qdir, 10*qmindiff)<<"\n"; - std::cout<<" F'[+30] ="<<deriv(ff, q1, F1, d1, +qdir, 30*qmindiff)<<"\n"; - std::cout<<" F'[+100] ="<<deriv(ff, q1, F1, d1, +qdir, 100*qmindiff)<<"\n"; - std::cout<<" F'[+300] ="<<deriv(ff, q1, F1, d1, +qdir, 300*qmindiff)<<"\n"; - std::cout<<" F'[+1k] ="<<deriv(ff, q1, F1, d1, +qdir, 1000*qmindiff)<<"\n"; - std::cout<<std::endl; + double aval = (std::abs(F0) + std::abs(F1)) / 2; + double step = std::abs(F0 - F1); + double relstep = step / aval; + if (relstep > Fmaxreldiff) { + std::cout << d0.message() << " -> " << d1.message() << ":\n"; + std::cout << "relstep " << std::setprecision(8) << relstep << "=" << step << "/" + << std::setprecision(16) << aval << "\n"; + std::cout << " q[-] = " << q0 << "\n"; + std::cout << " q[+] = " << q1 << "\n"; + std::cout << " F[-] = " << F0 << "\n"; + std::cout << " F[+] = " << F1 << "\n"; + std::cout << " F'[-1k] =" << -deriv(ff, q0, F0, d0, -qdir, 1000 * qmindiff) << "\n"; + std::cout << " F'[-300] =" << -deriv(ff, q0, F0, d0, -qdir, 300 * qmindiff) << "\n"; + std::cout << " F'[-100] =" << -deriv(ff, q0, F0, d0, -qdir, 100 * qmindiff) << "\n"; + std::cout << " F'[-30] =" << -deriv(ff, q0, F0, d0, -qdir, 30 * qmindiff) << "\n"; + std::cout << " F'[-10] =" << -deriv(ff, q0, F0, d0, -qdir, 10 * qmindiff) << "\n"; + std::cout << " F'[-3] =" << -deriv(ff, q0, F0, d0, -qdir, 3 * qmindiff) << "\n"; + std::cout << " F'[-1] =" << -deriv(ff, q0, F0, d0, -qdir, 1 * qmindiff) << "\n"; + std::cout << " F'[here]=" << (F1 - F0) / (q0 - q1).mag() << "\n"; + std::cout << " F'[+1] =" << deriv(ff, q1, F1, d1, +qdir, 1 * qmindiff) << "\n"; + std::cout << " F'[+3] =" << deriv(ff, q1, F1, d1, +qdir, 3 * qmindiff) << "\n"; + std::cout << " F'[+10] =" << deriv(ff, q1, F1, d1, +qdir, 10 * qmindiff) << "\n"; + std::cout << " F'[+30] =" << deriv(ff, q1, F1, d1, +qdir, 30 * qmindiff) << "\n"; + std::cout << " F'[+100] =" << deriv(ff, q1, F1, d1, +qdir, 100 * qmindiff) << "\n"; + std::cout << " F'[+300] =" << deriv(ff, q1, F1, d1, +qdir, 300 * qmindiff) << "\n"; + std::cout << " F'[+1k] =" << deriv(ff, q1, F1, d1, +qdir, 1000 * qmindiff) << "\n"; + std::cout << std::endl; ++ifail; // maxrelstep = relstep; return; } - // std::cout<<"ok for "<<d0.message()<<"->"<<d1.message()<<" at q between "<<q0<<" and "<<q1<<std::endl; + // std::cout<<"ok for "<<d0.message()<<"->"<<d1.message()<<" at q between "<<q0<<" and + // "<<q1<<std::endl; return; } - cvector_t q2 = (q0 + q1)/2.; + cvector_t q2 = (q0 + q1) / 2.; complex_t F2 = ff.evaluate_for_q(q2); PolyhedralDiagnosis d2 = polyhedralDiagnosis; - if( d2!=d0 ) + if (d2 != d0) bisect(ifail, qdir, ff, q0, q2, F0, F2, d0, d2, qmindiff, Fmaxreldiff); - if( d2!=d1 ) + if (d2 != d1) bisect(ifail, qdir, ff, q2, q1, F2, F1, d2, d1, qmindiff, Fmaxreldiff); } void run_bisection(int& ifail, IBornFF& ff, const cvector_t& q0, const cvector_t& q1) { - const double qdiffmin = std::max(q0.mag(), q1.mag())/4e11; + const double qdiffmin = std::max(q0.mag(), q1.mag()) / 4e11; complex_t F0 = ff.evaluate_for_q(q0); PolyhedralDiagnosis d0 = polyhedralDiagnosis; complex_t F1 = ff.evaluate_for_q(q1); PolyhedralDiagnosis d1 = polyhedralDiagnosis; - if (d0==d1) + if (d0 == d1) return; - bisect(ifail, q1-q0, ff, q0, q1, F0, F1, d0, d1, qdiffmin, .6e-10); + bisect(ifail, q1 - q0, ff, q0, q1, F0, F1, d0, d1, qdiffmin, .6e-10); } void run_test(IBornFF& ff) @@ -112,7 +110,7 @@ void run_test(IBornFF& ff) const double qrealmag = std::get<2>(it); const double qrel1 = std::get<3>(it); const double qimagrel = std::get<4>(it); - const complex_t qmag(qrealmag, qrealmag*qimagrel); + const complex_t qmag(qrealmag, qrealmag * qimagrel); const cvector_t q0 = q_dir0 * qmag; const cvector_t q1 = q_dir1 * (qmag * qrel1); run_bisection(ifail, ff, q0, q1); @@ -120,7 +118,8 @@ void run_test(IBornFF& ff) EXPECT_EQ(ifail, 0); } -class BisectFF : public testing::Test {}; +class BisectFF : public testing::Test { +}; TEST_F(BisectFF, Bisect1) { diff --git a/Tests/UnitTests/Numeric/FormFactorSpecializationTest.cpp b/Tests/UnitTests/Numeric/FormFactorSpecializationTest.cpp index 8c68db729ef7e35989b793033b92edadf2d58bb6..91e1c8d5a74a87c10116add022f28423290d0d0d 100644 --- a/Tests/UnitTests/Numeric/FormFactorSpecializationTest.cpp +++ b/Tests/UnitTests/Numeric/FormFactorSpecializationTest.cpp @@ -20,15 +20,15 @@ private: const complex_t f0 = p0->evaluate_for_q(q); const complex_t f1 = p1->evaluate_for_q(q); const double avge = (std::abs(f0) + std::abs(f1)) / 2; - const double precision = std::max(1e-16, eps*avge); - EXPECT_NEAR(real(f0), real(f1), precision) << "q=" << q << "\n" + const double precision = std::max(1e-16, eps * avge); + EXPECT_NEAR(real(f0), real(f1), precision) << "q=" << q << "\n" #ifdef ALGORITHM_DIAGNOSTIC - << polyhedralDiagnosis.message() << "\n" + << polyhedralDiagnosis.message() << "\n" #endif ; - EXPECT_NEAR(imag(f0), imag(f1), precision) << "q=" << q << "\n" + EXPECT_NEAR(imag(f0), imag(f1), precision) << "q=" << q << "\n" #ifdef ALGORITHM_DIAGNOSTIC - << polyhedralDiagnosis.message() << "\n" + << polyhedralDiagnosis.message() << "\n" #endif ; } diff --git a/Tests/UnitTests/Numeric/FormFactorSymmetryTest.cpp b/Tests/UnitTests/Numeric/FormFactorSymmetryTest.cpp index b37b3c24ad4fb86bda4be65fed8dd034434c5244..77e543f16e8a7c9c7a77815a6e4ae945fc0503c6 100644 --- a/Tests/UnitTests/Numeric/FormFactorSymmetryTest.cpp +++ b/Tests/UnitTests/Numeric/FormFactorSymmetryTest.cpp @@ -1,8 +1,8 @@ #include "Base/Math/Constants.h" #include "Sample/HardParticle/HardParticles.h" +#include "Sample/HardParticle/PolyhedralComponents.h" // for diagnostic #include "Tests/GTestWrapper/google_test.h" #include "Tests/UnitTests/Numeric/MultiQTestbed.h" -#include "Sample/HardParticle/PolyhedralComponents.h" // for diagnostic //! Check that form factors are invariant when q is transformed according to particle symmetry. @@ -18,19 +18,19 @@ private: #endif const complex_t f1 = ff->evaluate_for_q(p); const double avge = (std::abs(f0) + std::abs(f1)) / 2; - const double precision = std::max(1e-16, eps*avge); - EXPECT_NEAR(real(f0), real(f1), precision) << "q=" << q << ", p=" << p + const double precision = std::max(1e-16, eps * avge); + EXPECT_NEAR(real(f0), real(f1), precision) + << "q=" << q << ", p=" << p #ifdef ALGORITHM_DIAGNOSTIC - << "\n msg(q): " << msg0 << "\n" - << "\n msg(p): " - << polyhedralDiagnosis.message() << "\n" + << "\n msg(q): " << msg0 << "\n" + << "\n msg(p): " << polyhedralDiagnosis.message() << "\n" #endif ; - EXPECT_NEAR(imag(f0), imag(f1), precision) << "q=" << q << ", p=" << p + EXPECT_NEAR(imag(f0), imag(f1), precision) + << "q=" << q << ", p=" << p #ifdef ALGORITHM_DIAGNOSTIC - << "\n msg(q): " << msg0 << "\n" - << "\n msg(p): " - << polyhedralDiagnosis.message() << "\n" + << "\n msg(q): " << msg0 << "\n" + << "\n msg(p): " << polyhedralDiagnosis.message() << "\n" #endif ; } @@ -57,10 +57,11 @@ TEST_F(FFSymmetryTest, Prism6) { FormFactorPrism6 ff(1.33, .42); run_test( - &ff, [](const cvector_t& q) -> cvector_t { return q.rotatedZ(M_PI / 3); }, 1e-13, 1e-99, 50); + &ff, [](const cvector_t& q) -> cvector_t { return q.rotatedZ(M_PI / 3); }, 1e-13, 1e-99, + 50); run_test( - &ff, [](const cvector_t& q) -> cvector_t { return q.rotatedZ(-M_TWOPI / 3); }, 1e-13, - 1e-99, 50); + &ff, [](const cvector_t& q) -> cvector_t { return q.rotatedZ(-M_TWOPI / 3); }, 1e-13, 1e-99, + 50); } TEST_F(FFSymmetryTest, Tetrahedron) diff --git a/Tests/UnitTests/Numeric/MultiQTestbed.cpp b/Tests/UnitTests/Numeric/MultiQTestbed.cpp index 5126ad519928168a075049993751fa5f30c355dc..fa4467dbf23b94152e73ed6e4d6f793d435a7ed6 100644 --- a/Tests/UnitTests/Numeric/MultiQTestbed.cpp +++ b/Tests/UnitTests/Numeric/MultiQTestbed.cpp @@ -16,8 +16,7 @@ const auto qlist = testing::Combine( cvector_t({1, 1, 1})), testing::Values(1e-19, 1e-17, 1e-15, 1e-12, 1e-9, 1e-6, 1e-3, .03, 1., 1e1, 1e2, 1e3, 1e4), testing::Values(0, -4e-16, +8e-16, -5e-11, 3e-7, -2e-3, .01, .1), - testing::Values(-1e-15, +1e-14, -1e-11, 1e-7, -1e-3, .1, 1, sqrt(2), sqrt(3)) - ); + testing::Values(-1e-15, +1e-14, -1e-11, 1e-7, -1e-3, .1, 1, sqrt(2), sqrt(3))); void run_test_for_many_q(std::function<void(cvector_t)> run_one_test, double qmag_min, double qmag_max) @@ -29,7 +28,7 @@ void run_test_for_many_q(std::function<void(cvector_t)> run_one_test, double qma const double qrealmag = std::get<2>(it); const double qimagrel = std::get<3>(it); const double qsidemag = std::get<4>(it); - const complex_t qmag(qrealmag, qrealmag*qimagrel); + const complex_t qmag(qrealmag, qrealmag * qimagrel); if (std::abs(qmag) <= qmag_min || std::abs(qmag) >= qmag_max) continue; if (q_maindir == q_sidedir) diff --git a/Tests/UnitTests/Numeric/MultiQTestbed.h b/Tests/UnitTests/Numeric/MultiQTestbed.h index d20387489b17e2343dc6288368fbf0d0d86f4a39..bf1ff81076f6409355d4bcbd95667e18fc46cda8 100644 --- a/Tests/UnitTests/Numeric/MultiQTestbed.h +++ b/Tests/UnitTests/Numeric/MultiQTestbed.h @@ -1,5 +1,5 @@ -#ifndef BORNAGAIN_TESTS_UNITTESTS_NUMERIC_FORMFACTORTEST_H -#define BORNAGAIN_TESTS_UNITTESTS_NUMERIC_FORMFACTORTEST_H +#ifndef BORNAGAIN_TESTS_UNITTESTS_NUMERIC_MULTIQTESTBED_H +#define BORNAGAIN_TESTS_UNITTESTS_NUMERIC_MULTIQTESTBED_H #include "Base/Vector/Vectors3D.h" #include <functional> @@ -12,6 +12,6 @@ namespace formFactorTest { void run_test_for_many_q(std::function<void(cvector_t)> run_one_test, double qmag_min, double qmag_max); -} +} // namespace formFactorTest -#endif // BORNAGAIN_TESTS_UNITTESTS_NUMERIC_FORMFACTORTEST_H +#endif // BORNAGAIN_TESTS_UNITTESTS_NUMERIC_MULTIQTESTBED_H diff --git a/Tests/UnitTests/gui2/libtestmachinery/test_utils.h b/Tests/UnitTests/gui2/libtestmachinery/test_utils.h index 0ec1ddafe0b547f5217f90af932149739ad9f361..3f0f96a4fbe9025132d785797698f9f357d47ba1 100644 --- a/Tests/UnitTests/gui2/libtestmachinery/test_utils.h +++ b/Tests/UnitTests/gui2/libtestmachinery/test_utils.h @@ -14,7 +14,7 @@ #include <QString> #include <memory> -//! @file test_utils.h +//! @file Tests/UnitTests/gui2/libtestmachinery/test_utils.h //! @brief Collection of utility functions for various unit tests. class QJsonObject; diff --git a/auto/Wrap/doxygenSample.i b/auto/Wrap/doxygenSample.i index 999a7b07d1b804bd544d2521a82c35df52fb005a..a05b6b7c45791deccd18b5df2cc387bffdac3f08 100644 --- a/auto/Wrap/doxygenSample.i +++ b/auto/Wrap/doxygenSample.i @@ -4582,23 +4582,23 @@ C++ includes: ISelectionRule.h "; -// File: classIShape.xml -%feature("docstring") IShape " +// File: classIShape3D.xml +%feature("docstring") IShape3D " Abstract base class for different shapes. -In contrast to the form factors, these shapes only provide an intereface for returning a set of vertices. +In contrast to the form factors, these shapes only provide an interface for returning a set of vertices. -C++ includes: IShape.h +C++ includes: IShape3D.h "; -%feature("docstring") IShape::IShape "IShape::IShape() +%feature("docstring") IShape3D::IShape3D "IShape3D::IShape3D() "; -%feature("docstring") IShape::~IShape "virtual IShape::~IShape() +%feature("docstring") IShape3D::~IShape3D "virtual IShape3D::~IShape3D() "; -%feature("docstring") IShape::vertices "std::vector< kvector_t > IShape::vertices() const +%feature("docstring") IShape3D::vertices "std::vector< kvector_t > IShape3D::vertices() const Retrieves a list of the vertices constituting this concrete shape. "; @@ -8768,7 +8768,7 @@ Returns concatenated rotation (first right, then left). // File: DoubleEllipse_8h.xml -// File: IShape_8cpp.xml +// File: IShape3D_8cpp.xml %feature("docstring") RectangleVertices "std::vector<kvector_t> RectangleVertices(double length, double width, double z) Helper functions to construct lists of vertices @@ -8782,7 +8782,7 @@ Generate vertices of centered ellipse with given semi-axes at height z. "; -// File: IShape_8h.xml +// File: IShape3D_8h.xml %feature("docstring") RectangleVertices "std::vector<kvector_t> RectangleVertices(double length, double width, double z) Helper functions to construct lists of vertices diff --git a/gui2/model/instrumentitems.h b/gui2/model/instrumentitems.h index 9372beb60d35965e6a2c93a033246bd9e2a2dccb..7e39a9290cfa763a9b4dbdf3c133e0a2aba08868 100644 --- a/gui2/model/instrumentitems.h +++ b/gui2/model/instrumentitems.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_GUI2_MODEL_INSTRUMENTITEMS_H #define BORNAGAIN_GUI2_MODEL_INSTRUMENTITEMS_H -//! @file instrumentitems.h +//! @file gui2/model/instrumentitems.h //! Collection of items to construct specular instrument. #include "darefl_export.h" diff --git a/gui2/model/sampleitems.h b/gui2/model/sampleitems.h index dd9e65d8119dd6539574218c9fc73ab8e95dfcea..5e086d98011b6ad25874f0a8267e84f839be6c34 100644 --- a/gui2/model/sampleitems.h +++ b/gui2/model/sampleitems.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_GUI2_MODEL_SAMPLEITEMS_H #define BORNAGAIN_GUI2_MODEL_SAMPLEITEMS_H -//! @file sampleitems.h +//! @file gui2/model/sampleitems.h //! Collection of layer and multi-layer items to populate SampleModel. #include "darefl_export.h" diff --git a/mvvm/model/mvvm/commands/commandutils.h b/mvvm/model/mvvm/commands/commandutils.h index da8d5c855747ba05d6eb8e98ca7f73bac615af3c..7adb35dc46a4c8318590880be5de6a29167e709c 100644 --- a/mvvm/model/mvvm/commands/commandutils.h +++ b/mvvm/model/mvvm/commands/commandutils.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_MODEL_MVVM_COMMANDS_COMMANDUTILS_H #define BORNAGAIN_MVVM_MODEL_MVVM_COMMANDS_COMMANDUTILS_H -//! @file commandutils.h +//! @file mvvm/model/mvvm/commands/commandutils.h //! Collection of various utility functions for command service. #include "mvvm/interfaces/itembackupstrategy.h" diff --git a/mvvm/model/mvvm/commands/insertnewitemcommand.cpp b/mvvm/model/mvvm/commands/insertnewitemcommand.cpp index 958b10af03c0b762696ffe8f05108ebcae5f1ce3..741aca6d9950496e401cb1cc9a534f408640998f 100644 --- a/mvvm/model/mvvm/commands/insertnewitemcommand.cpp +++ b/mvvm/model/mvvm/commands/insertnewitemcommand.cpp @@ -61,14 +61,13 @@ void InsertNewItemCommand::execute_command() auto child = p_impl->factory_func().release(); // here we restore original identifier to get exactly same item on consequitive undo/redo if (!p_impl->initial_identifier.empty()) - child->setData(QVariant::fromValue(p_impl->initial_identifier), - ItemDataRole::IDENTIFIER, /*direct*/true); + child->setData(QVariant::fromValue(p_impl->initial_identifier), ItemDataRole::IDENTIFIER, + /*direct*/ true); setDescription(generate_description(child->modelType(), p_impl->tagrow)); if (parent->insertItem(child, p_impl->tagrow)) { setResult(child); - } - else { + } else { delete child; setObsolete(true); } diff --git a/mvvm/model/mvvm/commands/setvaluecommand.cpp b/mvvm/model/mvvm/commands/setvaluecommand.cpp index 30f6d9fe183053cea00c713b7c7c4e7f07161082..21b9658d211f5ec9c3a0a6e93638ad3ffe0a36d0 100644 --- a/mvvm/model/mvvm/commands/setvaluecommand.cpp +++ b/mvvm/model/mvvm/commands/setvaluecommand.cpp @@ -60,7 +60,7 @@ void SetValueCommand::swap_values() { auto item = itemFromPath(p_impl->m_item_path); auto old = item->data<Variant>(p_impl->m_role); - auto result = item->setData(p_impl->m_value, p_impl->m_role, /*direct*/true); + auto result = item->setData(p_impl->m_value, p_impl->m_role, /*direct*/ true); setResult(result); setObsolete(!result); p_impl->m_value = old; diff --git a/mvvm/model/mvvm/core/filesystem.h b/mvvm/model/mvvm/core/filesystem.h index 6130066dbbda88b5131859499f34f41261a08867..6a690cc75c8086fa919e4005f14c89a9dcf8af50 100644 --- a/mvvm/model/mvvm/core/filesystem.h +++ b/mvvm/model/mvvm/core/filesystem.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_MODEL_MVVM_CORE_FILESYSTEM_H #define BORNAGAIN_MVVM_MODEL_MVVM_CORE_FILESYSTEM_H -//! @file Include of <filesystem> library for older compilers (<gcc8.0) +//! @file mvvm/model/mvvm/core/filesystem.h of <filesystem> library for older compilers (<gcc8.0) //! See //! https://stackoverflow.com/questions/53365538/how-to-determine-whether-to-use-filesystem-or-experimental-filesystem diff --git a/mvvm/model/mvvm/core/variant.h b/mvvm/model/mvvm/core/variant.h index e12ba72252fa18d9408b2f3e4b2a0fab628426b7..ac0c2e35cd504964a3930521cc5751a22f9f7903 100644 --- a/mvvm/model/mvvm/core/variant.h +++ b/mvvm/model/mvvm/core/variant.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_MODEL_MVVM_CORE_VARIANT_H #define BORNAGAIN_MVVM_MODEL_MVVM_CORE_VARIANT_H -//! @file variant.h +//! @file mvvm/model/mvvm/core/variant.h //! Defines variant type (intermediate step toward migration from QVariant to std::variant). #include <QVariant> diff --git a/mvvm/model/mvvm/core/version.h b/mvvm/model/mvvm/core/version.h index 96364e6ad75acba09cdd9e20ff01356edaf824e1..758d96a7066b2b58350de1a8d1d2a99ab8ceefc1 100644 --- a/mvvm/model/mvvm/core/version.h +++ b/mvvm/model/mvvm/core/version.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_MODEL_MVVM_CORE_VERSION_H #define BORNAGAIN_MVVM_MODEL_MVVM_CORE_VERSION_H -//! @file version.h +//! @file mvvm/model/mvvm/core/version.h //! Automatically generated from mvvm_version.h.in #include <string> diff --git a/mvvm/model/mvvm/factories/itemconverterfactory.h b/mvvm/model/mvvm/factories/itemconverterfactory.h index 52cacaa138bf78816bd254e52514d5ff7e49bdef..57ee5c899da867bea5c8d8d64268b51f2423f927 100644 --- a/mvvm/model/mvvm/factories/itemconverterfactory.h +++ b/mvvm/model/mvvm/factories/itemconverterfactory.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_MODEL_MVVM_FACTORIES_ITEMCONVERTERFACTORY_H #define BORNAGAIN_MVVM_MODEL_MVVM_FACTORIES_ITEMCONVERTERFACTORY_H -//! @file itemconverterfactory.h +//! @file mvvm/model/mvvm/factories/itemconverterfactory.h //! Collection of factory functions to create SessionItem converters to/from serialized content. #include "mvvm/serialization/jsonitemconverterinterface.h" diff --git a/mvvm/model/mvvm/factories/modelconverterfactory.h b/mvvm/model/mvvm/factories/modelconverterfactory.h index b10112d1288757a4898e43d5d6c4acae13a0e430..8f92735937d6f822fc96e5dee945b188060225d7 100644 --- a/mvvm/model/mvvm/factories/modelconverterfactory.h +++ b/mvvm/model/mvvm/factories/modelconverterfactory.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_MODEL_MVVM_FACTORIES_MODELCONVERTERFACTORY_H #define BORNAGAIN_MVVM_MODEL_MVVM_FACTORIES_MODELCONVERTERFACTORY_H -//! @file modelconverterfactory.h +//! @file mvvm/model/mvvm/factories/modelconverterfactory.h //! Collection of factory functions to create SessionModel converters to/from serialized content. #include "mvvm/serialization/jsonmodelconverterinterface.h" diff --git a/mvvm/model/mvvm/model/customvariants.h b/mvvm/model/mvvm/model/customvariants.h index 50ec68d9303d09f585bfd0e20433f09a1fec3a19..00d7ddc94d3bf73b484b8f33ca6794e26cb8e423 100644 --- a/mvvm/model/mvvm/model/customvariants.h +++ b/mvvm/model/mvvm/model/customvariants.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_MODEL_MVVM_MODEL_CUSTOMVARIANTS_H #define BORNAGAIN_MVVM_MODEL_MVVM_MODEL_CUSTOMVARIANTS_H -//! @file customvariants.h +//! @file mvvm/model/mvvm/model/customvariants.h //! Registrations and translations for custom variants. #include "mvvm/core/variant.h" diff --git a/mvvm/model/mvvm/model/taginfo.h b/mvvm/model/mvvm/model/taginfo.h index 831d2183616728132bf6ea76518dbea000b81abc..f352b1cf6ee44a6df0c4d664b70a415534c65167 100644 --- a/mvvm/model/mvvm/model/taginfo.h +++ b/mvvm/model/mvvm/model/taginfo.h @@ -22,8 +22,8 @@ namespace ModelView { //! Holds info about single tag for SessionItem. -//! The tag specifies information about children that can be added to a SessionItem. A tag has a name, -//! min, max allowed number of children, and vector of all modelTypes that children can have. +//! The tag specifies information about children that can be added to a SessionItem. A tag has a +//! name, min, max allowed number of children, and vector of all modelTypes that children can have. class MVVM_MODEL_EXPORT TagInfo { public: diff --git a/mvvm/model/mvvm/model/variant_constants.h b/mvvm/model/mvvm/model/variant_constants.h index 68cf1e6783bf08e468b1b536021cfd61368c668c..9f53bc5b6685a5de2b774e547f3b82bf3fad66fb 100644 --- a/mvvm/model/mvvm/model/variant_constants.h +++ b/mvvm/model/mvvm/model/variant_constants.h @@ -17,7 +17,7 @@ #include <string> -//! @file variant-constants.h +//! @file mvvm/model/mvvm/model/variant_constants.h //! Collection of constants with supported variant names. namespace ModelView { diff --git a/mvvm/model/mvvm/serialization/compatibilityutils.h b/mvvm/model/mvvm/serialization/compatibilityutils.h index d78d6c0d4e64b939cd1d1a5958c3ea2c513a0d40..0810cb196a162c5cce08d9615461522a2e855501 100644 --- a/mvvm/model/mvvm/serialization/compatibilityutils.h +++ b/mvvm/model/mvvm/serialization/compatibilityutils.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_COMPATIBILITYUTILS_H #define BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_COMPATIBILITYUTILS_H -//! @file compatibilityutils.h +//! @file mvvm/model/mvvm/serialization/compatibilityutils.h //! @brief Place for utils to fix back compatibility of serialized projects. #include "mvvm/model_export.h" diff --git a/mvvm/model/mvvm/serialization/jsonitem_types.h b/mvvm/model/mvvm/serialization/jsonitem_types.h index 8278cda45282a280bc9ddf2ca64baa32decbb838..fdb35ccb1d9115ff6931e1c5e37d6ec3fa716753 100644 --- a/mvvm/model/mvvm/serialization/jsonitem_types.h +++ b/mvvm/model/mvvm/serialization/jsonitem_types.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONITEM_TYPES_H #define BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONITEM_TYPES_H -//! @file jsonitem_types.h +//! @file mvvm/model/mvvm/serialization/jsonitem_types.h //! Collection of custom types involved into SessionItem and JSON mutual convertion. #include "mvvm/model_export.h" diff --git a/mvvm/model/mvvm/signals/modelmapper.cpp b/mvvm/model/mvvm/signals/modelmapper.cpp index 63daff5b11b4a07e5cb9d401c8b75a696108f107..2fef63ad9dc8b8f0dbada699c1563800106bf95d 100644 --- a/mvvm/model/mvvm/signals/modelmapper.cpp +++ b/mvvm/model/mvvm/signals/modelmapper.cpp @@ -124,19 +124,19 @@ void ModelMapper::callOnDataChange(SessionItem* item, int role) //! Notifies all callbacks subscribed to "item data is changed" event. -void ModelMapper::callOnItemInserted(SessionItem* parent, const TagRow &tagrow) +void ModelMapper::callOnItemInserted(SessionItem* parent, const TagRow& tagrow) { if (p_impl->m_active) p_impl->m_on_item_inserted(parent, tagrow); } -void ModelMapper::callOnItemRemoved(SessionItem* parent, const TagRow &tagrow) +void ModelMapper::callOnItemRemoved(SessionItem* parent, const TagRow& tagrow) { if (p_impl->m_active) p_impl->m_on_item_removed(parent, tagrow); } -void ModelMapper::callOnItemAboutToBeRemoved(SessionItem* parent, const TagRow &tagrow) +void ModelMapper::callOnItemAboutToBeRemoved(SessionItem* parent, const TagRow& tagrow) { if (p_impl->m_active) p_impl->m_on_item_about_removed(parent, tagrow); diff --git a/mvvm/model/mvvm/standarditems/axisitems.h b/mvvm/model/mvvm/standarditems/axisitems.h index a3c4c1b0f27cd7d4dfa1fac51b7d3d2524388cbc..1fc9d4e86fe731d9bf6a4147b8793757a82395a0 100644 --- a/mvvm/model/mvvm/standarditems/axisitems.h +++ b/mvvm/model/mvvm/standarditems/axisitems.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_MODEL_MVVM_STANDARDITEMS_AXISITEMS_H #define BORNAGAIN_MVVM_MODEL_MVVM_STANDARDITEMS_AXISITEMS_H -//! @file axisitems.h +//! @file mvvm/model/mvvm/standarditems/axisitems.h //! Collection of axis items for 1D and 2D data/plotting support. #include "mvvm/model/compounditem.h" diff --git a/mvvm/model/mvvm/standarditems/plottableitems.h b/mvvm/model/mvvm/standarditems/plottableitems.h index 8b750cdfa3b31ee14ec3101ee43e505ef30f2c43..5673cddd90491256240129590e020f0258d84dfe 100644 --- a/mvvm/model/mvvm/standarditems/plottableitems.h +++ b/mvvm/model/mvvm/standarditems/plottableitems.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_MODEL_MVVM_STANDARDITEMS_PLOTTABLEITEMS_H #define BORNAGAIN_MVVM_MODEL_MVVM_STANDARDITEMS_PLOTTABLEITEMS_H -//! @file plottableitems.h +//! @file mvvm/model/mvvm/standarditems/plottableitems.h //! Collection of items to plot in QCustomPlot context. #include "mvvm/model/compounditem.h" diff --git a/mvvm/model/mvvm/standarditems/standarditemincludes.h b/mvvm/model/mvvm/standarditems/standarditemincludes.h index d59ac0d147d5eb4e23e6221d78926a49c574cd3a..cc7c39424a1f3334287dfc0e369d9e74206b4198 100644 --- a/mvvm/model/mvvm/standarditems/standarditemincludes.h +++ b/mvvm/model/mvvm/standarditems/standarditemincludes.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_MODEL_MVVM_STANDARDITEMS_STANDARDITEMINCLUDES_H #define BORNAGAIN_MVVM_MODEL_MVVM_STANDARDITEMS_STANDARDITEMINCLUDES_H -//! @file standarditemincludes.h +//! @file mvvm/model/mvvm/standarditems/standarditemincludes.h //! Collection of all includes with items supported by the model out-of-the-box. #include "mvvm/model/compounditem.h" diff --git a/mvvm/model/mvvm/standarditems/vectoritem.cpp b/mvvm/model/mvvm/standarditems/vectoritem.cpp index 98f04893a1f564d1e00b26767b053f7d76bd5b8a..8d20f046b124e0ff7166f18e519fd7783f949b3a 100644 --- a/mvvm/model/mvvm/standarditems/vectoritem.cpp +++ b/mvvm/model/mvvm/standarditems/vectoritem.cpp @@ -41,5 +41,5 @@ void VectorItem::update_label() std::ostringstream ostr; ostr << "(" << property<double>(P_X) << ", " << property<double>(P_Y) << ", " << property<double>(P_Z) << ")"; - setData(Variant::fromValue(ostr.str()), ItemDataRole::DATA, /*direct*/true); + setData(Variant::fromValue(ostr.str()), ItemDataRole::DATA, /*direct*/ true); } diff --git a/mvvm/model/mvvm/utils/threadsafestack.h b/mvvm/model/mvvm/utils/threadsafestack.h index 9c6e993f832343259417f4e91b867c9f191239a7..1f1dec6ad458893cb79c277fc143c375c7fa494b 100644 --- a/mvvm/model/mvvm/utils/threadsafestack.h +++ b/mvvm/model/mvvm/utils/threadsafestack.h @@ -24,7 +24,7 @@ #include <stdexcept> #include <thread> -//! @file threadsafestack.h +//! @file mvvm/model/mvvm/utils/threadsafestack.h //! @brief Thread-safe stack borrowed from Anthony Williams, C++ Concurrency in Action, Second //! edition. diff --git a/mvvm/tests/libtestmachinery/test_utils.h b/mvvm/tests/libtestmachinery/test_utils.h index 858bd7d17ca616c63a65eeac9cab93ed568d3448..b743ca07c2053b63f6fd7bbee52d7952a58dd478 100644 --- a/mvvm/tests/libtestmachinery/test_utils.h +++ b/mvvm/tests/libtestmachinery/test_utils.h @@ -19,7 +19,7 @@ #include <QString> #include <memory> -//! @file test_utils.h +//! @file mvvm/tests/libtestmachinery/test_utils.h //! @brief Collection of utility functions for various unit tests. class QJsonObject; diff --git a/mvvm/view/mvvm/widgets/standardtreeviews.h b/mvvm/view/mvvm/widgets/standardtreeviews.h index 077505ae119cbc2901c4a22b30d09648787fbf7a..56f8736b48d9f7b1dd6382796165a411576123d6 100644 --- a/mvvm/view/mvvm/widgets/standardtreeviews.h +++ b/mvvm/view/mvvm/widgets/standardtreeviews.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_VIEW_MVVM_WIDGETS_STANDARDTREEVIEWS_H #define BORNAGAIN_MVVM_VIEW_MVVM_WIDGETS_STANDARDTREEVIEWS_H -//! @file standardtreeviews.h +//! @file mvvm/view/mvvm/widgets/standardtreeviews.h //! @brief Collection of includes to get all standard tree views. #include "mvvm/widgets/allitemstreeview.h" diff --git a/mvvm/viewmodel/mvvm/editors/defaulteditorfactory.h b/mvvm/viewmodel/mvvm/editors/defaulteditorfactory.h index 90d124b37bfbad99943f28226fb8467b5422c83a..8e1cc94f5ea5cb09c9adb7b62cddd1089bdf21a6 100644 --- a/mvvm/viewmodel/mvvm/editors/defaulteditorfactory.h +++ b/mvvm/viewmodel/mvvm/editors/defaulteditorfactory.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_DEFAULTEDITORFACTORY_H #define BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_DEFAULTEDITORFACTORY_H -//! @file defaulteditorfactory.h +//! @file mvvm/viewmodel/mvvm/editors/defaulteditorfactory.h //! Defines DefaultEditorFactory and auxiliary classes for custom view model delegates. #include "mvvm/editors/editorbuilders.h" diff --git a/mvvm/viewmodel/mvvm/editors/editor_constants.h b/mvvm/viewmodel/mvvm/editors/editor_constants.h index bd4f6a2010838e77732610208e70014518fd8f3c..9e0524006ff97ca109b366fcb92591d13e57dfa6 100644 --- a/mvvm/viewmodel/mvvm/editors/editor_constants.h +++ b/mvvm/viewmodel/mvvm/editors/editor_constants.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_EDITOR_CONSTANTS_H #define BORNAGAIN_MVVM_VIEWMODEL_MVVM_EDITORS_EDITOR_CONSTANTS_H -//! @file editor_constants.h +//! @file mvvm/viewmodel/mvvm/editors/editor_constants.h //! Collection of constants specific for cell editing. #include <string> diff --git a/mvvm/viewmodel/mvvm/viewmodel/standardchildrenstrategies.h b/mvvm/viewmodel/mvvm/viewmodel/standardchildrenstrategies.h index db3be08be60980a6e9737cd914bbc8e933d36d6a..74cdeb7e4d07662403740f05f62910d52d6cc1ae 100644 --- a/mvvm/viewmodel/mvvm/viewmodel/standardchildrenstrategies.h +++ b/mvvm/viewmodel/mvvm/viewmodel/standardchildrenstrategies.h @@ -15,7 +15,7 @@ #ifndef BORNAGAIN_MVVM_VIEWMODEL_MVVM_VIEWMODEL_STANDARDCHILDRENSTRATEGIES_H #define BORNAGAIN_MVVM_VIEWMODEL_MVVM_VIEWMODEL_STANDARDCHILDRENSTRATEGIES_H -//! @file childrenstrategies.h +//! @file mvvm/viewmodel/mvvm/viewmodel/standardchildrenstrategies.h //! @brief Collection of strategies to find children, actual of fictional, of given SessionItem. //! Used for ViewModel generation when underlying SessionModel changes its layout. diff --git a/mvvm/viewmodel/mvvm/viewmodel/standardviewmodelcontrollers.h b/mvvm/viewmodel/mvvm/viewmodel/standardviewmodelcontrollers.h index b1b812950293d84ea424c426a55fef8c0c55d7d7..eb3ed4b5dead552e10de02f49bd847cc9d4c6ada 100644 --- a/mvvm/viewmodel/mvvm/viewmodel/standardviewmodelcontrollers.h +++ b/mvvm/viewmodel/mvvm/viewmodel/standardviewmodelcontrollers.h @@ -20,7 +20,7 @@ #include <string> #include <vector> -//! @file viewmodelcontrollers.h +//! @file mvvm/viewmodel/mvvm/viewmodel/standardviewmodelcontrollers.h //! Collection of standard controllers for AbstractViewModel. namespace ModelView {