6#include "../archetype_utils.hpp"
7#include "../collection.hpp"
8#include "../component_batch.hpp"
9#include "../component_column.hpp"
10#include "../components/albedo_factor.hpp"
11#include "../components/class_id.hpp"
12#include "../components/color.hpp"
13#include "../components/image_buffer.hpp"
14#include "../components/image_format.hpp"
15#include "../components/mesh_face_rendering.hpp"
16#include "../components/position3d.hpp"
17#include "../components/texcoord2d.hpp"
18#include "../components/triangle_indices.hpp"
19#include "../components/vector3d.hpp"
20#include "../result.hpp"
283 .value_or_throw()) {}
302 return std::move(*
this);
312 return std::move(*
this);
321 return std::move(*
this);
330 return std::move(*
this);
340 return std::move(*
this);
349 return std::move(*
this);
361 return std::move(*
this);
371 return std::move(*
this);
384 return std::move(*
this);
399 _albedo_texture_buffer,
403 return std::move(*
this);
414 _albedo_texture_buffer,
418 return std::move(*
this);
426 _albedo_texture_format,
430 return std::move(*
this);
441 _albedo_texture_format,
445 return std::move(*
this);
454 return std::move(*
this);
466 return detail::partition_batches(
505 template <
typename T>
510 struct AsComponents<archetypes::Mesh3D> {
512 static Result<Collection<ComponentBatch>> as_batches(
const archetypes::Mesh3D& archetype) {
513 return detail::collect_batches(
514 {&archetype.vertex_positions,
515 &archetype.triangle_indices,
516 &archetype.vertex_normals,
517 &archetype.vertex_colors,
518 &archetype.vertex_texcoords,
519 &archetype.albedo_factor,
520 &archetype.face_rendering,
521 &archetype.albedo_texture_buffer,
522 &archetype.albedo_texture_format,
523 &archetype.class_ids}
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:90
MeshFaceRendering
Component: Determines which faces of a mesh are rendered.
Definition mesh_face_rendering.hpp:27
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:26
Arrow-encoded data of a single batch of components together with a component descriptor.
Definition component_batch.hpp:28
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components, const ComponentDescriptor &descriptor)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:46
A ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:16
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Archetype: A 3D triangle mesh as specified by its per-mesh and per-vertex properties.
Definition mesh3d.hpp:171
static constexpr auto Descriptor_vertex_texcoords
ComponentDescriptor for the vertex_texcoords field.
Definition mesh3d.hpp:243
static constexpr auto Descriptor_albedo_texture_format
ComponentDescriptor for the albedo_texture_format field.
Definition mesh3d.hpp:263
Mesh3D with_albedo_texture_format(const rerun::components::ImageFormat &_albedo_texture_format) &&
The format of the albedo_texture_buffer, if any.
Definition mesh3d.hpp:422
static constexpr auto Descriptor_class_ids
ComponentDescriptor for the class_ids field.
Definition mesh3d.hpp:268
Mesh3D with_triangle_indices(const Collection< rerun::components::TriangleIndices > &_triangle_indices) &&
Optional indices for the triangles that make up the mesh.
Definition mesh3d.hpp:306
static constexpr auto Descriptor_face_rendering
ComponentDescriptor for the face_rendering field.
Definition mesh3d.hpp:253
Mesh3D with_many_albedo_texture_format(const Collection< rerun::components::ImageFormat > &_albedo_texture_format) &&
This method makes it possible to pack multiple albedo_texture_format in a single component batch.
Definition mesh3d.hpp:437
static constexpr auto Descriptor_triangle_indices
ComponentDescriptor for the triangle_indices field.
Definition mesh3d.hpp:229
static constexpr auto Descriptor_vertex_colors
ComponentDescriptor for the vertex_colors field.
Definition mesh3d.hpp:239
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition mesh3d.hpp:221
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
Definition mesh3d.hpp:465
std::optional< ComponentBatch > albedo_factor
A color multiplier applied to the whole mesh.
Definition mesh3d.hpp:194
Mesh3D with_many_face_rendering(const Collection< rerun::components::MeshFaceRendering > &_face_rendering) &&
This method makes it possible to pack multiple face_rendering in a single component batch.
Definition mesh3d.hpp:378
static Mesh3D update_fields()
Update only some specific fields of a Mesh3D.
Definition mesh3d.hpp:286
static Mesh3D clear_fields()
Clear all the fields of a Mesh3D.
Mesh3D with_vertex_texcoords(const Collection< rerun::components::Texcoord2D > &_vertex_texcoords) &&
An optional uv texture coordinate for each vertex.
Definition mesh3d.hpp:334
static constexpr auto Descriptor_vertex_normals
ComponentDescriptor for the vertex_normals field.
Definition mesh3d.hpp:234
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
Definition mesh3d.hpp:486
std::optional< ComponentBatch > face_rendering
Determines which faces of the mesh are rendered.
Definition mesh3d.hpp:199
Mesh3D with_vertex_normals(const Collection< rerun::components::Vector3D > &_vertex_normals) &&
An optional normal for each vertex.
Definition mesh3d.hpp:316
Mesh3D with_many_albedo_texture_buffer(const Collection< rerun::components::ImageBuffer > &_albedo_texture_buffer) &&
This method makes it possible to pack multiple albedo_texture_buffer in a single component batch.
Definition mesh3d.hpp:410
static constexpr auto Descriptor_vertex_positions
ComponentDescriptor for the vertex_positions field.
Definition mesh3d.hpp:224
static constexpr auto Descriptor_albedo_texture_buffer
ComponentDescriptor for the albedo_texture_buffer field.
Definition mesh3d.hpp:258
std::optional< ComponentBatch > vertex_texcoords
An optional uv texture coordinate for each vertex.
Definition mesh3d.hpp:189
std::optional< ComponentBatch > vertex_positions
The positions of each vertex.
Definition mesh3d.hpp:175
Mesh3D with_albedo_factor(const rerun::components::AlbedoFactor &_albedo_factor) &&
A color multiplier applied to the whole mesh.
Definition mesh3d.hpp:346
Mesh3D with_many_albedo_factor(const Collection< rerun::components::AlbedoFactor > &_albedo_factor) &&
This method makes it possible to pack multiple albedo_factor in a single component batch.
Definition mesh3d.hpp:356
static constexpr auto Descriptor_albedo_factor
ComponentDescriptor for the albedo_factor field.
Definition mesh3d.hpp:248
std::optional< ComponentBatch > class_ids
Optional class Ids for the vertices.
Definition mesh3d.hpp:217
std::optional< ComponentBatch > albedo_texture_buffer
Optional albedo texture.
Definition mesh3d.hpp:209
std::optional< ComponentBatch > vertex_colors
An optional color for each vertex.
Definition mesh3d.hpp:186
Mesh3D with_vertex_colors(const Collection< rerun::components::Color > &_vertex_colors) &&
An optional color for each vertex.
Definition mesh3d.hpp:327
Mesh3D with_class_ids(const Collection< rerun::components::ClassId > &_class_ids) &&
Optional class Ids for the vertices.
Definition mesh3d.hpp:451
Mesh3D with_vertex_positions(const Collection< rerun::components::Position3D > &_vertex_positions) &&
The positions of each vertex.
Definition mesh3d.hpp:296
Mesh3D with_face_rendering(const rerun::components::MeshFaceRendering &_face_rendering) &&
Determines which faces of the mesh are rendered.
Definition mesh3d.hpp:367
std::optional< ComponentBatch > vertex_normals
An optional normal for each vertex.
Definition mesh3d.hpp:181
std::optional< ComponentBatch > triangle_indices
Optional indices for the triangles that make up the mesh.
Definition mesh3d.hpp:178
Mesh3D with_albedo_texture_buffer(const rerun::components::ImageBuffer &_albedo_texture_buffer) &&
Optional albedo texture.
Definition mesh3d.hpp:395
std::optional< ComponentBatch > albedo_texture_format
The format of the albedo_texture_buffer, if any.
Definition mesh3d.hpp:212
Component: A color multiplier, usually applied to a whole entity, e.g. a mesh.
Definition albedo_factor.hpp:14
Component: A buffer that is known to store image data.
Definition image_buffer.hpp:18