Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions include/geode/basic/named_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

#pragma once

#include <absl/hash/hash.h>

#include <bitsery/bitsery.h>
#include <bitsery/brief_syntax.h>

Expand Down Expand Up @@ -65,6 +67,12 @@ namespace geode
return !( operator==( other ) );
}

template < typename H >
friend H AbslHashValue( H h, const NamedType& value )
{
return H::combine( std::move( h ), value.value_ );
}

private:
template < typename Archive >
void serialize( Archive& archive )
Expand Down
8 changes: 8 additions & 0 deletions include/geode/basic/uuid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@

#include <string>

#include <absl/hash/hash.h>

#include <bitsery/bitsery.h>

#include <geode/basic/common.hpp>
Expand Down Expand Up @@ -110,6 +112,12 @@ namespace geode

[[nodiscard]] std::string string() const;

template < typename H >
friend H AbslHashValue( H h, const uuid &value )
{
return H::combine( std::move( h ), value.ab, value.cd );
}

uint64_t ab;
uint64_t cd;

Expand Down
8 changes: 8 additions & 0 deletions include/geode/geometry/point.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include <array>

#include <absl/hash/hash.h>

#include <geode/basic/attribute_utils.hpp>
#include <geode/basic/range.hpp>

Expand Down Expand Up @@ -80,6 +82,12 @@ namespace geode
[[nodiscard]] Point< dimension - 1 > project_point(
local_index_t axis_to_remove ) const;

template < typename H >
friend H AbslHashValue( H h, const Point &point )
{
return H::combine( std::move( h ), point.values_ );
}

private:
friend class bitsery::Access;
template < typename Archive >
Expand Down
7 changes: 7 additions & 0 deletions include/geode/mesh/core/graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <vector>

#include <absl/container/inlined_vector.h>
#include <absl/hash/hash.h>

#include <geode/basic/passkey.hpp>

Expand Down Expand Up @@ -79,6 +80,12 @@ namespace geode
template < typename Archive >
void serialize( Archive& archive );

template < typename H >
friend H AbslHashValue( H h, const EdgeVertex& value )
{
return H::combine( std::move( h ), value.edge_id, value.vertex_id );
}

/*!
* Index of the edge
*/
Expand Down
8 changes: 8 additions & 0 deletions include/geode/mesh/core/mesh_element.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#pragma once

#include <absl/algorithm/container.h>
#include <absl/hash/hash.h>
#include <absl/types/span.h>

#include <geode/basic/uuid.hpp>
Expand Down Expand Up @@ -76,6 +77,13 @@ namespace geode
return absl::StrCat( "[", mesh_id.string(), " ", element_id, "]" );
}

template < typename H >
friend H AbslHashValue( H h, const MeshElement& value )
{
return H::combine(
std::move( h ), value.mesh_id, value.element_id );
}

uuid mesh_id;
index_t element_id{ geode::NO_ID };
};
Expand Down
29 changes: 29 additions & 0 deletions include/geode/mesh/core/solid_mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <vector>

#include <absl/container/inlined_vector.h>
#include <absl/hash/hash.h>

#include <geode/basic/passkey.hpp>

Expand Down Expand Up @@ -87,6 +88,13 @@ namespace geode
template < typename Archive >
void serialize( Archive& archive );

template < typename H >
friend H AbslHashValue( H h, const PolyhedronVertex& value )
{
return H::combine(
std::move( h ), value.polyhedron_id, value.vertex_id );
}

index_t polyhedron_id{ NO_ID };
local_index_t vertex_id{ NO_LID };
};
Expand Down Expand Up @@ -126,6 +134,13 @@ namespace geode
template < typename Archive >
void serialize( Archive& archive );

template < typename H >
friend H AbslHashValue( H h, const PolyhedronFacet& value )
{
return H::combine(
std::move( h ), value.polyhedron_id, value.facet_id );
}

index_t polyhedron_id{ NO_ID };
local_index_t facet_id{ NO_LID };
};
Expand Down Expand Up @@ -165,6 +180,13 @@ namespace geode
template < typename Archive >
void serialize( Archive& archive );

template < typename H >
friend H AbslHashValue( H h, const PolyhedronFacetVertex& value )
{
return H::combine(
std::move( h ), value.polyhedron_facet, value.vertex_id );
}

PolyhedronFacet polyhedron_facet;
local_index_t vertex_id{ NO_LID };
};
Expand Down Expand Up @@ -201,6 +223,13 @@ namespace geode
template < typename Archive >
void serialize( Archive& archive );

template < typename H >
friend H AbslHashValue( H h, const PolyhedronFacetEdge& value )
{
return H::combine(
std::move( h ), value.polyhedron_facet, value.edge_id );
}

PolyhedronFacet polyhedron_facet;
local_index_t edge_id{ NO_LID };
};
Expand Down
15 changes: 15 additions & 0 deletions include/geode/mesh/core/surface_mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <optional>

#include <absl/container/inlined_vector.h>
#include <absl/hash/hash.h>

#include <geode/basic/passkey.hpp>

Expand Down Expand Up @@ -88,6 +89,13 @@ namespace geode
template < typename Archive >
void serialize( Archive& archive );

template < typename H >
friend H AbslHashValue( H h, const PolygonVertex& value )
{
return H::combine(
std::move( h ), value.polygon_id, value.vertex_id );
}

index_t polygon_id{ NO_ID };
local_index_t vertex_id{ NO_LID };
};
Expand Down Expand Up @@ -126,6 +134,13 @@ namespace geode
template < typename Archive >
void serialize( Archive& archive );

template < typename H >
friend H AbslHashValue( H h, const PolygonEdge& value )
{
return H::combine(
std::move( h ), value.polygon_id, value.edge_id );
}

index_t polygon_id{ NO_ID };
local_index_t edge_id{ NO_LID };
};
Expand Down
8 changes: 8 additions & 0 deletions include/geode/model/mixin/core/component_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

#pragma once

#include <absl/hash/hash.h>

#include <bitsery/brief_syntax/string.h>

#include <geode/basic/growable.hpp>
Expand Down Expand Up @@ -87,6 +89,12 @@ namespace geode
return absl::StrCat( type_.get(), " ", id_.string() );
}

template < typename H >
friend H AbslHashValue( H h, const ComponentID& value )
{
return H::combine( std::move( h ), value.type_, value.id_ );
}

private:
friend class bitsery::Access;
template < typename Archive >
Expand Down
8 changes: 8 additions & 0 deletions include/geode/model/mixin/core/vertex_identifier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <vector>

#include <absl/hash/hash.h>
#include <absl/types/span.h>

#include <geode/basic/passkey.hpp>
Expand Down Expand Up @@ -64,6 +65,13 @@ namespace geode
return absl::StrCat( component_id.string(), " ", vertex );
}

template < typename H >
friend H AbslHashValue( H h, const ComponentMeshVertex& value )
{
return H::combine(
std::move( h ), value.component_id, value.vertex );
}

ComponentID component_id;
index_t vertex{ NO_ID };

Expand Down