Lagrange
Loading...
Searching...
No Matches
get_unique_attribute_name.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/SurfaceMesh.h>
15
16#include <string>
17#include <string_view>
18
19namespace lagrange {
20
28
33{
35 std::string separator = ".";
36
38 std::string postfix = "";
39
41 int max_increment = 1000;
42
45 bool emit_warning = true;
46};
47
64template <typename Scalar, typename Index>
67 std::string_view name,
68 const UniqueAttributeNameOptions& options = {});
69
71
72} // namespace lagrange
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:73
std::string get_unique_attribute_name(const SurfaceMesh< Scalar, Index > &mesh, std::string_view name, const UniqueAttributeNameOptions &options={})
Returns a unique attribute name by appending a suffix if necessary.
Definition get_unique_attribute_name.cpp:23
Main namespace for Lagrange.
Options for generating unique attribute names.
Definition get_unique_attribute_name.h:33
std::string separator
Separator between the base name and the counter. Default is ".".
Definition get_unique_attribute_name.h:35
bool emit_warning
Whether to emit a warning when a collision is detected and a suffix is added.
Definition get_unique_attribute_name.h:45
std::string postfix
Postfix to append after the counter. Default is empty.
Definition get_unique_attribute_name.h:38
int max_increment
Maximum number of attempts to find a unique name. Default is 1000.
Definition get_unique_attribute_name.h:41