14#include <lagrange/raycasting/api.h>
15#include <lagrange/scene/SimpleScene.h>
16#include <lagrange/utils/ProgressCallback.h>
17#include <lagrange/utils/function_ref.h>
18#include <lagrange/utils/value_ptr.h>
38template <
typename Scalar,
typename Index>
52 function_ref<
bool(Index mesh_index, Index instance_index)> is_occluder = [](Index, Index) {
61 void run_batch(uint64_t num_rays);
64 bool is_visible(Index global_index) const;
67 uint64_t num_rays_cast(Index global_index) const;
70 Index num_instances() const;
105template <
typename Scalar,
typename Index>
110 const std::atomic_bool* cancel =
nullptr);
133template <
typename Scalar,
typename Index>
136 function_ref<
void(Index mesh_index, Index instance_index)> callback,
139 function_ref<
bool(Index mesh_index, Index instance_index)> is_occluder =
140 [](Index, Index) {
return true; },
141 const std::atomic_bool* cancel =
nullptr);
160template <
typename Scalar,
typename Index>
163 const OccludedInstanceEstimateOptions& options,
165 function_ref<
bool(Index mesh_index, Index instance_index)> is_occluder =
166 [](Index, Index) {
return true; },
167 const std::atomic_bool* cancel =
nullptr);
A simple thread-safe progress callback.
Definition ProgressCallback.h:27
A lightweight non-owning reference to a callable.
Definition function_ref.h:47
Stateful algorithm for finding occluded instances in a scene.
Definition remove_occluded_instances.h:40
OccludedInstanceSampler(const scene::SimpleScene< Scalar, Index, 3 > &scene, function_ref< bool(Index mesh_index, Index instance_index)> is_occluder=[](Index, Index) { return true;})
Build the ray caster and per-instance precomputation.
Simple scene container for instanced meshes.
Definition SimpleScene.h:62
Smart pointer with value semantics.
Definition value_ptr.h:134
LA_RAYCASTING_API void estimate_occluded_instances(OccludedInstanceSampler< Scalar, Index > &sampler, const OccludedInstanceEstimateOptions &options, ProgressCallback &progress, const std::atomic_bool *cancel=nullptr)
Drive an OccludedInstanceSampler progressively.
Definition remove_occluded_instances.cpp:224
Raycasting operations.
Definition compute_local_feature_size.h:20
Loop options for estimate_occluded_instances() and remove_occluded_instances().
Definition remove_occluded_instances.h:81
uint64_t num_rays
Total ray budget.
Definition remove_occluded_instances.h:84
bool until_converged
Stop early when a batch finds no new visible instances.
Definition remove_occluded_instances.h:90
uint64_t batch_size
Rays per batch. Cancellation, progress, and convergence are checked at batch boundaries.
Definition remove_occluded_instances.h:87