Skip to content
Snippets Groups Projects
Commit 5ce51894 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Add isRemoving() protections to getFactorList()

parent 8e1f25ad
No related branches found
No related tags found
1 merge request!466devel->main
...@@ -158,13 +158,15 @@ FactorBasePtrList CaptureBase::getFactorList() ...@@ -158,13 +158,15 @@ FactorBasePtrList CaptureBase::getFactorList()
void CaptureBase::getFactorList(FactorBaseConstPtrList& _fac_list) const void CaptureBase::getFactorList(FactorBaseConstPtrList& _fac_list) const
{ {
for (auto f_ptr : getFeatureList()) for (auto f_ptr : getFeatureList())
f_ptr->getFactorList(_fac_list); if (not f_ptr->isRemoving())
f_ptr->getFactorList(_fac_list);
} }
void CaptureBase::getFactorList(FactorBasePtrList& _fac_list) void CaptureBase::getFactorList(FactorBasePtrList& _fac_list)
{ {
for (auto f_ptr : getFeatureList()) for (auto f_ptr : getFeatureList())
f_ptr->getFactorList(_fac_list); if (not f_ptr->isRemoving())
f_ptr->getFactorList(_fac_list);
} }
FactorBasePtr CaptureBase::addConstrainedBy(FactorBasePtr _fac_ptr) FactorBasePtr CaptureBase::addConstrainedBy(FactorBasePtr _fac_ptr)
......
...@@ -351,13 +351,15 @@ FactorBasePtrList FrameBase::getFactorList() ...@@ -351,13 +351,15 @@ FactorBasePtrList FrameBase::getFactorList()
void FrameBase::getFactorList(FactorBaseConstPtrList& _fac_list) const void FrameBase::getFactorList(FactorBaseConstPtrList& _fac_list) const
{ {
for (auto c_ptr : getCaptureList()) for (auto c_ptr : getCaptureList())
c_ptr->getFactorList(_fac_list); if (not c_ptr->isRemoving())
c_ptr->getFactorList(_fac_list);
} }
void FrameBase::getFactorList(FactorBasePtrList& _fac_list) void FrameBase::getFactorList(FactorBasePtrList& _fac_list)
{ {
for (auto c_ptr : getCaptureList()) for (auto c_ptr : getCaptureList())
c_ptr->getFactorList(_fac_list); if (not c_ptr->isRemoving())
c_ptr->getFactorList(_fac_list);
} }
bool FrameBase::hasCapture(const CaptureBaseConstPtr& _capture) const bool FrameBase::hasCapture(const CaptureBaseConstPtr& _capture) const
......
...@@ -54,13 +54,15 @@ void TrajectoryBase::removeFrame(FrameBasePtr _frame_ptr) ...@@ -54,13 +54,15 @@ void TrajectoryBase::removeFrame(FrameBasePtr _frame_ptr)
void TrajectoryBase::getFactorList(FactorBaseConstPtrList & _fac_list) const void TrajectoryBase::getFactorList(FactorBaseConstPtrList & _fac_list) const
{ {
for(auto fr_pair: frame_map_) for(auto fr_pair: frame_map_)
fr_pair.second->getFactorList(_fac_list); if (not fr_pair.second->isRemoving())
fr_pair.second->getFactorList(_fac_list);
} }
void TrajectoryBase::getFactorList(FactorBasePtrList & _fac_list) void TrajectoryBase::getFactorList(FactorBasePtrList & _fac_list)
{ {
for(auto fr_pair: frame_map_) for(auto fr_pair: frame_map_)
fr_pair.second->getFactorList(_fac_list); if (not fr_pair.second->isRemoving())
fr_pair.second->getFactorList(_fac_list);
} }
TimeStamp TrajectoryBase::closestTimeStampToTimeStamp(const TimeStamp& _ts) const TimeStamp TrajectoryBase::closestTimeStampToTimeStamp(const TimeStamp& _ts) const
......
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