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 "../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 `components::ClassId`, Rerun will use
24 /// the attached `datatypes::AnnotationInfo` to derive labels and colors.
25 ///
26 /// Keypoints within an annotation class can similarly be annotated with a
27 /// `components::KeypointId` in which case we should defer to the label and color for the
28 /// `datatypes::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 `components::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 `datatypes::AnnotationInfo`.
36 /// The `datatypes::AnnotationInfo` for the class.
38
39 /// The `datatypes::AnnotationInfo` for all of the keypoints.
41
42 /// The connections between keypoints.
44
45 public: // START of extensions from class_description_ext.cpp:
46 /// Create a new `ClassDescription` from a single annotation info.
48 uint16_t id, std::optional<std::string> label = std::nullopt,
49 std::optional<datatypes::Rgba32> color = std::nullopt
50 )
51 : info(id, label, color) {}
52
54 AnnotationInfo info_, Collection<AnnotationInfo> keypoint_annotations_ = {},
55 Collection<KeypointPair> keypoint_connections_ = {}
56 )
57 : info(std::move(info_)),
58 keypoint_annotations(std::move(keypoint_annotations_)),
59 keypoint_connections(std::move(keypoint_connections_)) {}
60
61 // END of extensions from class_description_ext.cpp, start of generated code:
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 /// Serializes an array of `rerun::datatypes::ClassDescription` into an arrow array.
81 static Result<std::shared_ptr<arrow::Array>> to_arrow(
82 const datatypes::ClassDescription* instances, size_t num_instances
83 );
84
85 /// Fills an arrow array builder with an array of this type.
86 static rerun::Error fill_arrow_array_builder(
87 arrow::StructBuilder* builder, const datatypes::ClassDescription* elements,
88 size_t num_elements
89 );
90 };
91} // 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:82
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
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 datatypes::AnnotationInfo for the class.
Definition class_description.hpp:37
rerun::Collection< rerun::datatypes::AnnotationInfo > keypoint_annotations
The datatypes::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:47