Skip to content

Commit

Permalink
DBViewer: fixed Refine links menu not showing up if there are landmar…
Browse files Browse the repository at this point in the history
…k links
  • Loading branch information
matlabbe committed Nov 15, 2024
1 parent fd27380 commit 966feef
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions guilib/src/DatabaseViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4440,15 +4440,18 @@ void DatabaseViewer::refineLinks()
std::multimap<int, Link> allLinks = updateLinksWithModifications(links_);
for(std::multimap<int, Link>::iterator iter=allLinks.begin(); iter!=allLinks.end(); ++iter)
{
int minId = iter->second.from()>iter->second.to()?iter->second.to():iter->second.from();
int maxId = iter->second.from()<iter->second.to()?iter->second.to():iter->second.from();
if(minNodeId == 0 || minNodeId > minId)
if(iter->second.type() < Link::kPosePrior)
{
minNodeId = minId;
}
if(maxNodeId == 0 || maxNodeId < maxId)
{
maxNodeId = maxId;
int minId = iter->second.from()>iter->second.to()?iter->second.to():iter->second.from();
int maxId = iter->second.from()<iter->second.to()?iter->second.to():iter->second.from();
if(minNodeId == 0 || minNodeId > minId)
{
minNodeId = minId;
}
if(maxNodeId == 0 || maxNodeId < maxId)
{
maxNodeId = maxId;
}
}
}
if(minNodeId > 0)
Expand All @@ -4472,7 +4475,8 @@ void DatabaseViewer::refineLinks()
linkRefiningDialog_->getIntraInterSessions(intra, inter);
for(std::multimap<int, Link>::iterator iter=allLinks.begin(); iter!=allLinks.end(); ++iter)
{
if(type==Link::kEnd || type == iter->second.type())
if(iter->second.type() < Link::kPosePrior &&
(type==Link::kEnd || type == iter->second.type()))
{
int from = iter->second.from();
int to = iter->second.to();
Expand Down Expand Up @@ -4502,6 +4506,10 @@ void DatabaseViewer::refineLinks()
}
}
}
else
{
UWARN("No links can be refined!");
}
}
void DatabaseViewer::refineLinks(const QList<Link> & links)
{
Expand Down

0 comments on commit 966feef

Please sign in to comment.