Rerun C++ SDK
Loading...
Searching...
No Matches
class_description.hpp
1// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/re_types/definitions/rerun/datatypes/class_description.fbs".
3
4#pragma once
5
6#include "../collection.hpp"
7#include "../result.hpp"
8#include "annotation_info.hpp"
9#include "keypoint_pair.hpp"
10
11#include <cstdint>
12#include <memory>
13
14namespace arrow {
15 class Array;
16 class DataType;
17 class StructBuilder;
18} // namespace arrow
19
20namespace rerun::datatypes {
21 /// **Datatype**: The description of a semantic Class.
22 ///
23 /// If an entity is annotated with a corresponding `ClassId`, rerun will use
24 /// the attached `AnnotationInfo` to derive labels and colors.
25 ///
26 /// Keypoints within an annotation class can similarly be annotated with a
27 /// `KeypointId` in which case we should defer to the label and color for the
28 /// `AnnotationInfo` specifically associated with the Keypoint.
29 ///
30 /// Keypoints within the class can also be decorated with skeletal edges.
31 /// Keypoint-connections are pairs of `KeypointId`s. If an edge is
32 /// defined, and both keypoints exist within the instance of the class, then the
33 /// keypoints should be connected with an edge. The edge should be labeled and
34 /// colored as described by the class's `AnnotationInfo`.
36 /// The `AnnotationInfo` for the class.
38
39 /// The `AnnotationInfo` for all of the keypoints.
41
42 /// The connections between keypoints.
44
45 public:
46 // Extensions to generated type defined in 'class_description_ext.cpp'
47
48 /// Create a new `ClassDescription` from a single annotation info.
50 uint16_t id, std::optional<std::string> label = std::nullopt,
51 std::optional<datatypes::Rgba32> color = std::nullopt
52 )
53 : info(id, label, color) {}
54
56 AnnotationInfo info_, Collection<AnnotationInfo> keypoint_annotations_ = {},
57 Collection<KeypointPair> keypoint_connections_ = {}
58 )
59 : info(std::move(info_)),
60 keypoint_annotations(std::move(keypoint_annotations_)),
61 keypoint_connections(std::move(keypoint_connections_)) {}
62
63 public:
64 ClassDescription() = default;
65 };
66} // namespace rerun::datatypes
67
68namespace rerun {
69 template <typename T>
70 struct Loggable;
71
72 /// \private
73 template <>
74 struct Loggable<datatypes::ClassDescription> {
75 static constexpr const char Name[] = "rerun.datatypes.ClassDescription";
76
77 /// Returns the arrow data type this type corresponds to.
78 static const std::shared_ptr<arrow::DataType>& arrow_datatype();
79
80 /// Fills an arrow array builder with an array of this type.
81 static rerun::Error fill_arrow_array_builder(
82 arrow::StructBuilder* builder, const datatypes::ClassDescription* elements,
83 size_t num_elements
84 );
85
86 /// Serializes an array of `rerun::datatypes::ClassDescription` into an arrow array.
87 static Result<std::shared_ptr<arrow::Array>> to_arrow(
88 const datatypes::ClassDescription* instances, size_t num_instances
89 );
90 };
91} // namespace rerun
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:47
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:87
All built-in datatypes. See Types in the Rerun manual.
Definition rerun.hpp:72
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:20
Datatype: Annotation info annotating a class id or key-point id.
Definition annotation_info.hpp:25
Datatype: The description of a semantic Class.
Definition class_description.hpp:35
rerun::datatypes::AnnotationInfo info
The AnnotationInfo for the class.
Definition class_description.hpp:37
rerun::Collection< rerun::datatypes::AnnotationInfo > keypoint_annotations
The AnnotationInfo for all of the keypoints.
Definition class_description.hpp:40
rerun::Collection< rerun::datatypes::KeypointPair > keypoint_connections
The connections between keypoints.
Definition class_description.hpp:43
ClassDescription(uint16_t id, std::optional< std::string > label=std::nullopt, std::optional< datatypes::Rgba32 > color=std::nullopt)
Create a new ClassDescription from a single annotation info.
Definition class_description.hpp:49