Lagrange
Loading...
Searching...
No Matches
SurfaceMeshInfo.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/AttributeFwd.h>
15#include <lagrange/AttributeValueType.h>
16#include <lagrange/utils/span.h>
17
18#include <cstdint>
19#include <string_view>
20#include <vector>
21
22namespace lagrange::internal {
23
30{
31 std::string_view name;
32 AttributeId attribute_id = 0;
33 std::underlying_type_t<AttributeValueType> value_type = 0;
34 std::underlying_type_t<AttributeElement> element_type = 0;
35 std::underlying_type_t<AttributeUsage> usage = 0;
36 size_t num_channels = 0;
37 size_t num_elements = 0;
38 bool is_indexed = false;
39
42
45 size_t values_num_elements = 0;
46 size_t values_num_channels = 0;
47 span<const uint8_t> indices_bytes;
48 size_t indices_num_elements = 0;
49 uint8_t index_type_size = 0;
50};
51
58{
59 uint8_t scalar_type_size = 0;
60 uint8_t index_type_size = 0;
61
62 size_t num_vertices = 0;
63 size_t num_facets = 0;
64 size_t num_corners = 0;
65 size_t num_edges = 0;
66 size_t dimension = 0;
67 size_t vertex_per_facet = 0;
68
69 std::vector<AttributeInfo> attributes;
70};
71
72} // namespace lagrange::internal
uint32_t AttributeId
Identified to be used to access an attribute.
Definition AttributeFwd.h:73
::nonstd::span< T, Extent > span
A bounds-safe view for sequences of objects.
Definition span.h:27
nullptr_t, size_t, ptrdiff_t basic_ostream bad_weak_ptr extent, remove_extent, is_array,...
Definition attribute_string_utils.h:21
Metadata and raw byte views for a single serialized attribute.
Definition SurfaceMeshInfo.h:30
span< const uint8_t > data_bytes
Non-indexed attribute: raw data bytes (num_elements * num_channels * sizeof(ValueType)).
Definition SurfaceMeshInfo.h:41
span< const uint8_t > values_bytes
Indexed attribute: values and indices stored separately.
Definition SurfaceMeshInfo.h:44
Complete serialized mesh representation using standard types.
Definition SurfaceMeshInfo.h:58
uint8_t index_type_size
sizeof(Index): 4 for uint32_t, 8 for uint64_t.
Definition SurfaceMeshInfo.h:60
size_t vertex_per_facet
>0 for regular meshes, 0 for hybrid meshes.
Definition SurfaceMeshInfo.h:67
uint8_t scalar_type_size
sizeof(Scalar): 4 for float, 8 for double.
Definition SurfaceMeshInfo.h:59