Lagrange
compute_greedy_coloring.h
1/*
2 * Copyright 2024 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
16namespace lagrange {
17
25
30{
32 std::string_view output_attribute_name = "@color_id";
33
36
38 size_t num_color_used = 8;
39};
40
55template <typename Scalar, typename Index>
58 const GreedyColoringOptions& options = {});
59
61} // namespace lagrange
uint32_t AttributeId
Identified to be used to access an attribute.
Definition: AttributeFwd.h:73
AttributeElement
Type of element to which the attribute is attached.
Definition: AttributeFwd.h:26
@ Facet
Per-facet mesh attributes.
Definition: AttributeFwd.h:31
AttributeId compute_greedy_coloring(SurfaceMesh< Scalar, Index > &mesh, const GreedyColoringOptions &options={})
Compute a greedy graph coloring of the mesh.
Definition: compute_greedy_coloring.cpp:152
Main namespace for Lagrange.
Definition: AABBIGL.h:30
Option struct for computing dihedral angles.
Definition: compute_greedy_coloring.h:30
size_t num_color_used
Minimum number of colors to use. The algorithm will cycle through them but may use more.
Definition: compute_greedy_coloring.h:38
std::string_view output_attribute_name
Output attribute name. If the attribute already exists, it will be overwritten.
Definition: compute_greedy_coloring.h:32
AttributeElement element_type
Element type to be colored. Can be either Vertex or Facet.
Definition: compute_greedy_coloring.h:35