tess 1.0.0
Performance-first tile and path simulation substrate
Loading...
Searching...
No Matches
tess::DistanceFieldProduct Class Reference

#include <tess/path/field_product_cache.h>

Public Member Functions

void reserve_goals (std::size_t count)
void reserve_nodes (std::size_t node_count)
void reserve_dependencies (std::size_t count)
void clear () noexcept
template<typename World>
auto is_valid (const World &world) const noexcept -> bool
auto status () const noexcept -> PathStatus
auto goals () const noexcept -> std::span< const Coord3 >
auto dependencies () const noexcept -> std::span< const ContentVersionDependencies::ContentVersionDependency >
auto expanded_nodes () const noexcept -> std::size_t
auto reached_nodes () const noexcept -> std::size_t
template<typename World>
auto distance_at (Coord3 coord) const noexcept -> std::uint32_t
 Reads the stored distance-to-nearest-goal at coord, or the sentinel.
auto byte_size () const noexcept -> std::size_t

Static Public Attributes

static constexpr std::uint32_t unreachable_distance
 Sentinel returned by distance_at for unreached or invalid tiles.

Friends

class FieldProductCache
template<typename World, typename Tag>
auto build_distance_field_product (const World &world, const GoalSet &goals, DistanceFieldProduct &product, DistanceFieldScratch &scratch) -> DistanceFieldResult
 Builds a dense multi-goal field into caller-owned reusable storage.
template<typename World, typename Tag, typename Provider>
auto build_distance_field_product (const World &world, const GoalSet &goals, DistanceFieldProduct &product, DistanceFieldScratch &scratch, const Provider &provider) -> DistanceFieldResult
 Builds a dense multi-goal field composed with a special provider.
template<typename World, typename Tag>
auto distance_field_product_path (const World &world, Coord3 start, const DistanceFieldProduct &product, DistanceFieldScratch &scratch) -> PathResult
 Reconstructs a borrowed path from a valid multi-goal product.
template<typename World, typename Tag, typename Provider>
auto distance_field_product_path (const World &world, Coord3 start, const DistanceFieldProduct &product, DistanceFieldScratch &scratch, const Provider &provider) -> PathResult
 Reads a multi-goal product through its matching special provider.
template<typename World, typename Tag>
auto nearest_target (const World &world, Coord3 start, const DistanceFieldProduct &product, DistanceFieldScratch &scratch) -> NearestTargetResult
 Finds the nearest reachable goal represented by a valid product.
template<typename World, typename Tag, typename Provider>
auto nearest_target (const World &world, Coord3 start, const DistanceFieldProduct &product, DistanceFieldScratch &scratch, const Provider &provider) -> NearestTargetResult
template<typename World, typename Class, typename Provider>
auto build_weighted_distance_field_product (const World &world, const GoalSet &goals, DistanceFieldProduct &product, DistanceFieldScratch &scratch, const Provider &provider) -> DistanceFieldResult
 Builds a dense multi-goal weighted field into a reusable product.
template<typename World, typename Class, typename Provider>
auto weighted_distance_field_product_path (const World &world, Coord3 start, const DistanceFieldProduct &product, DistanceFieldScratch &scratch, const Provider &provider) -> PathResult
 Reconstructs an exact weighted path through a valid reusable product.

Detailed Description

Owns a reusable dense-world multi-goal distance field and dependencies.

Building may allocate; reserve goals, nodes, and dependencies for a warm allocation-free rebuild. A product is invalid after relevant chunk edits. A stateful provider used to build it must retain its address until the product is cleared or rebuilt. Model identities are process-local; do not share a product across a dynamic-library boundary.

◆ build_distance_field_product

template<typename World, typename Tag, typename Provider>
auto build_distance_field_product ( const World & world,
const GoalSet & goals,
DistanceFieldProduct & product,
DistanceFieldScratch & scratch,
const Provider & provider ) -> DistanceFieldResult
friend

Builds a dense multi-goal field composed with a special provider.

Builds a dense-world multi-goal field into caller-owned product.

Invalid goals return InvalidGoal. Reusing reserved product and scratch capacity avoids steady-state allocation.

◆ distance_field_product_path

template<typename World, typename Tag, typename Provider>
auto distance_field_product_path ( const World & world,
Coord3 start,
const DistanceFieldProduct & product,
DistanceFieldScratch & scratch,
const Provider & provider ) -> PathResult
friend

Reads a multi-goal product through its matching special provider.

Reconstructs a path from start through a valid dense-world product.

The returned path borrows scratch storage until its next mutation.

◆ nearest_target

template<typename World, typename Tag, typename Provider>
auto nearest_target ( const World & world,
Coord3 start,
const DistanceFieldProduct & product,
DistanceFieldScratch & scratch,
const Provider & provider ) -> NearestTargetResult
friend

Finds the closest reachable goal represented by a valid dense product.

The returned path borrows scratch storage until its next mutation.

Member Data Documentation

◆ unreachable_distance

std::uint32_t tess::DistanceFieldProduct::unreachable_distance
staticconstexpr
Initial value:
=
std::numeric_limits<std::uint32_t>::max()

Sentinel returned by distance_at for unreached or invalid tiles.


The documentation for this class was generated from the following file: