Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate SpaceView from a singular Component to an Archetype #4522

Merged
merged 7 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions crates/re_types/definitions/rerun/blueprint.fbs
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
include "./blueprint/datatypes/query_expressions.fbs";
include "./blueprint/datatypes/space_view_component.fbs";

include "./blueprint/components/auto_layout.fbs";
include "./blueprint/components/auto_space_views.fbs";
include "./blueprint/components/entities_determined_by_user.fbs";
include "./blueprint/components/entity_properties_component.fbs";
include "./blueprint/components/name.fbs";
include "./blueprint/components/panel_view.fbs";
include "./blueprint/components/query_expressions.fbs";
include "./blueprint/components/space_view_component.fbs";
include "./blueprint/components/space_view_maximized.fbs";
include "./blueprint/components/space_view_origin.fbs";
include "./blueprint/components/space_view_class.fbs";
include "./blueprint/components/included_space_views.fbs";
include "./blueprint/components/included_queries.fbs";
include "./blueprint/components/viewport_layout.fbs";

include "./blueprint/archetypes/space_view_blueprint.fbs";
include "./blueprint/archetypes/viewport_blueprint.fbs";
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
include "fbs/attributes.fbs";
include "rust/attributes.fbs";

include "rerun/datatypes.fbs";

namespace rerun.blueprint.archetypes;

// ---

/// The top-level description of the Viewport.
table SpaceViewBlueprint (
"attr.docs.unreleased",
"attr.rerun.scope": "blueprint",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the more I see this the more I wish this would be enforced by being in the blueprint folder. Don't know how to do that nicely though yet. Tbd

"attr.rust.derive": "Default"
) {
// --- Required ---

/// The class of the view.
class_identifier: rerun.blueprint.components.SpaceViewClass ("attr.rerun.component_required", order: 100);

// --- Optional ---

/// The name of the view.
display_name: rerun.blueprint.components.Name ("attr.rerun.component_optional", nullable, order: 200);

/// The "anchor point" of this space view.
///
/// The transform at this path forms the reference point for all scene->world transforms in this space view.
/// I.e. the position of this entity path in space forms the origin of the coordinate system in this space view.
/// Furthermore, this is the primary indicator for heuristics on what entities we show in this space view.
space_origin: rerun.blueprint.components.SpaceViewOrigin ("attr.rerun.component_optional", nullable, order: 300);

/// True if the user is has added entities themselves. False otherwise.
entities_determined_by_user: rerun.blueprint.components.EntitiesDeterminedByUser ("attr.rerun.component_optional", nullable, order: 400);
Comment on lines +33 to +34
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hum. this look so weird as a public facing property/component. But yeah we have to have something like this. One step at a time ofc, good as is!


/// `BlueprintId`s of the `DataQuery`s that make up this `SpaceView`.
///
/// It determines which entities are part of the spaceview.
contents: rerun.blueprint.components.IncludedQueries ("attr.rerun.component_optional", nullable, order: 500);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include "arrow/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

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

namespace rerun.blueprint.components;

// ---

/// Whether the space view entities were manually edited.
table EntitiesDeterminedByUser (
"attr.rerun.scope": "blueprint",
"attr.docs.unreleased",
"attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord",
"attr.rust.repr": "transparent"
) {
value: bool (order: 100);
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
include "arrow/attributes.fbs";
include "docs/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

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

namespace rerun.blueprint.components;

// ---

/// A view of a space.

/// All the queries belonging to a given `SpaceView`.
///
/// Unstable. Used for the ongoing blueprint experimentations.
table SpaceViewComponent (
table IncludedQueries (
"attr.docs.unreleased",
"attr.rerun.scope": "blueprint",
"attr.docs.unreleased",
"attr.rust.derive_only": "Clone"
"attr.rust.derive": "Default",
"attr.rust.repr": "transparent"
) {
component: rerun.blueprint.datatypes.SpaceViewComponent (order: 100);
query_ids: [rerun.datatypes.Uuid] (order: 100);
}
20 changes: 20 additions & 0 deletions crates/re_types/definitions/rerun/blueprint/components/name.fbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include "arrow/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

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

namespace rerun.blueprint.components;

// ---

/// The name of a blueprint entity.
table Name (
"attr.rerun.scope": "blueprint",
"attr.docs.unreleased",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord",
"attr.rust.repr": "transparent"
) {
value: string (order: 100);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include "arrow/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

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

namespace rerun.blueprint.components;

// ---

/// The class of a `SpaceView`.
table SpaceViewClass (
"attr.rerun.scope": "blueprint",
"attr.docs.unreleased",
"attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord",
"attr.rust.repr": "transparent"
) {
value: string (order: 100);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include "arrow/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

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

namespace rerun.blueprint.components;

// ---

/// The origin of a `SpaceView`.
table SpaceViewOrigin (
"attr.rerun.scope": "blueprint",
"attr.docs.unreleased",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord",
"attr.rust.repr": "transparent"
) {
value: rerun.datatypes.EntityPath (order: 100);
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace rerun.datatypes;
table EntityPath (
"attr.arrow.transparent",
"attr.docs.unreleased",
"attr.rust.derive": "Default",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord, Default",
"attr.rust.repr": "transparent",
"attr.rust.tuple_struct",
"attr.rust.override_crate": "re_types_core"
Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/src/blueprint/archetypes/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/re_types/src/blueprint/archetypes/mod.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading