Lagrange
project_options.h
1/*
2 * Copyright 2020 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 <map>
15#include <string>
16
17namespace lagrange {
18namespace raycasting {
19
21enum class ProjectMode {
25};
26
28enum class CastMode {
29 ONE_WAY,
30 BOTH_WAYS,
31};
32
34enum class WrapMode {
35 CONSTANT,
38};
39
40inline const std::map<std::string, ProjectMode>& project_modes()
41{
42 static std::map<std::string, ProjectMode> _modes = {
43 {"CLOSEST_VERTEX", ProjectMode::CLOSEST_VERTEX},
44 {"CLOSEST_POINT", ProjectMode::CLOSEST_POINT},
45 {"RAY_CASTING", ProjectMode::RAY_CASTING},
46 };
47 return _modes;
48}
49
50inline const std::map<std::string, CastMode>& cast_modes()
51{
52 static std::map<std::string, CastMode> _modes = {
53 {"ONE_WAY", CastMode::ONE_WAY},
54 {"BOTH_WAYS", CastMode::BOTH_WAYS},
55 };
56 return _modes;
57}
58
59inline const std::map<std::string, WrapMode>& wrap_modes()
60{
61 static std::map<std::string, WrapMode> _modes = {
62 {"CONSTANT", WrapMode::CONSTANT},
63 {"CLOSEST_VERTEX", WrapMode::CLOSEST_VERTEX},
64 {"CLOSEST_POINT", WrapMode::CLOSEST_POINT},
65 };
66 return _modes;
67}
68
69} // namespace raycasting
70} // namespace lagrange
ProjectMode
Main projection mode.
Definition: project_options.h:21
@ CLOSEST_POINT
Interpolate attribute from the closest point on the source mesh.
@ RAY_CASTING
Copy attribute by projecting along a prescribed direction on the source mesh.
@ CLOSEST_VERTEX
Copy attribute from the closest vertex on the source mesh.
CastMode
Ray-casting mode.
Definition: project_options.h:28
@ BOTH_WAYS
Cast a ray both forward and backward in the prescribed direction.
@ ONE_WAY
Cast a ray forward in the prescribed direction.
WrapMode
Wraping mode for vertices without a hit.
Definition: project_options.h:34
@ CLOSEST_POINT
Interpolate attribute from the closest point on the source mesh.
@ CONSTANT
Fill with a constant value (defaults to 0).
@ CLOSEST_VERTEX
Copy attribute from the closest vertex on the source mesh.
Main namespace for Lagrange.
Definition: AABBIGL.h:30