Skip to content

Commit

Permalink
Rerun archetypes' definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jun 11, 2023
1 parent d3b4f45 commit fc4aea0
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions crates/re_types/definitions/rerun/archetypes/points2d.fbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
include "fbs/attributes.fbs";

include "rerun/datatypes.fbs";
include "rerun/components.fbs";

namespace rerun.archetypes;

// ---

// TODO(cmc): archetype IDL definitions must always be tables
// TODO(cmc): archetype IDL definitions must refer to objects of kind component

/// A 2D point cloud with positions and optional colors, radii, labels, etc.
table Points2D (
"rust.attr.derive": "Debug, Clone, PartialEq",
order: 100
) {
// --- Required ---

/// All the actual 2D points that make up the point cloud.
points: [rerun.components.Point2D] ("rerun.attr.component_required", required, order: 1000);

// --- Recommended ---

/// Optional radii for the points, effectively turning them into circles.
radii: [rerun.components.Radius] ("rerun.attr.component_recommended", order: 2000);

/// Optional colors for the points.
///
/// \python The colors are interpreted as RGB or RGBA in sRGB gamma-space,
/// \python As either 0-1 floats or 0-255 integers, with separate alpha.
colors: [rerun.components.Color] ("rerun.attr.component_recommended", order: 2100);

// --- Optional ---

/// Optional text labels for the points.
labels: [rerun.components.Label] ("rerun.attr.component_optional", order: 3000);

/// An optional floating point value that specifies the 2D drawing order.
/// Objects with higher values are drawn on top of those with lower values.
///
/// The default for 2D points is 30.0.
draw_order: rerun.components.DrawOrder ("rerun.attr.component_optional", order: 3100);

/// Optional class Ids for the points.
///
/// The class ID provides colors and labels if not specified explicitly.
class_ids: [rerun.components.ClassId] ("rerun.attr.component_optional", order: 3200);

/// Optional keypoint IDs for the points, identifying them within a class.
///
/// If keypoint IDs are passed in but no class IDs were specified, the class ID will
/// default to 0.
/// This is useful to identify points within a single classification (which is identified
/// with `class_id`).
/// E.g. the classification might be 'Person' and the keypoints refer to joints on a
/// detected skeleton.
keypoint_ids: [rerun.components.KeypointId] ("rerun.attr.component_optional", order: 3300);

/// Unique identifiers for each individual point in the batch.
instance_keys: [rerun.components.InstanceKey] ("rerun.attr.component_optional", order: 3400);
}

0 comments on commit fc4aea0

Please sign in to comment.