diff --git a/source/RobotAPI/components/ArViz/Client/Client.cpp b/source/RobotAPI/components/ArViz/Client/Client.cpp index e40147d694b8118414029d27516a67566603ae27..3e6bcf38cf777e924dab5be2af0e0c86890f9427 100644 --- a/source/RobotAPI/components/ArViz/Client/Client.cpp +++ b/source/RobotAPI/components/ArViz/Client/Client.cpp @@ -68,6 +68,33 @@ Client Client::createForGuiPlugin(Component& component, return client; } +CommitResult Client::commit(const StagedCommit& commit) +{ + CommitResult result; + result.data_ = storage->commitAndReceiveInteractions(commit.data_); + return result; +} + +CommitResultAsync Client::commitAsync(const StagedCommit& commit) +{ + CommitResultAsync result; + result.async = storage->begin_commitAndReceiveInteractions(commit.data_); + result.storage = storage; + return result; +} + +void Client::commit(const std::vector<Layer>& layers) +{ + data::LayerUpdateSeq updates; + updates.reserve(layers.size()); + for (Layer const& layer : layers) + { + updates.push_back(layer.data_); + } + // This commit call still uses the legacy topic API + topic->updateLayers(updates); +} + } diff --git a/source/RobotAPI/components/ArViz/Client/Client.h b/source/RobotAPI/components/ArViz/Client/Client.h index 0a93e702598bef21feb3800e4c58b636f4fc3fd5..68e086ac52123dc5e6405c640cb35717c42f2a24 100644 --- a/source/RobotAPI/components/ArViz/Client/Client.h +++ b/source/RobotAPI/components/ArViz/Client/Client.h @@ -313,37 +313,16 @@ namespace viz return StagedCommit(); } - CommitResult commit(StagedCommit const& commit) - { - CommitResult result; - result.data_ = storage->commitAndReceiveInteractions(commit.data_); - return result; - } + CommitResult commit(StagedCommit const& commit); - CommitResultAsync commitAsync(StagedCommit const& commit) - { - CommitResultAsync result; - result.async = storage->begin_commitAndReceiveInteractions(commit.data_); - result.storage = storage; - return result; - } + CommitResultAsync commitAsync(StagedCommit const& commit); void commit(Layer const& layer) { commit({layer}); } - void commit(std::vector<Layer> const& layers) - { - data::LayerUpdateSeq updates; - updates.reserve(layers.size()); - for (Layer const& layer : layers) - { - updates.push_back(layer.data_); - } - // This commit call still uses the legacy topic API - topic->updateLayers(updates); - } + void commit(std::vector<Layer> const& layers); void commitLayerContaining(std::string const& name) { diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/ArVizComponentPlugin.cpp b/source/RobotAPI/libraries/RobotAPIComponentPlugins/ArVizComponentPlugin.cpp index 200268977005f6d3caca905696426dabd37a9d72..7c63d33b767f10ace65279b9be98e9426e5d8644 100644 --- a/source/RobotAPI/libraries/RobotAPIComponentPlugins/ArVizComponentPlugin.cpp +++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/ArVizComponentPlugin.cpp @@ -29,6 +29,7 @@ namespace armarx::plugins void ArVizComponentPlugin::preOnInitComponent() { parent().offeringTopic(getTopicName()); + parent().usingProxy(getStorageName()); } void ArVizComponentPlugin::preOnConnectComponent()