Skip to content

Commit

Permalink
[pre-commit.ci] nearly auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
dlyr committed Oct 8, 2024
1 parent 2a18bc9 commit 1fabb29
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
7 changes: 3 additions & 4 deletions doc/developer/cmakeutilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ The Radium components are :
- IO_HAS_TINYPLY : Identify if Radium::IO was compiled with tinyply support,
- IO_HAS_VOLUMES : Identify if Radium::IO was compiled with pvm volume loader support.
You might use these properties to define compilation macro in your code
-

~~~{.cmake}
get_target_property(USE_ASSIMP Radium::IO IO_HAS_ASSIMP)
Expand Down Expand Up @@ -117,10 +118,8 @@ This function takes the following parameters:
*Parameter name* | *Parameter description*
--------------------------------------------|--------------------
`<NAME> applicationName` | The name of the *executable* target to configure and install
`<USE_PLUGINS>` | If this option is given, the plugins installed into the Radium bundle at
the installation time will be copied into the application bundle.
`<RESOURCES> ResourceDir1 ResourceDir2 ...` | Optional list of directories to be considered as application resources
and installed into the application bundle.
`<USE_PLUGINS>` | If this option is given, the plugins installed into the Radium bundle at the installation time will be copied into the application bundle.
`<RESOURCES> ResourceDir1 ResourceDir2 ...` | Optional list of directories to be considered as application resources and installed into the application bundle.

When installed into a directory `<prefix>`, the application bundle has the following structure on linux, windows or on
MacOsX (if the executable is not configured as a `MACOSX_BUNDLE`):
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Geometry/RayCast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
39 changes: 18 additions & 21 deletions src/Engine/Data/Mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,22 +373,19 @@ class MultiIndexedGeometry : public CoreGeometryDisplayable<T>
using LayerKeyType = std::pair<LayerSemanticCollection, std::string>;

using EntryType = std::pair<bool, VaoIndices*>;
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<std::string>( stream, "" ) );
std::string result = stream.str();
std::sort( result.begin(), result.end() );

// Combine with layer name hash
return std::hash<std::string> {}( result ) ^
( std::hash<std::string> {}( k.second ) << 1 );
}
};
std::unordered_map<LayerKeyType, EntryType, KeyHash> 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<std::string>( stream, "" ) );
std::string result = stream.str();
std::sort( result.begin(), result.end() );

// Combine with layer name hash
return std::hash<std::string> {}( result ) ^ ( std::hash<std::string> {}( k.second ) << 1 );
}
}; // namespace Data
std::unordered_map<LayerKeyType, EntryType, KeyHash> m_indices;
}; // namespace Engine

/// LineMesh, own a Core::Geometry::LineMesh
class RA_ENGINE_API LineMesh : public IndexedGeometry<Core::Geometry::LineMesh>
Expand Down Expand Up @@ -587,8 +584,8 @@ template <typename I>
void IndexedAttribArrayDisplayable<I>::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 ) {
Expand Down Expand Up @@ -841,8 +838,8 @@ template <typename CoreGeometry>
void CoreGeometryDisplayable<CoreGeometry>::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." );

Expand Down Expand Up @@ -1133,6 +1130,6 @@ inline void GeneralMesh<Core::Geometry::QuadMesh>::triangulate() {
}
}

} // namespace Data
} // namespace Ra
} // namespace Engine
} // namespace Ra

0 comments on commit 1fabb29

Please sign in to comment.