Skip to content

Commit

Permalink
drop getLayerKey function
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhhughes committed Nov 19, 2024
1 parent b5f8823 commit 55de110
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 29 deletions.
7 changes: 0 additions & 7 deletions include/spark_dsg/dynamic_scene_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,6 @@ class DynamicSceneGraph {
*/
const SceneGraphNode* findNode(NodeId node_id) const;

/**
* @brief Get node layer information (if the node exists)
* @param node_id Node ID to get
* @returns A potentially valid Layer ID and prefix
*/
std::optional<LayerKey> getLayerForNode(NodeId node_id) const;

/**
* @brief Get a particular edge in the graph
*
Expand Down
9 changes: 0 additions & 9 deletions src/dynamic_scene_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,6 @@ const Node* DynamicSceneGraph::findNode(NodeId node_id) const {
return getNodePtr(node_id, iter->second);
}

std::optional<LayerKey> DynamicSceneGraph::getLayerForNode(NodeId node_id) const {
auto iter = node_lookup_.find(node_id);
if (iter == node_lookup_.end()) {
return std::nullopt;
}

return iter->second;
}

const Edge& DynamicSceneGraph::getEdge(NodeId source, NodeId target) const {
const auto edge = findEdge(source, target);
if (!edge) {
Expand Down
13 changes: 0 additions & 13 deletions tests/utest_dynamic_scene_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,19 +907,6 @@ TEST(DynamicSceneGraphTests, InsertMixedEdgeCorrect) {
testSiblingRelationship(graph, NodeSymbol('c', 0), NodeSymbol('a', 0));
}

TEST(DynamicSceneGraphTests, GetLayerKeyCorrect) {
using namespace std::chrono_literals;
DynamicSceneGraph graph;
graph.emplaceNode(2, 'a', 10ns, std::make_unique<NodeAttributes>());
graph.emplaceNode(3, NodeSymbol('x', 0), std::make_unique<NodeAttributes>());

LayerPrefix prefix('a');
EXPECT_EQ(*graph.getLayerForNode(NodeSymbol('a', 0)), LayerKey(2, prefix));
EXPECT_EQ(*graph.getLayerForNode(NodeSymbol('x', 0)), LayerKey(3));

EXPECT_FALSE(graph.getLayerForNode(NodeSymbol('b', 0)));
}

TEST(DynamicSceneGraphTests, RemovedAndNewNodesCorrect) {
using namespace std::chrono_literals;
DynamicSceneGraph graph;
Expand Down

0 comments on commit 55de110

Please sign in to comment.