Lagrange
Loading...
Searching...
No Matches
FastWindingNumber.h
1/*
2 * Copyright 2023 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
13#pragma once
14
15#include <lagrange/SurfaceMesh.h>
16
17namespace lagrange {
18
19namespace winding {
20
25{
26public:
39 template <typename Scalar, typename Index>
41
46
51
58
67
73 FastWindingNumber(const FastWindingNumber& other) = delete;
74
83
91 bool is_inside(const std::array<float, 3>& pos) const;
92
100 float solid_angle(const std::array<float, 3>& pos) const;
101
102protected:
104 struct Impl;
105
108};
109
110} // namespace winding
111} // namespace lagrange
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:66
Smart pointer with value semantics.
Definition value_ptr.h:134
FastWindingNumber()
Constructs a new instance.
FastWindingNumber(FastWindingNumber &&other) noexcept
Constructs a new instance.
FastWindingNumber & operator=(FastWindingNumber &&other) noexcept
Assignment operator.
FastWindingNumber(const FastWindingNumber &other)=delete
Constructs a new instance.
~FastWindingNumber()
Destroys the object.
FastWindingNumber(const SurfaceMesh< Scalar, Index > &mesh)
Constructs an acceleration structure on a given mesh to speed up winding number queries.
Definition FastWindingNumber.cpp:88
bool is_inside(const std::array< float, 3 > &pos) const
Determines whether the specified query point is inside the volume.
Definition FastWindingNumber.cpp:105
value_ptr< Impl > m_impl
PIMPL to hide internal data structures.
Definition FastWindingNumber.h:107
FastWindingNumber & operator=(const FastWindingNumber &other)=delete
Assignment operator.
float solid_angle(const std::array< float, 3 > &pos) const
Computes the solid angle at the query point.
Definition FastWindingNumber.cpp:110
Main namespace for Lagrange.
Definition FastWindingNumber.cpp:29