Skip to content
Snippets Groups Projects
Commit 656ec6b4 authored by Schrödter, Tobias's avatar Schrödter, Tobias
Browse files

Use correct 0-based index when setting the marker ID

parent 0d5b386a
No related branches found
No related tags found
1 merge request!198Use correct 0-based index when setting the marker ID
......@@ -123,7 +123,7 @@ public:
// rueckgabewert false wenn keine hoeheninformationen in tracker datensatz vorliegt
bool printHeightDistribution();
void setMarkerHeights(const std::unordered_map<int, float> &heights);
void setMarkerID(int person, int markerIDs, bool manual = false);
void setMarkerID(int personIndex, int markerIDs, bool manual = false);
void setMarkerIDs(const std::unordered_map<int, int> &markerIDs);
void purge(int frame);
......
......@@ -1107,16 +1107,16 @@ void PersonStorage::setMarkerHeights(const std::unordered_map<int, float> &heigh
/**
* Sets/Overwrites the markerID for a specific person and all trackpaints belonging to that person
* @param personID internal id of persons (0 based)
* @param personIndex internal id of persons (0 based)
* @param markerIDs new marker ID
*/
void PersonStorage::setMarkerID(int personID, int markerID, bool manual)
void PersonStorage::setMarkerID(int personIndex, int markerID, bool manual)
{
if(manual)
{
mAutosave.trackPersonModified();
}
auto &person = mPersons.at(personID);
auto &person = mPersons.at(personIndex);
person.setMarkerID(markerID);
for(auto &trackPoint : person) // over TrackPoints
{
......@@ -1138,7 +1138,7 @@ void PersonStorage::setMarkerIDs(const std::unordered_map<int, int> &markerIDs)
if(markerIDs.find(personID) != std::end(markerIDs))
{
int markerID = markerIDs.at(personID);
setMarkerID(personID, markerID);
setMarkerID(i, markerID);
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment