Lagrange
Loading...
Searching...
No Matches
filter_instances.h
1/*
2 * Copyright 2026 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12#pragma once
13
14#include <lagrange/scene/SimpleScene.h>
15#include <lagrange/scene/api.h>
16#include <lagrange/utils/function_ref.h>
17
18namespace lagrange::scene {
19
20namespace detail {
21// Stand-in for C++20 std::type_identity_t: makes the templated parameter a non-deduced
22// context so `Index` is deduced from `scene` only, not from the callable.
23template <typename T>
25{
26 using type = T;
27};
28template <typename T>
29using type_identity_t = typename type_identity<T>::type;
30} // namespace detail
31
45template <typename Scalar, typename Index, size_t Dimension>
46LA_SCENE_API SimpleScene<Scalar, Index, Dimension> filter_instances(
48 function_ref<bool(detail::type_identity_t<Index>, detail::type_identity_t<Index>)> keep);
49
50} // namespace lagrange::scene
A lightweight non-owning reference to a callable.
Definition function_ref.h:47
Simple scene container for instanced meshes.
Definition SimpleScene.h:62
Definition filter_instances.h:25