-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,282 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
crates/store/re_types/definitions/rerun/datatypes/graph_edge.fbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
include "entity_path.fbs"; | ||
include "graph_node_id.fbs"; | ||
|
||
namespace rerun.datatypes; | ||
|
||
/// Represents an edge in a graph connecting two nodes (possible in different entities). | ||
/// | ||
/// If `source_entity` or `dest_entity` is left out then the node id is assumed to be within the current entity. | ||
table GraphEdge ( | ||
"attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord", | ||
"attr.rust.custom_clause": | ||
'cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))' | ||
) { | ||
/// The id of the source node. | ||
source: rerun.datatypes.GraphNodeId (order: 100); | ||
|
||
/// The id of the target node. | ||
dest: rerun.datatypes.GraphNodeId (order: 200); | ||
|
||
/// The entity path of the source node. | ||
source_entity: rerun.datatypes.EntityPath (order: 300, nullable); | ||
|
||
/// The entity path of the target node. | ||
dest_entity: rerun.datatypes.EntityPath (order: 400, nullable); | ||
} |
12 changes: 5 additions & 7 deletions
12
crates/store/re_types/definitions/rerun/datatypes/graph_node_id.fbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
namespace rerun.datatypes; | ||
|
||
// --- | ||
|
||
/// A 32-bit ID representing a node in a graph. | ||
struct GraphNodeId ( | ||
table GraphNodeId ( | ||
"attr.arrow.transparent", | ||
"attr.python.aliases": "int", | ||
"attr.python.array_aliases": "int, npt.ArrayLike", | ||
"attr.rust.derive": "Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash, bytemuck::Pod, bytemuck::Zeroable", | ||
"attr.python.aliases": "str", | ||
"attr.python.array_aliases": "Sequence[str]", | ||
"attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord, Hash", | ||
"attr.rust.repr": "transparent", | ||
"attr.rust.tuple_struct", | ||
"attr.rust.custom_clause": | ||
'cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))' | ||
) { | ||
id: uint (order: 100); | ||
id: string (order: 100); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// TODO(grtlr): improve these convenience methods | ||
|
||
use re_types_core::datatypes::EntityPath; | ||
|
||
use crate::datatypes::{GraphEdge, GraphNodeId}; | ||
|
||
impl super::GraphEdge { | ||
pub fn new(source: impl Into<GraphNodeId>, dest: impl Into<GraphNodeId>) -> Self { | ||
Self(vec![GraphEdge { | ||
source: source.into(), | ||
dest: dest.into(), | ||
source_entity: None, | ||
dest_entity: None, | ||
}]) | ||
} | ||
|
||
pub fn new_global( | ||
(source_entity, source): (impl Into<EntityPath>, impl Into<GraphNodeId>), | ||
(dest_entity, dest): (impl Into<EntityPath>, impl Into<GraphNodeId>), | ||
) -> Self { | ||
Self(vec![GraphEdge { | ||
source_entity: Some(source_entity.into()), | ||
source: source.into(), | ||
dest_entity: Some(dest_entity.into()), | ||
dest: dest.into(), | ||
}]) | ||
} | ||
} |
Oops, something went wrong.