Skip to content

Split ViewportBlueprint in its own crate #5421

@abey79

Description

@abey79

Attempting to add support context menu in the streams tree (re_time_panel) prompted a realisation that the data structure (and related operation) collectively implemented by {Viewport|Container|SpaceView}Blueprint are of much wider significance than just displaying the viewport and related tree.

For example, right-clicking on a streams' entity to add it to a new space view is a meaningful operation that implies a dependency of the streams view on the viewport blueprint.

After a quick glance, it appears that the following files/structs could be relatively painlessly be split of in a new re_viewport_blueprint (name TBD):

  • ViewportBlueprint (all of viewport_blueprint.rs)
  • ContainerBlueprint (all of container.rs)
  • all codegend objects (blueprint/*)
  • TreeAction

Edit: as discussed with @teh-cmc the codegen'ed stuff should go to a new re_blueprint_types crate that's lower in the hierarchy, so that re_query may access it.

Assuming the context menu code is further split off in yet another new crate, this would result in the following hierarchy (box may depend on lower box but not same-level box):

┌───────────────────────────────────────────────┐
│                   re_viewer                   │
└───────────────────────────────────────────────┘
┌──────────────────────┐ ┌──────────────────────┐
│     re_viewport      │ │    re_time_panel     │
└──────────────────────┘ └──────────────────────┘
             ┌──────────────────────┐            
             │   re_context_menu    │            
             └──────────────────────┘            
┌──────────────────────┐ ┌──────────────────────┐
│re_viewport_blueprint │ │      re_data_ui      │
└──────────────────────┘ └──────────────────────┘
             ┌──────────────────────┐            
             │    re_space_view     │            
             └──────────────────────┘            
┌───────────────────────────────────────────────┐
│              re_viewport_context              │
└───────────────────────────────────────────────┘

Stretch goal: I haven't deeply looked into that, but, given this refactor, it might be possible to further split off the blueprint tree UI in a separate crate. At the very least, viewport_blueprint_ui.rs should be renamed viewport_tree_ui.rs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🚜 refactorChange the code, not the functionality

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions