Lagrange
Loading...
Searching...
No Matches
CistaSimpleScene.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 "CistaMesh.h"
15
16#include <cista/containers/vector.h>
17
18#include <cstdint>
19
20namespace lagrange::serialization::internal {
21
22namespace data = cista::offset;
23
26{
27 uint64_t mesh_index = 0;
28
31 data::vector<uint8_t> transform_bytes;
32
33 // MeshInstance::user_data (std::any) is NOT serialized.
34};
35
38{
39 uint32_t version = 1;
40
41 uint8_t scalar_type_size = 0; // sizeof(Scalar): 4 for float, 8 for double
42 uint8_t index_type_size = 0; // sizeof(Index): 4 for uint32_t, 8 for uint64_t
43 uint8_t dimension = 0; // 2 or 3
44
45 data::vector<CistaMesh> meshes;
46
48 data::vector<uint64_t> instances_per_mesh;
49
51 data::vector<CistaInstance> instances;
52};
53
54} // namespace lagrange::serialization::internal
Cista-compatible representation of a single MeshInstance.
Definition CistaSimpleScene.h:26
data::vector< uint8_t > transform_bytes
Raw bytes of the Eigen AffineTransform matrix.
Definition CistaSimpleScene.h:31
Cista-compatible representation of SimpleScene.
Definition CistaSimpleScene.h:38
data::vector< uint64_t > instances_per_mesh
Number of instances per mesh (used to reconstruct the nested vector structure).
Definition CistaSimpleScene.h:48
data::vector< CistaInstance > instances
Flattened list of all instances across all meshes.
Definition CistaSimpleScene.h:51