diff --git a/src/Core/Containers/VariableSet.hpp b/src/Core/Containers/VariableSet.hpp index 885470a8301..ecc718e4e1f 100644 --- a/src/Core/Containers/VariableSet.hpp +++ b/src/Core/Containers/VariableSet.hpp @@ -719,7 +719,7 @@ auto VariableSet::addVariableType() -> Utils::optional*> { // used to visit the variableSet with a dynamic visitor m_vtable->m_visitFunctions.emplace_back( []( const VariableSet& c, const DynamicVisitorBase& v ) - -> std::pair> { + -> std::pair> { auto id = getVariableVisitTypeIndex(); if ( v.accept( id ) ) { auto& storage = c.getVariableStorage(); @@ -887,9 +887,11 @@ struct VariableSet::DynamicVisitor::MakeVisitOperatorHelper { template inline auto VariableSet::DynamicVisitor::makeVisitorOperator( F& f ) -> OperatorsStorageType::value_type { - auto opBuilder = MakeVisitOperatorHelper < T, F, - std::is_invocable::value || - std::is_invocable::value > {}; + auto opBuilder = MakeVisitOperatorHelper< + T, + F, + std::is_invocable::value || + std::is_invocable::value> {}; return opBuilder.makeOperator( f ); } diff --git a/src/Core/Geometry/RayCast.cpp b/src/Core/Geometry/RayCast.cpp index 263205df7fc..38a393188c4 100644 --- a/src/Core/Geometry/RayCast.cpp +++ b/src/Core/Geometry/RayCast.cpp @@ -266,7 +266,7 @@ bool RayCastCylinder( const Ray& r, return true; } } // End if (distance between ray and cyl axis < radius) - } // End of else (ray not parallel to the cylinder. + } // End of else (ray not parallel to the cylinder. return false; } diff --git a/src/Core/Utils/Attribs.hpp b/src/Core/Utils/Attribs.hpp index f6df9f23973..5fa7a82bcc2 100644 --- a/src/Core/Utils/Attribs.hpp +++ b/src/Core/Utils/Attribs.hpp @@ -454,7 +454,7 @@ void AttribBase::setName( const std::string& name ) { m_name = name; } -bool inline AttribBase::operator==( const AttribBase& rhs ) { +bool inline AttribBase::operator==( const AttribBase & rhs ) { return m_name == rhs.getName(); } diff --git a/src/Core/Utils/Singleton.hpp b/src/Core/Utils/Singleton.hpp index ff06d411e90..f137092e364 100644 --- a/src/Core/Utils/Singleton.hpp +++ b/src/Core/Utils/Singleton.hpp @@ -23,7 +23,9 @@ TYPE( const TYPE& ) = delete; \ void operator=( const TYPE& ) = delete; \ struct Deleter { \ - void operator()( TYPE* p ) const { delete p; } \ + void operator()( TYPE* p ) const { \ + delete p; \ + } \ }; \ static std::unique_ptr s_instance; \ \ @@ -33,8 +35,12 @@ s_instance = std::unique_ptr( new TYPE( args... ), Deleter() ); \ return getInstance(); \ } \ - inline static TYPE* getInstance() { return s_instance.get(); } \ - inline static void destroyInstance() { s_instance.reset( nullptr ); } + inline static TYPE* getInstance() { \ + return s_instance.get(); \ + } \ + inline static void destroyInstance() { \ + s_instance.reset( nullptr ); \ + } /// Add this macro in the singleton cpp, followed by a semicolon. // Limitations : TYPE cannot be a nested type diff --git a/src/Engine/Data/Mesh.hpp b/src/Engine/Data/Mesh.hpp index 5f97b7ddc70..b1c53534c1d 100644 --- a/src/Engine/Data/Mesh.hpp +++ b/src/Engine/Data/Mesh.hpp @@ -373,22 +373,19 @@ class MultiIndexedGeometry : public CoreGeometryDisplayable using LayerKeyType = std::pair; using EntryType = std::pair; - struct RA_CORE_API KeyHash { - std::size_t operator()( const LayerKeyType& k ) const { - // Mix semantic collection into a single identifier string - std::ostringstream stream; - std::copy( - k.first.begin(), k.first.end(), std::ostream_iterator( stream, "" ) ); - std::string result = stream.str(); - std::sort( result.begin(), result.end() ); - - // Combine with layer name hash - return std::hash {}( result ) ^ - ( std::hash {}( k.second ) << 1 ); - } - }; - std::unordered_map m_indices; -}; + struct RA_CORE_API KeyHash { std::size_t operator()( const LayerKeyType& k ) const { + // Mix semantic collection into a single identifier string + std::ostringstream stream; + std::copy( k.first.begin(), k.first.end(), std::ostream_iterator( stream, "" ) ); + std::string result = stream.str(); + std::sort( result.begin(), result.end() ); + + // Combine with layer name hash + return std::hash {}( result ) ^ ( std::hash {}( k.second ) << 1 ); +} +}; // namespace Data +std::unordered_map m_indices; +}; // namespace Engine /// LineMesh, own a Core::Geometry::LineMesh class RA_ENGINE_API LineMesh : public IndexedGeometry @@ -587,8 +584,8 @@ template void IndexedAttribArrayDisplayable::updateGL() { if ( m_isDirty ) { // Check that our dirty bits are consistent. - ON_ASSERT( bool dirtyTest = false; for ( const auto& d - : m_dataDirty ) { dirtyTest = dirtyTest || d; } ); + ON_ASSERT( bool dirtyTest = false; + for ( const auto& d : m_dataDirty ) { dirtyTest = dirtyTest || d; } ); CORE_ASSERT( dirtyTest == m_isDirty, "Dirty flags inconsistency" ); if ( !m_indices ) { @@ -841,8 +838,8 @@ template void CoreGeometryDisplayable::updateGL() { if ( m_isDirty ) { // Check that our dirty bits are consistent. - ON_ASSERT( bool dirtyTest = false; for ( auto d - : m_dataDirty ) { dirtyTest = dirtyTest || d; } ); + ON_ASSERT( bool dirtyTest = false; + for ( auto d : m_dataDirty ) { dirtyTest = dirtyTest || d; } ); CORE_ASSERT( dirtyTest == m_isDirty, "Dirty flags inconsistency" ); CORE_ASSERT( !( m_mesh.vertices().empty() ), "No vertex." ); @@ -1133,6 +1130,6 @@ inline void GeneralMesh::triangulate() { } } -} // namespace Data +} // namespace Ra } // namespace Engine } // namespace Ra