@@ -145,11 +145,7 @@ class LinkSet : public esp::core::config::Configuration {
145
145
*/
146
146
void setMarkerSetPoints (const std::string& markerSetName,
147
147
const std::vector<Mn::Vector3>& markerList) {
148
- if (markerList.size () == 0 ) {
149
- removeMarkerSet (markerSetName);
150
- } else {
151
- editMarkerSet (markerSetName)->setAllPoints (markerList);
152
- }
148
+ editMarkerSet (markerSetName)->setAllPoints (markerList);
153
149
}
154
150
155
151
/* *
@@ -325,12 +321,7 @@ class TaskSet : public esp::core::config::Configuration {
325
321
void setLinkMarkerSetPoints (const std::string& linkSetName,
326
322
const std::string& markerSetName,
327
323
const std::vector<Mn::Vector3>& markerList) {
328
- auto linkSet = editLinkSet (linkSetName);
329
- linkSet->setMarkerSetPoints (markerSetName, markerList);
330
- // The above may result in the link set being empty. If so remove it.
331
- if (linkSet->getNumMarkerSets () == 0 ) {
332
- removeLinkSet (linkSetName);
333
- }
324
+ editLinkSet (linkSetName)->setMarkerSetPoints (markerSetName, markerList);
334
325
}
335
326
336
327
/* *
@@ -345,12 +336,7 @@ class TaskSet : public esp::core::config::Configuration {
345
336
const std::string& linkSetName,
346
337
const std::unordered_map<std::string, std::vector<Mn::Vector3>>&
347
338
markers) {
348
- auto linkSet = editLinkSet (linkSetName);
349
- linkSet->setAllMarkerPoints (markers);
350
- // The above may result in the link set being empty. If so remove it.
351
- if (linkSet->getNumMarkerSets () == 0 ) {
352
- removeLinkSet (linkSetName);
353
- }
339
+ editLinkSet (linkSetName)->setAllMarkerPoints (markers);
354
340
}
355
341
356
342
/* *
@@ -585,12 +571,8 @@ class MarkerSets : public esp::core::config::Configuration {
585
571
const std::string& linkSetName,
586
572
const std::string& markerSetName,
587
573
const std::vector<Mn::Vector3>& markerList) {
588
- auto taskSetPtr = editTaskSet (taskSetName);
589
- taskSetPtr->setLinkMarkerSetPoints (linkSetName, markerSetName, markerList);
590
- // After this process, the taskset might be empty, if so, delete it.
591
- if (taskSetPtr->getNumLinkSets () == 0 ) {
592
- removeTaskSet (taskSetName);
593
- }
574
+ editTaskSet (taskSetName)
575
+ ->setLinkMarkerSetPoints (linkSetName, markerSetName, markerList);
594
576
}
595
577
596
578
/* *
@@ -607,12 +589,7 @@ class MarkerSets : public esp::core::config::Configuration {
607
589
const std::string& linkSetName,
608
590
const std::unordered_map<std::string, std::vector<Mn::Vector3>>&
609
591
markerMap) {
610
- auto taskSetPtr = editTaskSet (taskSetName);
611
- taskSetPtr->setLinkSetPoints (linkSetName, markerMap);
612
- // After this process, the taskset might be empty, if so, delete it.
613
- if (taskSetPtr->getNumLinkSets () == 0 ) {
614
- removeTaskSet (taskSetName);
615
- }
592
+ editTaskSet (taskSetName)->setLinkSetPoints (linkSetName, markerMap);
616
593
}
617
594
618
595
/* *
@@ -632,10 +609,6 @@ class MarkerSets : public esp::core::config::Configuration {
632
609
for (const auto & markers : markerMap) {
633
610
taskSetPtr->setLinkSetPoints (markers.first , markers.second );
634
611
}
635
- // After this process, the taskset might be empty, if so, delete it.
636
- if (taskSetPtr->getNumLinkSets () == 0 ) {
637
- removeTaskSet (taskSetName);
638
- }
639
612
}
640
613
641
614
/* *
0 commit comments