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