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

[prototype] marker annotation util #2366

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
--make sure we clear out existing markers before we write new ones.
  • Loading branch information
jturner65 committed Apr 26, 2024
commit 702ec1093779964270ec5d5943cec29360dc8ca2
5 changes: 5 additions & 0 deletions src/esp/core/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,11 @@ class Configuration {
*/
int rekeyAllValues();

/**
* @brief Clear all key-value pairs from this Configuration's valueMap
*/
void _clearAllValues() { valueMap_.clear(); }

protected:
/**
* @brief Process passed json object into this Configuration, using passed
Expand Down
2 changes: 2 additions & 0 deletions src/esp/metadata/attributes/MarkerSets.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class LinkMarkerSubset : public esp::core::config::Configuration {
*/
void setMarkers(const std::vector<Mn::Vector3>& markers) {
auto markersPtr = editSubconfig<Configuration>("markers");
// Remove all existing markers
markersPtr->_clearAllValues();
for (std::size_t i = 0; i < markers.size(); ++i) {
const std::string& key = Cr::Utility::formatString("{:.03d}", i);
markersPtr->set(key, markers[i]);
Expand Down